Search code examples
javascriptapivimeo

Limit returned data with Vimeo API 3


I am using the Vimeo (V3) API to search for public videos from a client side app. All I need to be returned is the title and url of videos matching my query, but instead I am receiving reams of superfluous data (to my app) amounting to 300K + responses.

I noticed previous (deprecated) APIs have params such as summary_response for the search videos end point. Is there anything like that for V3? Nothing appears to be available according to the V3 end point docs. Is there any other way of limiting the response data if there are no params?


Solution

  • The developer site documentation is a little behind, but Vimeo does support limiting your response contents. Currently it's only detailed in the google group but I'll re-explain here.

    The less fields you request, the faster your API request should return.

    "fields" is a querystring parameter that allows you to define a whitelist of fields. Only the fields you request will show up in the response body.

    Multiple fields should be comma delimited and nested fields should be split by periods.

    /me/users?fields=uri
    {
        "uri" : "..."
    }
    
    
    /me/users?fields=uri,websites.link
    {
        "uri" : "...",
        "websites" : [{
            "link" : "..."
        }, {
            "link" : "..."
        }]
    }