YouTube V3搜索API PHP

问题描述 投票:0回答:1

我正在询问我无法解决的问题。

我们的功能是搜索YouTube视频。但是,从api获取10-20个链接后,该函数将起作用(Youtube链接)Google控制台api上的配额达到10,000,并且我们将无法再使用该api。我们可以在Google控制台的api图上看到该api达到10'000,它仅限于我们的域并且有效(带有绿色V)

有人知道如何解决吗?

这是我们的PHP函数:

$searchUrl = $api_googlesearch_2_Ary['googleApiUrl'].'?part=snippet&q='.$artistName.'-'.$trackName.'&key='.$api_googlesearch_2_Ary['googleApiKey'];
    $response = file_get_contents(str_replace(" ","%20",$searchUrl), false, stream_context_create(array('ssl' => array('verify_peer' => false, 'verify_peer_name' => false))));
    $data = json_decode($response,true);
    return $data;
php youtube youtube-api youtube-data-api file-get-contents
1个回答
0
投票

quota calculator表示Search.list端点的配额成本为100个单位(因此,该端点的doc页面)。没什么可做的。除了(也许)要求Google延长配额。您还可以考虑减少API调用次数:通过缓存获得的结果集并仅在严格必要时才查询端点。

© www.soinside.com 2019 - 2024. All rights reserved.