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 ?
- Grew a moustache for the Envato Movember competition
- Community Moderator
- Contributed a Blog Post
- Author was Featured
- Item was Featured
- Won a Competition
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Has been a member for 4-5 years
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): http://gdata.youtube.com/feeds/api/users/whitehouse/uploads?v=2&alt=jsonc
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)
Wow, thanks guys, just what I needed
Ok, the playlist id thing was not answered and I found it by mistake -http://gdata.youtube.com/feeds/api/playlists/08BACDB761A0C52A?alt=json&start-index=1&max-results=40
Just in case someone else searches for this