当我使用 Youtube API 3.0 通过位置参数搜索视频时。它返回错误代码 400。
我的请求有问题吗?请帮帮我?
我的请求是
https://www.googleapis.com/youtube/v3/search?part=snippet&location=37.42307,-122.08427&locationRadius=10km&key=AIzaSyC_yvsd3RYZsez_RcjBSgVY1VT8SIK_zr0
以上请求的输出:
{
"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."
}
}
文档中不清楚,但在这种情况下,您必须将类型设置为"视频"
https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&location=37.42307,-122.08427&locationRadius=10km&key=AIzaSyC_yvsd3RYZsez_RcjBSgVY1VT8SIK_zr0