21

I'm trying to figure something out...

As most of the 'old' API has been shut down, I've taken a look at the Graph API. I would like to retrieve the list of followers of a specific user. For the life of me I can't figure it out... is this really not possible anymore? The Business Discovery API is limited to only business accounts (as is the whole Graph API for now), but even that only seems to be able to retrieve the followers_count, not the actual followers.

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

What I can't wrap my head around: With all these limitations of the Graph API, how is it that services like HypeAuditor.com are still up and running? How are they getting their data, if the API is so incredibly limited?

Maybe someone has some insights..

ekad
  • 14,436
  • 26
  • 44
  • 46
Sander
  • 449
  • 2
  • 5
  • 12

2 Answers2

31

Instagram API was deprecated as April 4th 2018 (You can read all of the change log here https://www.instagram.com/developer/changelog/) and this is all because privacy issues landed on Instagram as so many developers misused the API to retrieve user data massively using user's private key.

Now, you can still use Instagram API but only limited to your own user (since Instagram only leave this endpoint available for you). If you want to get other user's data (for example Justin Bieber's follower, following, post count, etc.) you can use Instagram Private APIs made by developers by reverse engineering the Instagram app. If you choose to use Instagram private API, you need to be careful, because you will have bigger limitation of maximum request in some period of time (from my experience, about 100 request of pulling user data per-5 minutes or so).

You need to note that Facebook don't want you to you access other people's data by deprecating most of it's API endpoints.

Facebook currently is developing new Instagram API for awhile called Graph API. But if you don't have any products in a production state, your application might be rejected (read here at When To Submit section https://developers.facebook.com/docs/apps/review/). By using this API, you can get all of your demographics data (limited to your own user) by connecting your Instagram and Facebook account.

This is a reference to a good Instagram Private API I ever use:

  1. PHP (https://github.com/mgp25/Instagram-API) Taken down, explanation below.
  2. Python (https://github.com/LevPasha/Instagram-API-python) Also taken down.

If you just need basic data like:

  1. Simulating Instagram search bar
  2. Basic data such as name, Instagram handle, follower count

there is API endpoint for public use by Instagram. You can use this link format:

https://www.instagram.com/web/search/topsearch/?context=blended&query=put_instagram_username_here.

After gathering the desired data (e.g. follower_count) you can start processing the data and store it. I get the endpoint by debugging at network calls from the Instagram web.


UPDATE (19th February 2020):

PHP repository made by mg25 has been taken down by Facebook Inc. (github DMCA article here) because of data violation and prohibited usage behavior of Instagram API.


UPDATE (22nd March 2020):

Here is clone of Instagram-API by mgp25 uploaded to Launchpad (launchpad.net/instagram-api). Thank you Eugene for this info!

Disclaimer: Use the library on your own risk! Since the library is no longer maintained, some API might be deprecated. The usage might be dangerous and may result in permanent ban.


UPDATE (17th April 2021):

Just found new way to extract data from fb's graphql through web browser: https://www.instagram.com/{your_ig_username_here}/?__a=1

Example:

https://www.instagram.com/f1/?__a=1
Michael M.
  • 10,486
  • 9
  • 18
  • 34
Yongky Ali
  • 471
  • 4
  • 12
  • 3
    Thanks for your super helpful repy Yongky, I did not know of the existence of Private API's. I will dive into them and see if they can solve my problems! – Sander Oct 02 '18 at 10:40
  • No problem, happy to help :) – Yongky Ali Oct 02 '18 at 16:46
  • 1
    What is Instagram Private API? – Green Apr 28 '19 at 13:15
  • 1
    @Green it's an unofficial package built by communities that replicate the official ones. Usually made by scraping the Instagram apps or website. – Yongky Ali Apr 30 '19 at 07:40
  • There are many iOS apps shows User/Followers. I read the permission documentation on Instagram Developer docs. Followers request has been deprecated. But how App Store apps still shows followers? I do not understand. Anyone knows ? – emresancaktar Jul 02 '19 at 11:44
  • @emresancaktar there is API endpoint for public use by Instagram. You can use this link format `https://www.instagram.com/web/search/topsearch/?context=blended&query=put_instagram_username_here`. After gathering the desired data (eg. follower_count), you need to save it in your database and refresh it once or twice a day. I get the endpoint by debugging at network calls from the Instagram web. – Yongky Ali Jul 07 '19 at 06:41
  • @Yongky thanks for the information. I got the JSON data from your link but JSON data not contains followers user info. How they reach the followers info? Thanks. – emresancaktar Jul 14 '19 at 10:20
  • @emresancaktar to do that, you have to use those libraries mentioned above. It's not yet possible to retrieve follower data using any public API. – Yongky Ali Jul 15 '19 at 04:50
  • 1
    Found a clone of mgp25 Instagram-API, here https://launchpad.net/instagram-api – Eugene Mar 21 '20 at 02:27
  • the python repo no longer exists, it fortunately had a snapshot on the way back machine https://web.archive.org/web/20190622161309if_/https://github.com/LevPasha/Instagram-API-python . you cant view the code but you can still download the zip file – basic mojo Feb 28 '21 at 11:03
  • This link «  /?__a=1 » have been there for a while but is it free to use in a application that will be on the market? – Abv May 15 '21 at 16:17
  • @Abv It's safe, but I'm afraid you will face CORS problem if you're not fetching from API Client like Insomnia / Postman or browser. – Yongky Ali May 20 '21 at 15:32
  • @Yongy Ali what do you mean by Cors? Are you using those api clients you cited? If I use the /?__a=1 link too many times in a short time, i get ip blocked. – Abv May 21 '21 at 00:22
-9

Yaro of HypeAuditor here. We do not use Private API and do not recommend to use Private API since it's prohibited by Insta Terms and Privacy and also we do not retrieve a list of followers since that is private information and we respect privacy.