2014-11-22 16 views
0

當我使用Youtube API 3.0通過使用位置參數搜索視頻時。它返回錯誤代碼400.Youtube API 3.0帶位置參數的搜索列表不起作用

想要我的請求錯?請幫幫我?

我的要求是

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

回答

1

這不是在文檔清晰,但在這種情況下,你必須類型設置爲「視頻」

https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&location=37.42307,-122.08427&locationRadius=10km&key=AIzaSyC_yvsd3RYZsez_RcjBSgVY1VT8SIK_zr0