Reputation: 1745
1 year ago Instagram migrated the API to support landscape and portrait formats.
Looks like last week the api is returning a cropped square image.
Example: https://www.instagram.com/p/BHLY4N0jMfA/ (the image is not square)
Api endpoint (https://api.instagram.com/v1/tags/igapitest/media/recent) returns cropped square image:
...
images: {
low_resolution: {
url: "https://scontent.cdninstagram.com/t51.2885-15/s320x320/e35/c224.0.631.631/13556933_1110271362362401_1093314529_n.jpg?ig_cache_key=MTI4MjIyNzkzNTE2NDI4NjkxMg%3D%3D.2.c",
width: 320,
height: 320
},
thumbnail: {
url: "https://scontent.cdninstagram.com/t51.2885-15/s150x150/e35/c224.0.631.631/13556933_1110271362362401_1093314529_n.jpg?ig_cache_key=MTI4MjIyNzkzNTE2NDI4NjkxMg%3D%3D.2.c",
width: 150,
height: 150
},
standard_resolution: {
url: "https://scontent.cdninstagram.com/t51.2885-15/s480x480/e35/c224.0.631.631/13556933_1110271362362401_1093314529_n.jpg?ig_cache_key=MTI4MjIyNzkzNTE2NDI4NjkxMg%3D%3D.2.c",
width: 480,
height: 480
}
},
...
Even if you try the media endpoint (https://api.instagram.com/v1/media/1282227935164286912_189136266) it returns cropped square images again.
Noticed that images used by the web Instagram comes from another cdn than the api returns.
Looks a bug in Instagram API? Any Suggestions?
Upvotes: 1
Views: 1533
Reputation: 12952
Have you checked the option for "Non-square images" in your API settings.
I checked the same media using my API, I get landscape images.
The image URL is same except I dont have c224.0.631.631/
in my API response's URLs, you can remove that from your URLs and you will get non-cropped images. But check your API settings.
Upvotes: 1