I use the url to search channels in a specific country like this https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=8&order=viewCount&q=news&type=channel®ionCode=US&key=API-Key.
But when i changed the regionCode parameter to IT(italy) or any other one,the search result is always identical.So the search result is not changed with the regionCode.
How can I search the channel by country using the YouTube API 3.0,thanks.
I also try to search channel with the optional parameter regionCode
, and it seems that this parameter is not to filter the results base on the country code of a Country. I found in this related SO question that the region parameter only applies to movie charts, and is not something that works as a parameter for general searches.
So the only possible parameter that I think you can use to filter the results of YouTube API in a specific country or place is by using the parameter location
.
The location
parameter, in conjunction with the locationRadius
parameter, defines a circular geographic area and also restricts a search to videos that specify, in their metadata, a geographic location that falls within that area. The parameter value is a string that specifies latitude/longitude coordinates e.g. (37.42307,-122.08427).
Hope it helps you.
There is no way to solve this problem. I tried location with locationRadius, but second parameter is limited to 1000km, so, I cant find all videos from Russian Federation or USA using that option and 1 api request. Also, that api request performs slow for understandable reason.
来源:https://stackoverflow.com/questions/40629438/how-can-i-search-the-channel-in-a-specific-country-using-the-youtube-api-3-0