使用YouTube API检索并显示YouTube视频描述、标题及其id


Retrieve and display YouTube video description, title by its id using YouTube API

我想在一个页面上显示视频youtube的标题和描述,我知道如何使用这个php代码进行计数

<?php
$JSON = file_get_contents("https://www.googleapis.com/youtube/v3/videos?
part=statistics&id=videoID&key=APIKey");
$json_data = json_decode($JSON, true);
echo $json_data['items'][0]['statistics']['viewCount'];
?>

但我不知道这是如何显示视频标题和描述的。

<?php
$JSON = file_get_contents("https://www.googleapis.com/youtube/v3/videos?
part=snippet&id=videoID&key=APIKey");
$json_data = json_decode($JSON, true);
echo $json_data['items'][0]['snippet']['title'];
echo $json_data['items'][0]['snippet']['description'];
?>