Search code examples
vimeovimeo-api

How can I get video details for multiple videos in a single Vimeo API call?


YouTube has an option to retrieve video details (title, description, thumbnails...) using comma separated list of video IDs in a single call:

https://developers.google.com/youtube/v3/docs/videos/list

Is there such feature for Vimeo available? I don't see this option here: https://developer.vimeo.com/api/reference/videos#_essentials

Creating album, channel etc is not an option if videos come from different sources..


Solution

  • It's buried a bit, but the ability to make a batch request to get the metadata for multiple videos is documented here: https://developer.vimeo.com/api/reference/videos#search_videos

    In short, make a request to /videos with a query parameter ?uris= and a comma-separated list of URI values.

    For example, let's say you want to get metadata for videos at /videos/111, /videos/222, and /videos/333. The request would be formatted like this:

    GET https://api.vimeo.com/videos?uris=/videos/111,/videos/222,/videos/333
    

    Since this response can return a lot of metadata, I would consider using the fields parameter so that only the metadata you need is returned. For the example above, that request would look like this if you wanted to get only the name, link, and video description back:

    GET https://api.vimeo.com/videos?uris=/videos/111,/videos/222,/videos/333&fields=uri,link,name,description