Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get XML with id's of all uploaded videos on youtube channel

I have more than 100 videos uploaded in a youtube channel. I get the xml of channel as: https://gdata.youtube.com/feeds/api/users/UserId/uploads , it only returns xml with id's for only 25 videos. How can i get xml of all uploaded videos on particular channel

like image 990
Najeebullah Shah Avatar asked Nov 07 '12 21:11

Najeebullah Shah


1 Answers

By default the APi only returns 25, you have to add on a max results parameter to get more, but then sadly this only allows you up to 50.

https://gdata.youtube.com/feeds/api/users/UserId/uploads?&max-results=50

What you have to do is the keep requesting for more using an offset to say you want to start from a certain value, in this case you would do something like:

https://gdata.youtube.com/feeds/api/users/UserId/uploads?&max-results=50&start-index=51

have a look at https://developers.google.com/youtube/2.0/developers_guide_protocol_video_feeds for more information.

like image 157
Paul Harris Avatar answered Oct 06 '22 00:10

Paul Harris