2013-08-30 38 views
1

我在尝试按类别ID和关键字搜索视频。YouTube API根据关键字和类别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请求改变?

回答

5

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

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