2013-08-30 37 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}