skip to Main Content

I like to get an instagram user’s followers number. I.e. https://www.instagram.com/robertdowneyjr has 50.8 million followers.

First I’ve tried the simplest way where you get the https://www.instagram.com/robertdowneyjr/?__a=1 URL and parse followers from the JSON format but it’s only works when you already signed in instagram at current browser or u’ll be redirected to the login page.

I also have instagram API credentials (appId, secret, redirect URL) for the Instagram Basic Display (facebook API product) and I can set up the connection and can use API’s endpoints, but with that I’m unable to get a 3rd user’s followers number but my own/or the user’s who authorized the app (documentation https://developers.facebook.com/docs/instagram-basic-display-api/).

So I like to get anyone’s followers number only by their instagram username I.e. robertdowneyjr. Where would I search for?

2

Answers


  1. The right way to do this is with business discovery API (although it has its problems. IG API has never fully recovered from their sudden deprecation of the legacy API).

    https://developers.facebook.com/docs/instagram-api/guides/business-discovery

    Refer to the documentation for the necessary permissions. Here is an example of the call you will need to make:

    https://graph.facebook.com/v3.3/xxxx?fields=business_discovery.username(USERNAME){followers_count}&access_token=TOKEN

    WHERE xxxx is the Instagram ID of the account that has the permissions, USERNAME is the instagram username that you are trying to retrieve followers for, and TOKEN is an access_token that has the appropriate permissions.

    This will only get followers for business or creator accounts. Individual accounts will not work, even if they are public.

    Login or Signup to reply.
  2. I’ve written a countless number of Instagram data scraping applications for clients… and I’ll keep it real with you: stay far, far away from the Facebook Business API. It’s atrocious.

    What I do recommend, is using Instagram’s private API that they expose to mobile or their public web-facing API. Luckily for us, people have written many libraries that utilise both of these APIs. Most of these libraries also automatically handle Instagram’s rate limiting.

    Here are some of the libraries I’ve used and would recommend:

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search