vimeovimeo-apipyvimeo

How to use the 'query_fields' and 'query' options with Vimeo API?


I'm trying to get my head around Vimeo API with Python. I'm successful in the sense that I can use basic API requests e.g. to list all my videos or similar.

Mostly, I use the /me/videos/ API endpoint. The API reference states, that there can be two options 'query_fields' and 'query'. If I just use 'query', I can filter the results e.g. by a string in the title. I'm assuming this works, because the default value for 'query_fields' is title,description,chapters,tags' according to the API reference.

But what i'd like to do is to use the 'query_fields' for something like: 'query_fields': 'privacy.view' 'query': 'unlisted'

But if I try that, a generic error message is returned

{
    "error": "Searching for a page that does not exist or is too far back in our catalog to present.",
    "link": null,
    "developer_message": "The user's from + size exceeded 10,000, they requested a page of results that does not exist, or they issued an invalid query as defined in the QueryPreprocessorPlugin.",
    "error_code": 2969
}

Has anyone been able to use the 'query_fields' option on any way other than the defautl fields?


Solution

  • You can't query any fields with query_fields, the only valid fields are the ones listed in the docs ('title', 'description', 'chapters', 'tags').

    You'd need to manually filter on privacy.view, so i.e.

    GET /me/videos?fields=uri,privacy.view

    And loop through this filtering for the values you want.