Instagram is a social networking site for sharing photos and videos. But more than that, Instagram is also being used by many companies, brands and shops to promote their business. By using Instagram business account, companies can get real time metrics, followers insights, comments and details like these to see how their visitors are reacting to their Instagram branding strategies.
API is the acronym for Application Programming Interface. It allows two applications to talk to each other using some software program.
The Instagram Graph API allows users to programmatically access Instagram Business Accounts data for eg. media, comments, followers, etc. It makes the Instagram data easily manageable by binding API response into a custom application.
1. Login to facebook and create a facebook page of your brand or company to link with instagram business account.
2. Create an instagram account for your business
3. Now connect your facebook page with instagram account. Follow these steps:
4. Now go to https://developers.facebook.com. If not login already, login with your facebook ID.
5. Go to My Apps > Create New App:
6. Create App, by filling details in Form, Display Name is your App Name:
Here we have selected Social_connect as our App Name. Once created, you will be redirected to App detail page:
7. Now go to Tools>Graph API Explorer:
8. Make sure your App is selected in Application. If not, select it from the dropdown:
It will show a Permission popup:
Select manage_pages , instagram_basic and insights permissions.
10. It creates an access token and adds automatically to Access Token field:
One thing to note is that, this token is short term token and expires in few hours. To bind token in our app, we generally need long-lived token. To generate a long-lived token, follow these steps:
The long lived token can also be generated using API call. You can find more information about this in the following link: https://developers.facebook.com/docs/facebook-login/access-tokens/refreshing#long-via-code
11. Now we need our page id to proceed. There are 2 options to get facebook page id.
12. Enter your page ID in API path and hit the Enter button; it will return page name and page id:
13. You need to have instagram_business_account id to proceed with Instagram Graph API. For this, select instagram_business_account from Search fields left side and hit enter. You will receive id of your instagram_business_account:
14. Now enter instagram_business_account id to API path.
15. To get followers count for a business account, get the business account username and put it in this API url:
?fields=business_discovery.username(<enter account username here>){followers_count,media_count}
For example : ?fields=business_discovery.username(bluebottle){followers_count,media_count}
Add this path after instagram_business_account_id in API url and you will receive followers count and media count as response: