How can I search the channel in a specific country

2019-05-10 07:51发布

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&regionCode=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.

2条回答
三岁会撩人
2楼-- · 2019-05-10 08:42

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.

查看更多
神经病院院长
3楼-- · 2019-05-10 08:53

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.

查看更多
登录 后发表回答