Youtube api v3 Get list of user's videos

vietstone picture vietstone · Mar 24, 2014 · Viewed 97.8k times · Source

With Youtube api v2, there's easy way to get videos. Just send a query like this:

http://gdata.youtube.com/feeds/mobile/videos?max-results=5&alt=rss&orderby=published&author=OneDirectionVEVO

The Youtube api v2 also has an interactive demo page for building query: http://gdata.youtube.com/demo/index.html

With Youtube api v3, I don't know the corresponding way. Please point me the way with api v3.

Thank you!

Answer

Vinicius Pinto picture Vinicius Pinto · Mar 24, 2014

The channels#list method will return a JSON with some information about the channel, including the playlist ID for the "uploads" playlist:

https://www.googleapis.com/youtube/v3/channels?part=contentDetails&forUsername=OneDirectionVEVO&key={YOUR_API_KEY}

With the playlist ID you can get the videos with the playlistItems#list method:

https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=UUbW18JZRgko_mOGm5er8Yzg&key={YOUR_API_KEY}

You can test those at the end of the documentation pages.