How to fix YouTube API Error: (400) 'Invalid combination of search filters and/or restrictions.'

Yesterday I was playing with the YouTube API and this NodeJS client.

Very nice until I got the next error when I added the videoDuration parameter to the search query. In the API doc, I didn’t find about required fields when using this parameter.

Obviously, I started to search on Google about it, I found some posts but about others parameters or problems. Finally, I found this issue and someone pointed to add the type parameter. And it works.

Solution

In this case, just add the parameter type with the value video. In the NodeJS client that I used I added:

youTube.addParam('type', 'video');

Read more on YouTube API Doc

David Burgos

Read more posts by this author.