I am trying to get a list of a user's latest videos/uploads. I am trying to get my head around this new v3 API, but I cannot find any properly working PHP code examples, not even on the dedicated YouTube API website.
I have a list of YouTube usernames, and I just want to simply get a list of their latest videos with video ID, title, thumbnail URL, etc. Basically in a foreach loop.
Any advice?
I have the following code, I need to make it work by 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'];
}
forUsernameattribute, it will give you the channel identifiers back. - naththedeveloper