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.
Instagram Graph API The API can be used to get and publish their media, manage and reply to comments on their media, identify media where they have been @mentioned by other Instagram users, find hashtagged media, and get basic metadata and metrics about other Instagram Businesses and Creators.
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.
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.fstv6-1.fna.fbcdn.net/v/t51.2885-19/s150x150/233796637_544571223333074_8761964745157634211_n.jpg?_nc_ht=instagram.fstv6-1.fna.fbcdn.net&_nc_ohc=eGzrZ-M4-38AX_tcXpC&edm=AEF8tYYBAAAA&ccb=7-4&oh=f9d6b82dc00b16b86eaabe518aea4a3f&oe=618DB9E6&_nc_sid=a9513d'},
'status': 'ok'}
NOTE: Please be aware of how you use it
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