سؤال

We've noticed the search results returned from the v3 search api are different depending on the location of the server. I've confirmed the code is exactly the same and when I run a test using the try-it section of the api documentary website on the different server the results are different as well. Does anyone know why?

https://developers.google.com/youtube/v3/docs/search/list#try-it

هل كانت مفيدة؟

المحلول

That's normal, just as you'd expect from YouTube's web search, depending on your login and location, it will find most relevant videos.

نصائح أخرى

I was having the same problem. In my own computer (I'm in Brazil) the call would return 10 videos. When executed on Azure server (East-US) it would return no videos at all.

So I added the param regionCode=BR and it worked properly.

Though its very old thread, let me share my learning for others who face this.

So to keep api request generic within all servers you need to set few request parameters of youtubeapi.

RegionCode -- region to filter videos for that channel/user.

And sort result if desired.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top