Closed benrolfe closed 2 years ago
@benrolfe This is not supported on this method. It would be great if you can it to this package with a PR to provide this feature following the Youtube Data API: https://developers.google.com/youtube/v3/docs/search/list
Let me know if you need help or have question
It looks like the endpoint in question (https://www.googleapis.com/youtube/v3/playlistItems) doesn't allow you to order.
https://developers.google.com/youtube/v3/docs/playlistItems/list
@benrolfe So the only solution is that you load all the items and order them in memory.
Does anyone know how I can fetch the latest 5 videos from a YT playlist?
This is the PHP code I have so far:
$results = Youtube::getPlaylistItemsByPlaylistId('PLo00OmIdkKM1Frqs8ZExOWpDtXOPwG6Ng', '', 5)
But I don't know how to order by date.