Top Media

This edge allows you to get the most popular photos and videos that have been tagged with a hashtag.

Creating

This operation is not supported.

Reading

Getting the Most Popular Hashtagged Media

To get the most popular photos and videos that have been tagged with a specific hashtag, send a GET request to the /{hashtag-id}/top_media edge and include the Instagram Business User ID using the user_id parameter.

Popularity is determined by a mix of views and viewer interaction using the same methodology that determines the top posts when searching for a hashtag on www.instagram.com.

Limitations

  • This edge only returns public photos and videos.
  • Responses are paginated with a maximum limit of 50 results per page.
  • You can query a maximum of 30 unique hashtags within a 7 day period.
  • You cannot request the username field on returned media objects.
  • Responses will not include any personally identifiable information.

Requirements

TypeDescription

Features

Instagram Public Content Access

Permissions

instagram_basic


If the token is from a User whose Page role was granted via the Business Manager, one of the following permissions is also required: ads_management, business_management, or manage_pages.

Page Connection

A Facebook Page must be connected to the Instagram Business User whose ID you are including in your query.

Tokens

A User access token of a Facebook User who has been approved for tasks on the connected Facebook Page.

Response

An array of media objects. Excess results will be paginated.

Returnable Fields

You can use the fields parameter to request the following fields on returned media objects:

  • caption
  • comments_count
  • id
  • like_count
  • media_type
  • media_url
  • permalink

Sample Request

GET graph.facebook.com/17873440459141021/top_media
  ?user_id=17841405309211844
  &fields=id,media_type,comments_count,like_count

Sample Response

{
  "data": [
    {
      "id": "17880997618081620",
      "media_type": "IMAGE",
      "comments_count": 84,
      "like_count": 177
    },
    {
      "id": "17871527143187462"
      "media_type": "IMAGE",
      "comments_count": 24,
      "like_count": 57
    },
    {       
      "id": "17896450804038745"
      "media_type": "IMAGE",
      "comments_count": 19,
      "like_count": 36
    },
    ... // Results truncated for clarity
  ],
  "paging":
    {
      "cursors":
        {
          "after": "NTAyYmE4..."
        },
      "next": "https://graph.facebook.com/..."
    }
}

Updating

This operation is not supported.

Deleting

This operation is not supported.