How do you programmatically get the large version of an Instagram user's profile picture?
- As of 29 June 2020, the old Instagram API no longer functions, leaving only 2 APIs: The Instagram Graph API and the Instagram Basic Display API
- The Instagram Graph API can only be used to query Business accounts and Creator accounts, not Personal/Consumer accounts
- The Basic Display API does not have any endpoints/nodes/fields that return a user's profile picture
- There is a JSON URL (https://www.instagram.com/ducks.ig/?__a=1) that is not an API and hence will get redirected if you attempt to access it programmatically (e.g. http requests or via Puppeteer/Playwright)
- The above JSON includes the URLs for the profile picture but even this only goes up to 320x320 resolution
- You can turn a normal non-profile-picture post into a large version by adding "/media/?size=l" to its URL, e.g.:
https://www.instagram.com/p/CCbqM0cAJxt/
>
https://www.instagram.com/p/CCbqM0cAJxt/media/?size=l
>
https://scontent-syd2-1.cdninstagram.com/v/t51.2885-15/e35/s1080x1080/107076095_911018656060721_2490095601471235611_n.jpg?_nc_ht=scontent-syd2-1.cdninstagram.com&_nc_cat=105&_nc_ohc=6ZyOcQxJs9kAX93A5KW&oh=80c42c1b22a515d292fbddc6609d0091&oe=5F3FBD2C - But profile pictures don't have a shortcode (e.g. CCbqM0cAJxt) or corresponding post URL
- SOMEHOW, these four sites below are able to programmatically fetch up to 1080x1080 profile pictures, with pre-signed URLs right from Instagram's CDN:
https://www.instadp.com
http://izuum.com
https://gramvio.com
https://fullinstadp.com - I have noticed the same large profile picture can be on different CDNs:
https://scontent-ort2-1.cdninstagram.com/v/t51.2885-19/106195709_271564850736374_1860236273828034291_n.jpg?_nc_ht=scontent-ort2-1.cdninstagram.com&_nc_ohc=AMk40lVze2EAX_svbJN&oh=e5ab8d27b9968f3e26f087910cc29e52&oe=5F3E33E4
https://scontent-den4-1.cdninstagram.com/v/t51.2885-19/106195709_271564850736374_1860236273828034291_n.jpg?_nc_ht=scontent-den4-1.cdninstagram.com&_nc_ohc=AMk40lVze2EAX-_l-ro&oh=7358f8abec6104377e6013b21b38ae09&oe=5F3E33E4
https://scontent-vie1-1.cdninstagram.com/v/t51.2885-19/106195709_271564850736374_1860236273828034291_n.jpg?_nc_ht=scontent-vie1-1.cdninstagram.com&_nc_ohc=AMk40lVze2EAX85UWd4&oh=978c74c43d48659dd4c30e774c79a6c9&oe=5F3E33E4
Any ideas?
Posted Jul 19, 2020, 3:33 PM UTC
31
It seems you may have included a screenshot of code in your post "How do you programmatically get the large version of an Instagram user's profile picture?".
If so, note that posting screenshots of code is against r/learnprogramming's Posting Guidelines (section Formatting Code): please edit your post to use one of the approved ways of formatting code. (Do NOT repost your question! Just edit it.)
If your image is not actually a screenshot of code, feel free to ignore this message. Automoderator cannot distinguish between code screenshots and other images.
Please, do not contact the moderators about this message. Your post is still visible to everyone.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.