views:

318

answers:

1

I've got a couple of playlists I'd like to embed in a website. Rather than hard-coding them, I'm trying to use Youtube's Data API.

This basically amounts to parsing some XML from a URL in the form:

http://gdata.youtube.com/feeds/api/playlists/[feed-id]

This works great right up until the playlist is 26 videos long, at which point the results are truncated at the first 25.

I've tried appending a max_results parameter as you would when searching, but to no avail.

As an aside, an acceptable stop gap measure would be randomly returning 25 of the videos in the playlist. Right now, they're always in the same order.

So, anyone know how to grab whole playlists? Or am I stuck hard-coding these videos?

+3  A: 

The YouTube GData API includes in the XML feeds "prev" and "next" feed urls, as well as "related", etc. The results in all video feeds are max'd at 25, and you would need to use the links to grab the rest of the videos.

In your case, though it's as simle as adding the start-index:

start-index=26&max-results=25
FilmJ