I am trying to get some details ( username, description, Posts Count, total likes & total comments ) from Instagram user
First i get the code from api.instagram.com with scope user_profile and user_media https://api.instagram.com/oauth/authorize?client_id={appId}&redirect_uri={redirectUri}&scope=user_profile,user_media&response_type=code
After the user accepts the permission and allows the sharing of information it I got the code in my redirectUri.
then using that code and developer auth details I get the access_token by
https://api.instagram.com/oauth/access_token endpoint with fields client_id, redirect_uri, grant_type = authorization_code, client_secret and the code. in response, I got the user_id and the access_token.
Then I try to get the username and user details by calling the below endpoint Refrence
https://graph.instagram.com/me?fields=id,username&access_token={access_token} . in response, I got the username and id.
Now I am not sure how to get the details like ( username, description, Posts Count, total likes & total comments ).
What I have tried
You're currently using the Instagram Basic Display APIs ( official docs ) which are highly limited and do not include any of the information you seek, apart from the username
.
Instagram chose not to include this information in the Instagram Basic Display APIs, while they offer them in the Instagram Graph API ( official docs ) instead.
However, the Instagram Graph API only works with Business and Creators accounts, therefore you can not use it for most Instagram users.
Furthermore the 2 APIs do not communicate with each other, so you can not use the Basic Display Token on the Graph token, even if the user is business.
Bottom line:
It's a pity, I know, but that's the current situation.
EDIT: scraping from https://www.instagram.com/someone/?__a=1 is very complicated, Instagram has a great anti-crawling policy and will block scraping very well.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.