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