我每天收到太多YouTube视频API v3查询

时间:2019-03-22 20:34:08

标签: php youtube youtube-data-api

我使该api只是为了尝试某些操作,但我每天仅获得5个结果而获得过多查询 enter image description here

我是唯一使用它的人

我做错了吗?

<?php
header('Content-Type: application/json');
if(isset($_GET['search'])) {
$search = $_GET['search'];
$item = json_decode(file_get_contents("https://www.googleapis.com/youtube/v3/search?part=snippet&q=".urlencode($search)."&type=video&key=secret&maxResults=5"))->items;
$title = [];
$videoId = [];
for ($i=0; $i < count($item); $i++) { 
$title[$i] = $item[$i]->snippet->title;
$videoId[$i] = $item[$i]->id->videoId;

}
$echo["title"] = $title;
$echo["videoId"] = $videoId;
echo json_encode($echo);
}
?>

0 个答案:

没有答案
相关问题