Home Ask Login Register

Developers Planet

Your answer is one click away!

WinterDev February 2016

Youtube api v3, playlist.list isn't up to date or in order of published date.

I'm trying to get the most recent uploaded videos but for some channels, the latest video is missing and the other videos aren't in the same order as when you go on the actual channel uploads section on the website... Using search as opposed to playlist seems to work (has the most recent videos in order) but has an insane quota impact compared to playlists.

Is using the search query my only option or am I doing something wrong with playlists?

I'm using part=snippet, maxresults=3 and providing the upload playlist id.


Brainstorm March 2016

I've had similar problems. It appears to me that uploaded videos in the uploads playlist are sorted by when they were uploaded. Some Youtube creators make and upload many videos at the same time but publish them one by one. But their order is not changed as they are published. More videos can be uploaded and published before an older already uploaded video is published.

There is as far as I can tell there is no additional cost to increasing maxResults when fetching the playlist items. I think the cost is per call not per item. At least that is how I interpret this note from the Quota Calculator:

Note: If your application calls a method, such as search.list, that returns multiple pages of results, each request to retrieve an additional page of results will incur the estimated quota cost.

Each page can be a maximum of 50 videos long so you can fetch 50 videos in a single call for the same price as fetching 3. I don't know if the call takes longer time, but I don't think it will change significantly. So try using maxResults=20 or maxResults=50 and see if that works. Then sort the results afterwards.

I'd imagine that it's rare that someone uploads a video then uploads and publishes more than 50 other videos before publishing the first one. So using maxResults=50 should work ok.

Post Status

Asked in February 2016
Viewed 2,961 times
Voted 10
Answered 1 times


Leave an answer

Quote of the day: live life