Vinicius Spagnol
Vinicius Spagnol

Reputation: 41

How to differentiate a carousel media from an image or video media in Instagram-API?

I was scraping all carousel medias using cheerio and regex to find all urls inside the page body.

To know if a media was a carousel, I checked if the request response was type 'video' and didn't have a 'videos' property. Like in this thread null.jpg being returned for carousel posts via Instagram API.

But now, Instagram changed the way carousels come in the requests, now, the Json response comes identical an image response if the first slide of the carousel is an image, and identical a video response if the firt slide is a video.

I want to know if anyone can differentiate carousels from other types of media in requests from the Instagram API.

Upvotes: 2

Views: 1312

Answers (1)

Jordi
Jordi

Reputation: 1148

Since last April 24th we are receiving posts of type "carousel" from the API. This posts contain the property "carousel_media" with all the carousel images/videos.

Upvotes: 3

Related Questions