Get Instagram Follower Count using Graph API from a server

101 Views Asked by At

Seems like this should be SO easy, yet I'm stumped.

I need to programmatically check if an Instagram account has a lot of followers. I'm doing this for dozens of accounts per day. So I need to use the official API, not some scraping tool that's likely to get blocked.

I have set up an App in Meta Developers Portal. I have applied for and received the "Page Public Metadata Access" permission. I have added the Instagram Graph API "product" to the app. I have a system user in Meta Business Suite, and I have a "never expires" access token for that user.

But I cannot seem to combine these pieces into a Graph API call that gets me the Instagram followers count for an Instagram ID such as @weratedogs.

This is probably really obvious. What am I missing?

ATTEMPT 1: Following this page https://developers.facebook.com/docs/instagram-api/guides/business-discovery, I have tried GET https://graph.facebook.com/v19.0/{id}?fields=business_discovery.username(weratedogs)&access_token=***. I've entered my page ID, my system user ID, my app ID, my facebook page ID, my instagram account ID, and "me", none of which seem to work. I always seem to get the error "(#100) Tried accessing nonexisting field (business_discovery) on node type (xxx)" where xxx is page, app, etc. I've also tried changing the version to v3.2.

For the access token (*** in the above) I've been using the system user access token, but I've also tried getting an app token by querying https://graph.facebook.com/oauth/access_token using the app ID and secret, and requesting grant_type=client_credentials.

ATTEMPT 2: I have tried https://graph.facebook.com/v19.0/weratedogs?fields=name%2Cid&access_token=+++. This DOES get me the correct account name, and an ID that seems to be their Facebook Page ID. But I can't get anywhere after that. In this request, "+++" is "cliend-id|string" (but I don't remember how I generated the string).

ATTEMPT 3: I tried weratedogs?fields=connected_instagram_account with the +++ token from attempt 2 but that gets me "A user access token is required to request this resource." However the *** access token from attempt 1 generates a different error.

0

There are 0 best solutions below

Related Questions in INSTAGRAM-GRAPH-API