I am trying to get a list of users of the latest videos / downloads. I’m trying to figure out this new v3 API, but I can’t find suitable working examples of PHP code, even on the dedicated YouTube API website.
I have a list of YouTube usernames and I just want to just get a list of my latest videos with a video id, title, thumbnail, etc. Mostly in the foreach loop.
Any tips?
I have the following code, I need to get it to work with the actual YouTube usernames.
$url = 'https://www.googleapis.com/youtube/v3/channels?part=id&forUsername=ferrariworld&key=ZZZZZZZZ';
$json = json_decode(file_get_contents($url), true);
foreach ($json as $item){
echo $item[0]['id'];
echo $item[0]['title'];
}
source
share