Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

null.jpg being returned for carousel posts via Instagram API

It looks like the Instagram API does not support the new Instagram carousel feature. The images results only contain https://instagramstatic-a.akamaihd.net/null.jpg and not the cover image.

Any ideas how to retrieve these via the API?

like image 292
2 revs Avatar asked Feb 23 '17 13:02

2 revs


People also ask

Why won't Instagram post my carousel?

If those things are right, it probably comes down to the accounts you are tagging. While you can normally tag 20 accounts in your posts, you can only tag 15 accounts in an Instagram carousel. If you tag more than 15 accounts, your carousel will not post.

Did Instagram take away carousel posts?

Since 2017 , Instagram has allowed users to combine up to 10 photos and videos in a single post, but only now, some four years later, is the company adding a way to delete a single image or clip from a carousel. Instagram head Adam Mosseri detailed how the new feature works in one of his recent weekly video updates.

Can you post a carousel on Instagram?

An Instagram carousel is a post with up to 10 photos or videos. Mobile Instagram users can view carousel posts by swiping left, while desktop users can click through using the arrow button on the right-hand side of a post.


2 Answers

UPDATE: Since last Monday (April 24) we are receiving posts of type "carousel" containing the property "carousel_media" with all the carousel images.

Response example: https://jsonformatter.org/89e2fd

We have the same problem from yesterday.

We have added a workaround to the code to avoid problems, we will discard this posts until Instagram fixes the problem. If the value of the property 'type' is 'video' we check that the property 'videos' exists, in PHP:

if ($item->type === 'video' && !isset($item->videos)) { your code }

I think that the only way to get the right content now (until the problem is solved) is to scrap the page (with curl, for example) and get the image from the html.

like image 132
Jordi Avatar answered Nov 16 '22 23:11

Jordi


As a workaround use the iframe embed code to show carousel image, thats what I did in picodash, you can click and slide all the images.

if(data[i].type == "video" && !data[i].videos){
    html = "<iframe src='"+data[i].link+"embed' width='640' height='680' scrolling='no' frameBorder='0' style='margin-top:-40px'></iframe>";
}

(I'm pretty sure instagram knows about the issue and a real fix will be out)

like image 22
krisrak Avatar answered Nov 16 '22 23:11

krisrak