Reputation: 167
I am successful of fetching my own data using Instagram Graph Api but unable to find a way to get other person's data. Official document clearly state that metadata of basic data for other Instagram businesses and creators are obtainable but not been able to find any code or document about it. If anybody know how to do it I would love to know. Even providing me a link to document or web page that have said information is hugely appriciated.
official document https://developers.facebook.com/docs/instagram-api
Upvotes: 4
Views: 3556
Reputation: 932
This is described in the Business Discovery documentation. See also the API reference.
The tricky part is that you need to provide your Instagram account ID (or “business account ID”) in the URL. (Basically, your account's node is used to access the business_discovery
edge.)
You provide the target account's username in the field parameter, for example:
https://graph.facebook.com/v3.2/YOUR_ACCOUNT_ID?fields=business_discovery.username(bluebottle){followers_count,media_count}&access_token={access-token}
Where bluebottle
is the username of the account you want data for.
Mind that this really works with business and creators accounts, so you won't obtain data for any random account this way.
Edit: I've covered the process of getting the “business account ID” in this blog post. In summary, you can get the account ID of all accessible Instagram profiles using this request:
me/accounts?fields=instagram_business_account{id,name,username}
(Try it in Graph API Explorer)
You will then use the id
field of the returned instagram_business_account
response.
Upvotes: 3