YouTube PHP API - How to retrieve a user videos ?


Hi guys,

Has anybody used the YouTube API ? Is it easy to get all the videos of a user id ? Or all the videos from a playlist id ?



According to my rather broken memory it is possible to get the latest 25 user videos from the RSS feed. I’m sure more is possible via the API.


You can get a user’s videos with this URL for ex (in this case it’s the whitehouse videos):

The max results are 25, but you can get the rest by specifying the startIndex… You will notice this in the feed returned:


The full documentation is here.

You can get an XML as well, but with the json result you can use the json_decode() function and have the feed returned converted to an array (easier to manipulate) :wink:


Wow, thanks guys, just what I needed


Ok, the playlist id thing was not answered and I found it by mistake -

Just in case someone else searches for this