Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thumnails for images in Instagram Graph API

I'd like to ask if there is any way to get thumbnail image for media returned from Instagram Graph API? I can get an image URL by using following endpoint: /{InstagramUserId}/media?fields=media_url

However it only returns one size. Old Instagram API returned various sizes like low_resolution, thumbnail, standard_size. Is it possible to get similar result by using Instagram Grahp API?

like image 439
Astaz3l Avatar asked Aug 13 '18 12:08

Astaz3l


People also ask

What is the best size for Instagram thumbnails?

Those familiar with the API would know that Instagram’s thumbnails are served at a rather small size of 150×150 which is alright in some cases, but if you need a larger thumbnail size a 150×150 image scales up very poorly. Here’s the images attribute in the API response for a recent Instagram post we did:

What is the Instagram graph API?

The Instagram Graph API allows Instagram Professionals — Businesses and Creators — to use your app to manage their presence on Instagram.

How to find the content of a thumbnail?

The index of the thumbnail, usually 0-4. If there is a custom thumbnail, its index is 0. The size of the thumbnail requested. This can be one of the standard sizes listed below or a custom size. You can directly retrieve the content of the thumbnail by requesting the content property of the thumbnail.

What is the best API for building an Instagram app?

If you are building an app for consumers or you only need to get an app user's basic profile information, photos, and videos, consider the Instagram Basic Display API instead. The API is built on the Facebook Graph API.


1 Answers

After searching for some time to a solution i finally found one.

So, include in the fields query string the permalink field and it should give as following (Sorry, for using Kim Kardashian as an example):

https://www.instagram.com/p/CAYDz52gSLh

then append this at the end media?size=t or simply media like this:

https://www.instagram.com/p/CAYDz52gSLh/media?size=t

  • media?size=t will give a 150x150 px image
  • media?size=m will give a 320x320 px image
  • media?size=l will give a 1080x1080 px image
like image 57
Alvin Konda Avatar answered Sep 24 '22 17:09

Alvin Konda