Search code examples
react-nativevimeovimeo-api

Vimeo API get multiple videos in one GET request


I'm in a situation where I need to make one GET request to Vimeo and get back info for multiple specific videos. Here is what I have for the query string currently:

https://api.vimeo.com/users/XXXXXXXX/videos?fields=uri,duration,pictures.sizes.link,download&containing_uri=/videos/ID1,/videos/ID2&per_page=2

Unfortunately, this only returns the information for ID2 and the video ID before it in its channel, instead of for both IDs specified. I've also tried appending multiple containing_url fields to no avail. Is there any way to make this happen? I'm using axios in react native if that helps.


Solution

  • Instead of "containing_uri", use "uris" as documented here:

    https://developer.vimeo.com/api/common-formats#batch-requests https://developer.vimeo.com/api/reference/videos#GET/videos

    The "containing_uri" parameter will only return the page of the specified uri. The "uris" parameter will return the specified videos/objects. Your request should look like this:

    https://api.vimeo.com/users/XXXXXXXX/videos?fields=uri,duration,pictures.sizes.link,download&uris=/videos/ID1,/videos/ID2&per_page=2
    

    I hope this information helps!