Youtube Data API v3: Sort by date not working

zkcudpgs picture zkcudpgs · Mar 16, 2019 · Viewed 7.6k times · Source

The sorting is not working as expected since a few hours.

https://www.googleapis.com/youtube/v3/search?order=date&part=snippet&channelId=UC_x5XG1OV2P6uZZ5FSM9Ttw&key=YOUR_API_KEY

Can be tried in the API explorer (Execute without OAuth) as well.

https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?part=snippet&channelId=UC_x5XG1OV2P6uZZ5FSM9Ttw&order=date

date: Resources are sorted in reverse chronological order based on the date they were created.

https://developers.google.com/youtube/v3/docs/search/list

What is going wrong?

Answer

Gu35st4r picture Gu35st4r · Mar 17, 2019

In case you are looking to get the latest videos of a channel:

  • Get the channels upload playlist from Channels
  • Get the latest videos in the channels upload playlist from PlaylistItems

Alternatively, you can use the channels RSS feed:

  • https://www.youtube.com/feeds/videos.xml?channel_id={ChannelId}
  • https://www.youtube.com/feeds/videos.xml?user={User}

This does not replace the full search sorted by date function however.

Thanks YouTube for making me work on a Sunday, all I wanted was to watch the latest videos from my favorite channels. At least I don't have to wait for a fix anymore, good luck to those less lucky!