14

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?

zkcudpgs
  • 151
  • 1
  • 1
  • 8
  • 2
    I can confirm I am also seeing an issue with the YouTube API, so it's not specific to your API key. For me I'm seeing videos in pretty much random order, showing videos from 5 years ago next to videos from a month ago. – bLight Mar 16 '19 at 10:52
  • Exactly, this is currently a blocker for my requirements. There must be an issue with the API. – zkcudpgs Mar 16 '19 at 11:03
  • Hopefully it will resolve itself shortly, I believe it impacts every app that uses the YouTube API which should help get YouTube's attention. – bLight Mar 16 '19 at 11:06
  • I hope so too. I can reproduce it without any changes since several hours. – zkcudpgs Mar 16 '19 at 11:10
  • 1
    I no longer think they are in random order, I believe the result is sorted by rating instead of date. Maybe YouTube is experimenting with a new sorting method and it messed up the API. – bLight Mar 16 '19 at 13:16
  • It looks like there are multiple posts on twitter trying to alert YouTube. – bLight Mar 16 '19 at 13:22
  • The default value is **relevance** according to the documentation. In my request I have explicitly specified the parameter value "date". However, it seems that none of the accepted values are recognized. I've tested all of them with equal results. I hardly think that anything is happen on there before Monday. – zkcudpgs Mar 16 '19 at 13:30
  • I can also confirm that it gives wrong results for a specific date. – rihekopo Mar 16 '19 at 13:40
  • This affects billions of apps & devices, hopefully they can get to it sooner than Monday. – bLight Mar 16 '19 at 15:45
  • I have the same issue when searching for video's for a channelId. **order=date** is not reliable. One second new video's are there, moments later they're not, few seconds later they are there again. And then they're gone again and so forth. – A.W. Sep 11 '19 at 09:00
  • I tried it on [https://developers.google.com/youtube/v3/docs/search/list](https://developers.google.com/youtube/v3/docs/search/list) and **order=date** sometimes leaves out items which should be there. The results are not consistent. – A.W. Sep 11 '19 at 09:24

4 Answers4

12

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!

Gu35st4r
  • 136
  • 3
  • PlaylistItems works if search terms and sort by rating, relevance, title, videoCount or viewCount are not required. In my case, the descending sorting is fortunately enough. I've already changed my app. Thanks. – zkcudpgs Mar 17 '19 at 18:40
  • Thanks so much for this comment. This method works perfectly as the playlistItems.list() method happens to return videos in date descending order, which is exactly what I needed. I then just request more pages with nextPageToken. Thanks again! – Sembiance Mar 19 '19 at 12:52
2

Reports in Google's forum were commented by a Google employee: https://support.google.com/youtube/thread/2494861?msgid=2520468

YouTube is aware the search/sorting functions aren't working as expected – this is temporary and part of our efforts to better respond, review and remove graphic, violative content from YouTube. Thanks for your patience while we work through this. Will update this thread when these features are working normally again, feel free to subscribe for updates.

1

Bug reports for this include:

https://issuetracker.google.com/issues/128673031

https://issuetracker.google.com/issues/128673552

Both have an official comment from Google:

Thank you all for bringing this up here. These specific filters have been currently disabled on both YouTube.com and through the APIs. We should have updates on this soon. Thanks again.

Sembiance
  • 833
  • 3
  • 11
  • 14
0

Not sure how credible that is:

Just confirming that this is only temporary, and related to YouTube's efforts to better respond, review and remove graphic, violative content from YouTube. Thanks for your patience while we work through this.

https://www.reddit.com/r/youtube/comments/b1plj5/sort_by_upload_date_not_working/eiojtjh/

  • Simply changing the API with countless applications is, of course, the only solution. As if it were not the case that all developers have stored an e-mail address for their API key that could have been used to inform them. For me it's a bug. And so far no comments from the development team. Of course, this "temporary" change had to happen for the weekend. Thank you Youtube, that my app has not been fully functional for more than 24 hours. Should I now load all data into the cache to sort them? No. – zkcudpgs Mar 17 '19 at 08:16
  • True. You could – for the time being – use a service like RSS bridge (https://bridge.suumitsu.eu) if your app does not rely on additional data like view count or duration etc.. – Marcus Scheller Mar 17 '19 at 08:18