Facebook recently introduced Instagram Graph API, which allows to fetch data from Instagram page that is connected to your Facebook company page, instagram.com/developers states:
The Instagram Graph API is Now Available to All Developers.
For Non-Business Instagram Accounts please continue to use the existing Instagram API.
So, for example, if my company has account instagram.com/my_first_company
, I can only retrieve its feed and no one else.
Using old Instagram API to retrieve public_content permission (access to any feed) is no longer an option too, from old API documetation:
public_content - to read any public profile info and media on a user’s behalf (applications no longer accepted)
public_content
permission? (for example, there are tons of plugins for various CMS that allow to display recent Instagram photos)public_content
(access to any feed) right now (besides fetching HTML pages of Instagram website)?UPD. There seem to be ?__a=1
endpoint that allows to get access to recent photos of any public feed without any tokens. But it's not official and no one knows when/if Instagram will close it. If you do - please let me know.
UPD 2. Instagram removed ?__a=1
endpoint, not sure for how long, probably forever. Currently the only way to access instagram feed is to scrap instagram.com website, which is a horror.
In 2018, Instagram shut down its public API. Meaning, third-party apps can no longer access the API from Instagram without permission. Third-party apps now need to be approved by Instagram before they can access the API.
Prerequisite: You first need the business Instagram account to be linked with FB Page. https://help.instagram.com/356902681064399 - That one can do from the profile page of Instagram account.
Get the Instagram business account id: graph.facebook.com/v2.8/<fbPageId>?fields=instagram_business_account
. (the fbPageId
is the page id of the facebook page the account is linked)
To fetch instagram media feed: graph.facebook.com/v2.8/<igBusinessId>/media
to fetch the media feed of the Instagram account. (the igBusinessId
is the id returned in above linked instagram_business_account
) - This is still owned media as per the page access_token. Not any other user's feed.
All other endpoints (such as comments moderation, detailed insights API) mentioned here works on the business media list returned on above call.
Please note: This still does not allow to fetch un-authenticated user's Instagram feed. That is not possible via API now. There is no valid way via API to get to public_content
scope. There can be few Instagram Marketing partners for which this is enabled. But, in general the scope is deprecated now!
Currently, for FB graph API to work we need linked business page to Instagram account. As above apis uses page tokens.
You can get information about any IG business account using your FB access_token using the business_discovery API as given here.
Ex:
GET graph.facebook.com/[YOUR-IG-BUSINESS-ACCOUNT-ID]?fields=business_discovery.username(USERNAME){media{caption,media_url,media_type,like_count,comments_count,id}}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With