按关键字和类别ID搜索YouTube API

Yoz*_*zer 2 api request youtube-api

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

这是我的链接:

https://www.googleapis.com/youtube/v3/search?part=snippet&key=API_KEYs&videoCategoryId=10&q=bieber
Run Code Online (Sandbox Code Playgroud)

我越来越:

{
 "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."
 }
}
Run Code Online (Sandbox Code Playgroud)

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

Ibr*_*aya 6

Data API具有统一搜索功能,即搜索返回视频,播放列表和频道.要按视频特定参数(如videoCategoryId)进行过滤,您必须定义"type = video"

https://www.googleapis.com/youtube/v3/search?part=snippet&q=bieber&type=video&videoCategoryId=10&key={YOUR_API_KEY}
Run Code Online (Sandbox Code Playgroud)