【问题标题】:YouTube API search by keywords and category idYouTube API 按关键字和类别 ID 搜索
【发布时间】:2013-09-03 01:55:03
【问题描述】:

我正在尝试按类别 ID 和关键字搜索视频。

这是我的链接:

https://www.googleapis.com/youtube/v3/search?part=snippet&key=API_KEYs&videoCategoryId=10&q=bieber

我明白了:

{
 "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."
 }
}

我应该在我的 api 请求中更改什么?

【问题讨论】:

    标签: api request youtube-api


    【解决方案1】:

    Data API 有统一的搜索、含义,搜索返回视频、播放列表和频道。要按视频特定参数(如 videoCategoryId)过滤,您必须定义 "type=video"

    https://www.googleapis.com/youtube/v3/search?part=snippet&q=bieber&type=video&videoCategoryId=10&key={YOUR_API_KEY}
    

    【讨论】:

      猜你喜欢
      • 2015-01-14
      • 1970-01-01
      • 2014-12-19
      • 1970-01-01
      • 1970-01-01
      • 2016-07-13
      • 2018-03-26
      • 1970-01-01
      • 2016-10-15
      相关资源
      最近更新 更多