1

I have an app that our employs Facebook Login and has our users connect their Instagram accounts via Instagram Basic Display API.

So I have an Instagram basic display access token for each of our user's and I have their 'account ids' but I cannot figure out how to get the user's profile picture through this API?

steve
  • 2,488
  • 5
  • 26
  • 39
  • have you found the solution because i'm stuck at exact same point searching for solution to this same problme I got long term access token and userid, username. How can i get other profile infomration like followers, bio, profile_pic ? Can someone please help ? – Mitesh vaghela Jul 15 '22 at 15:35

3 Answers3

3

If you could get the users username you could use this link as GET request: https://www.instagram.com/username/?__a=1

Example would be:

https://www.instagram.com/instagram/?__a=1 

Then you get the user information for the user instagram

You get source URL to the picture in "profile_pic_url": & "profile_pic_url_hd" in the message Body which is the link to the profile photo, hope it helps.

Filip Huhta
  • 2,043
  • 7
  • 25
  • 2
    This works until Instagram rate limits your ip. After a number of calls I noticed my requests started failing. I suppose combined with a number of proxies this is an option if there really is no official api for it. – steve Mar 10 '21 at 18:01
  • perhaps use the profile_pic_url then to find image via https://developers.facebook.com/docs/instagram-basic-display-api/reference/media ? (not sure though if user's profile pic is also available as part of user's media and not just metadata) – gawkface Mar 10 '21 at 21:29
  • 1
    TLDR is that it no longer works or it only works if you're logged in to the account. Follow this thread: https://stackoverflow.com/questions/49265339/instagram-a-1-url-not-working-anymore-problems-with-graphql-query-to-get-da – Nathan Jan 23 '22 at 10:40
0

AS you have a user access-token that means you can have a user Instagram id.

GET graph.facebook.com/v10.0/{instagram-user-id}
response : {.....,
            has_profile_picture: bool type 
            profile_pic : url sting type
            ....
           }

The above API will help you and for more, you can follow the below link it has all the info required to get user details. https://developers.facebook.com/docs/graph-api/reference/instagram-user/

Dev Kumar
  • 96
  • 7
  • I've tried this. The token and user_id I have from my users logging in through the Basic Display API Display is not compatible with this graph API – steve Mar 12 '21 at 21:36
-1

Have you integrated Instagram's Graph API? Reference: https://developers.facebook.com/docs/instagram-basic-display-api/reference/user

Noor
  • 967
  • 7
  • 18
  • Yeah, and I'm using this api to fetch the user's instagram username. However these docs only specify 4 fields that can be queried; account_type, id, media_type, username. There doesn't seem to be a profile_picture_url field, but it feels (and I'm hoping) like this should be accessible somewhere. – steve Mar 04 '21 at 15:32
  • Check this thread https://stackoverflow.com/a/41494968/4439983, might help you – Noor Mar 07 '21 at 10:20
  • Yeah I've read that. The issue there is the older techniques are outdated as instagram's api has changed a lot in the past couple years. The most recent solution is what I was doing but realized instagram rate limits requests so I'd have to dial in a proxy farm to route my requests through to not get blocked as were making a lot of requests. I've implemented a solution that does hit a user's profile picture, I just feel like theirs got to be a better more robust way but maybe not. – steve Mar 07 '21 at 23:40