在探索YoutubeData API V3进行搜索时出现400错误。它接受如下参数:
part = snippet
location = 12.9667,77.5667
locationRadius = 50km
但是它给出了下面的响应:
400 Bad Request
{
"error": {
"errors": [
{
"domain": "youtube.search",
"reason": "invalidSearchFilter",
"message": "Invalid combination of search filters and/or restrictions.",
"locationType": "parameter",
"location": ""
}
],
"code": 400,
"message": "Invalid combination of search filters and/or restrictions."
}
}
我也遇到过同样的问题。文档说
注意,如果为eventType、videoCaption、videoCategoryId、videoDefinition、videoDimension、videoDuration、videoEmbeddable、videolense、videoSyndicated或videoType参数设置值,则类型参数必须设置为video。
虽然没有提到位置参数,但将type = "video"
添加到参数列表中已经解决了我的问题。