Este documento se ha actualizado.
La traducción en Español (España) no está disponible todavía.
Actualización del documento en inglés: 26 ene.
Actualización del documento en Español (España): 21 jul. 2022

IG Hashtag Top Media

Represents a collection of the most popular photo and video IG Media objects that have been tagged with a hashtag.

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.

Llamadas de la versión 10.0 y anteriores hasta el 7 de septiembre de 2021: el campo like_count de un contenido multimedia de Instagram devolverá 0 si la persona propietaria ha ocultado el recuento de Me gusta de dicho contenido.

Llamadas de la versión 11.0 y posteriores a partir del 7 de septiembre de 2021: si consultas un contenido multimedia de Instagram indirectamente a través de otro extremo o expansión de campo, el campo like_count se omitirá de las respuestas de la API si el propietario del contenido multimedia ha ocultado su recuento de Me gusta. Al consultar directamente el contenido multimedia de Instagram (solo puede hacerlo su propietario), se devolverá el recuento real de Me gusta, aunque se haya ocultado.

Creating

This operation is not supported.

Reading

Getting the Most Popular Hashtagged Media

GET /{ig-hashtag-id}/top_media?user_id={user-id}&fields={fields}

Returns the most popular photo and video IG Media objects that have been tagged with the hashtag.

Query String Parameters

  • {user_id} (required) — The ID of the Instagram Business or Creator Account performing the query.
  • {fields} — A comma-separated list of fields you want returned. See Returnable Fields.

Limitations

  • This edge only returns public photos and videos.
  • Will not return promoted/boosted/ads media.
  • 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.
  • This endpoint only returns an after cursor for paginated results; a before cursor will not be included. In addition, the after cursor value will always be the same for each page, but it can still be used to get the next page of results in the result set.

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 pages_read_engagement.

Tokens

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

Response

An array of IG 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
  • children (only returned for Album IG Media)
  • comments_count
  • id
  • like_count (v10.0 and older calls: value will be 0 if the media owner has hidden like counts it. v11.0+ calls: field will be omitted if media owner has hidden like counts in it.)
  • media_type
  • media_url (not returned for Album IG Media)
  • permalink
  • timestamp (only available on v7.0+)

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.