'Javascript Youtube search API not finding video

If I search for "ten thousand islands mofro" on youtube, the desired video is the first result. However, I that video simply does not show up using Google's Youtube search API. Even when I search very specifically, it simply returns zero results. Here is my code:

var request = gapi.client.youtube.search.list({
    q: "ten thousand islands mofro",
    part: 'id, snippet',
    type: 'video'
});

Does this have something to do with copyright issues? But, if so, why would I be able to find it effortlessly on Youtube, yet not by using its API?

EDIT: It's definitely something to do with searching for music. Searching "harmonious funk blake aaron" also does not return the correct video, though it does when searching via the Youtube website. It looks like, for some reason, youtube channels with "- Topic" are not returned from the API. Still looking for workarounds or reasons as to why.



Solution 1:[1]

The answer ended up being that those videos were auto-generated by youtube, and the API does not find auto-generated videos (those videos will have "- Topic" appended to it). My workaround was to call an HTTP request from my server in order to find the video.

Solution 2:[2]

Whenever you don't get expected results, always try a direct URL request first.

https://www.googleapis.com/youtube/v3/search?part=id,snippet&type=video&key=API_KEY&q=ten+thousand+islands+mofro

gives plenty of results. Double check your code.

After OP comment: answer seems to be: 'region restrictions'.

Solution 3:[3]

I solved it by adding "regionCode" parameter to my requset.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 nikojpapa
Solution 2
Solution 3 Shimi Ben ezra