16

I am digging into Instagram APIs and find out a URL https://i.instagram.com/api/v1 which used by many git repos(some are recently updated) but when I go to Instagram there is no such url available there. Can anyone guide me what is the use of this url and how I can use it because when I hit

https://i.instagram.com/api/v1/accounts/login/

by POSTMAN i got below message

{
    "message": "Your version of Instagram is out of date. Please upgrade your app to log in to Instagram.",
    "status": "fail",
    "error_type": "needs_upgrade"
}

One more thing. I am with my friend who work in android he has done reverse engineering on a app which use for increase followers and that app is also using same endpoints and working on that app.

Flimtix
  • 356
  • 1
  • 4
  • 17
silentcoder
  • 992
  • 3
  • 9
  • 21
  • 2
    Sounds like that API version is *deprecated* and no longer in use/should not be used anymore. – deceze Apr 17 '17 at 13:36
  • Please check https://github.com/mgp25/Instagram-API. its recently updated. – silentcoder Apr 17 '17 at 13:37
  • 1
    As it says there: *"This is Instagram's private API."* Basically, you're on your own if you poke around there, and in fact Instagram would rather you not. – deceze Apr 17 '17 at 13:41

3 Answers3

4

It's November 2021, and somehow the API https://i.instagram.com/api/v1 still works, but I believe they have changed the way you use it.

NOTE: The given information is just for educational purposes

Let's take the user/{user_id}/info endpoint of this API, which returns basic information about the user_id.

The URL with this endpoint would be

https://i.instagram.com/api/v1/users/176702683/info/

If you paste this link into your browser you'll get the following message

{"message":"useragent mismatch","status":"fail"}

This means that API must be called via mobile user-agent. read more about user-agent here

We can solve this problem by providing a mobile user-agent string.

Using python requests library

!pip install requests
import requests
URL = https://i.instagram.com/api/v1/users/176702683/info/
headers = {'User-Agent':'Instagram 76.0.0.15.395 Android (24/7.0; 640dpi; 1440x2560; samsung; SM-G930F; herolte; samsungexynos8890; en_US; 138226743)'} 
# samsung mobile user-agent

response = requests.get(url, headers=headers)

print(response.json())

Output:

{
    "user": {
        "username": "marcelotwelve",
        "pk": 176702683,
        "profile_pic_url": "https://instagram.fzrh3-1.fna.fbcdn.net/v/t51.2885-19/233796637_544571223333074_8761964745157634211_n.jpg?stp=dst-jpg_s150x150\\u0026_nc_ht=instagram.fzrh3-1.fna.fbcdn.net\\u0026_nc_cat=1\\u0026_nc_ohc=Cfk2kHCxgbIAX_vgNjn\\u0026edm=AEF8tYYBAAAA\\u0026ccb=7-5\\u0026oh=00_AT-tuXbAbsIkvmJqm_akQS__UPDtEXZxZChx2lO-9Wb0FQ\\u0026oe=62A8115E\\u0026_nc_sid=a9513d"
    },
    "status": "ok"
}

NOTE: Please be aware of how you use it

Flimtix
  • 356
  • 1
  • 4
  • 17
Aditya Rajgor
  • 953
  • 8
  • 14
3

It is actually an API, that you can only use from your phone application, thats why it say it needs upgrade. you can download an addon for chrome / firefox to switch user agents, and after that you will be able to see the content.

It's worth checking there is lots of info about any user on insa

Shepherd
  • 41
  • 3
1

this response is a default error caused by having no cookie set

inspect instagram, you can see a redirect first (this way they fill initial cookies set for you). copy paste it to postman and try again

CallMeLoki
  • 1,281
  • 10
  • 23