Svoboda | Graniru | BBC Russia | Golosameriki | Facebook

Business Discovery

You can use the Instagram Graph API to get basic metadata and metrics about other Instagram Business and Creator Accounts.

Limitations

Data about age-gated Instagram Business Accounts will not be returned.

Endpoints

The API consists of the following endpoints. Refer to the endpoint's reference documentation for parameter and permission requirements.

Examples

Getting an Account's Follower & Media Count

This sample query shows how to get the number of followers and number of published media objects on the Blue Bottle Coffee Instagram Business Account. Notice that business discovery queries are performed on the Instagram Business or Creator Account's ID (in this case, 17841405309211844), not the username of the Instagram Business or Creator Account that you are attempting to get data about (bluebottle in this example).

Sample Request

curl -i -X GET \
 "https://graph.facebook.com/v3.2/17841405309211844?fields=business_discovery.username(bluebottle){followers_count,media_count}&access_token={access-token}"

Sample Response

{
  "business_discovery": {
    "followers_count": 267793,
    "media_count": 1205,
    "id": "17841401441775531" // Blue Bottle's Instagram Account ID
  },
  "id": "17841405309211844"  // ID of the Instagram account performing the query
}

Getting Media

Since you can make nested requests by specifying an edge via the fields parameter, you can request the targeted Business or Creator Account's media edge to get all of its published media objects:

Sample Request

curl -i -X GET \
 "https://graph.facebook.com/v3.2/17841405309211844?fields=business_discovery.username(bluebottle){followers_count,media_count,media}&access_token={access-token}"

Sample Response

{
  "business_discovery": {
    "followers_count": 267793,
    "media_count": 1205,
    "media": {
      "data": [
        {
          "id": "17858843269216389"
        },
        {
          "id": "17894036119131554"
        },
        {
          "id": "17894449363137701"
        },
        {
          "id": "17844278716241265"
        },
        ... // results truncated for brevity
      ],
    "id": "17841401441775531"
  },
  },
  "id": "17841405309211844"
}

Getting Basic Metrics on Media

You can use both nested requests and field expansion to get public fields for a Business or Creator Account's media objects. Note that this does not grant you permission to access media objects directly — performing a GET on any returned IG Media will fail due to insufficient permissions.

For example, here's how to get the number of comments and likes for each of the media objects published by Blue Bottle Coffee:

Sample Request

curl -i -X GET \
 "https://graph.facebook.com/v3.2/17841405309211844?fields=business_discovery.username(bluebottle){followers_count,media_count,media{comments_count,like_count}}&access_token={access-token}"

Sample Response

{
  "business_discovery": {
    "followers_count": 267793,
    "media_count": 1205,
    "media": {
      "data": [
        {
          "comments_count": 50,
          "like_count": 5841,
          "id": "17858843269216389"
        },
        {
          "comments_count": 11,
          "like_count": 2998,
          "id": "17894036119131554"
        },
        {
          "comments_count": 28,
          "like_count": 3644,
          "id": "17894449363137701"
        },
        {
          "comments_count": 43,
          "like_count": 4943,
          "id": "17844278716241265"
        },
        {
          "comments_count": 60,
          "like_count": 9347,
          "id": "17899363132086521"
        },
        {
          "comments_count": 63,
          "like_count": 6913,
          "id": "17893114378137541"
        },
        {
          "comments_count": 16,
          "like_count": 2791,
          "id": "17886057709171561"
        },
        {
          "comments_count": 15,
          "like_count": 3895,
          "id": "17856337633208377"
        },
      ],
    },
    "id": "17841401441775531"
  },
  "id": "17841405976406927"
}