You can use the Instagram API with Facebook Login to get basic metadata and metrics about other Instagram professional accounts.
Data about age-gated Instagram professional accounts will not be returned.
The API consists of the following endpoints. Refer to the endpoint's reference documentation for parameter and permission requirements.
This sample query shows how to get the number of followers and number of published media objects on the Blue Bottle Coffee Instagram professional account. Notice that business discovery queries are performed on the app user's Instagram professional account ID (in this case, 17841405309211844
) with the username of the Instagram professional account that your app user is attempting to get data about (bluebottle
in this example).
Formatted for readability.
curl -i -X GET \
"https://graph.facebook.com/v21.0
/17841405309211844 \
?fields=business_discovery.username(bluebottle){followers_count,media_count} \
&access_token=<YOUR_APP_USERS_INSTAGRAM_USER_ACCESS_TOKEN>"
{ "business_discovery": { "followers_count": 267793, "media_count": 1205, "id": "17841401441775531" // Blue Bottle's Instagram user ID }, "id": "17841405309211844" // Your app user's Instagram user ID }
Since you can make nested requests by specifying an edge via the fields
parameter, you can request the targeted professional account's media
edge to get all of its published media objects.
Formatted for readability.
curl -i -X GET \
"https://graph.facebook.com/v21.0
/17841405309211844 \
?fields=business_discovery.username(bluebottle){followers_count,media_count,media} \
&access_token=<YOUR_APP_USERS_INSTAGRAM_USER_ACCESS_TOKEN>"
{ "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" }
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:
Formatted for readability.
curl -i -X GET \
"https://graph.facebook.com/v21.0
/17841405309211844 \
?fields=business_discovery.username(bluebottle){followers_count,media_count,media{comments_count,like_count}} \
&access_token=<YOUR_APP_USERS_INSTAGRAM_USER_ACCESS_TOKEN>"
{ "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" }