Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Youtube Data API v3: Sort by date not working

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?

like image 710
zkcudpgs Avatar asked Mar 16 '19 08:03

zkcudpgs


People also ask

Why is YouTube API not working?

Your API key may not be working because you're using it for the wrong project. Be sure you're using the key for the project that you created it for, especially if you created multiple projects at the same time. If it's still not working, consider creating a new API key entirely.

Is YouTube data API v3 free?

Yes, using the YouTube API does not incur any monetary cost for the entity calling the API. If you go over your quota an 403 Error will be returned by the API.

How do I enable YouTube API v3?

In Google API dashboard, click Library on the left menu. Click YouTube Data API v3, then click the Enable button to enable the API service.


3 Answers

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!

like image 54
Gu35st4r Avatar answered Oct 12 '22 00:10

Gu35st4r


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.

like image 2
Nico Kanitz Avatar answered Oct 12 '22 00:10

Nico Kanitz


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.

like image 1
Sembiance Avatar answered Oct 12 '22 01:10

Sembiance