Prakash
Prakash

Reputation: 21

Youtube V3 API playlistitems itesm are not sorted by publishedAt

Youtube V3 Api playlistitems method suppose to return the playlist items (video) ordered by publishedAt.(latest first), but the items returned are not ordered.

https://www.googleapis.com/youtube/v3/playlistItems?part=id,snippet&playlistId=PLAYLIST_ID&key=YOUR_API_KEY&maxResults=50

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

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

It was working before, but i noticed this issue few days back so am writing here. is anyone else facing the same.

Did youtube changed the return order to some other metrics? What is going wrong?

Upvotes: 1

Views: 102

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 116868

Did the YouTube API changed the return order to some other metrics?

No there never was a return order.

If you check the documentation for Playlist.items there is nothing there stating a guarantee of the order items will be returned in. Why the items may have appear to be in one order one day there is no guarantee they will be in the same order the next day.

Nor is there a parameter for you to specificity order. Most of the google apis assume that the developer is able to order the returned items themselves.

Upvotes: 3

Related Questions