如何从 youtube google 的 Youtube api 访问横幅图像的 url、 channel 标题、订阅者数量和默认 Logo 图像 url?
一个 example of the JSON api can be found here .
如何使用 PHP 访问这些内容?
最佳答案
以这种方式进行:
$youtube = file_get_contents("https://www.googleapis.com/youtube/v3/channels?part=snippet,brandingSettings&id=UCyoUx3RguJRgbaMo07yc_KA&key=AIzaSyCZonTWlCv92Nd93j5CuFFcqGciLIe5rx4");
$data = json_decode($youtube,true);
echo "BANNER IMAGE URL: ".$data['items'][0]['brandingSettings']['image']['bannerImageUrl']."<br>";
echo "CHANNEL TITLE: ".$data['items'][0]['brandingSettings']['channel']['title']."<br>";
等等....
this tools查看json的结构并提取您需要的内容非常好
关于php - 如何从 youtube google api 访问 youtube json 日期?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33866489/