YouTube's API is busted if you're trying to fetch latest videos

YouTube’s gone and broke their API. The order function for latest videos is being ignored.

You’re trying to grab the latest videos for a YouTube channel but it’s just returning what looks like a random sorting of videos right? It’s actually doing the sort by relevance as if you’d not provided an order parameter.

publishedAfter is also affected by this and being ignored.

YouTube have said this is temporary and in relation to their efforts to remove graphic or violative content from YouTube. Feck knows how it does that, but there ya go..

Lots more folk annoyed on Google’s issue tracker - looks like it’s also affecting their frontend filters too. Nice one YouTube..

Workaround

The workaround for now is to either grab the channel’s “Play All” playlist or grab videos via the channel’s RSS feed, which only show a handful of videos.

https://www.youtube.com/feeds/videos.xml?channel_id=$CHANNEL_ID
or
https://www.youtube.com/feeds/videos.xml?user=$USER



Sign up for emails about the things

Sign up to my (at most) weekly mail list. I'll send general updates to the list, new projects and whatnot. Not every single post as it comes out, but a summary mixed in with random cool tech I find around the net. For more info checkout the subscribe page

I'll never sell, give, transfer, trade your contact details with any other person, company, or other entity and you're free to click that big unsubscribe link at the bottom of each message whenever!