2
我試圖在搜索特定關鍵字時獲取YouTube視頻列表。
我試過以下教程:Search by keyword
不幸的是它不起作用。
Youtube API v3獲取視頻 - PHP
A service error occurred: Error calling GET https://www.googleapis.com/youtube/v3/search?part=id%2Csnippet&q=amsterdam&maxResults=20&key=PRIVATEKEY: (403) Access Not Configured. Please use Google Developers Console to activate the API for your project.
我已經激活了以下API在我的控制檯
以下錯誤
我是否缺少一些A PI的?
我也啓用了結算功能,但仍然無法使用。
我的代碼一小部分:
$client = new Google_Client();
$client->setDeveloperKey($DEVELOPER_KEY);
$youtube = new Google_YouTubeService($client);
$searchResponse = $youtube->search->listSearch('id,snippet', array(
'q' => $_GET['q'],
'maxResults' => $_GET['maxResults'],
));
我已經解決了這個問題,我的引薦URI的地方可能是無效的。在我的谷歌控制檯中刪除了uri,現在允許所有的URI和它的工作。 – Robert