najib
najib

Reputation: 13

Is the YouTube API v3 Activity.List() sorted by PublishedAt date?

I was wondering whether the Activity.list() YouTube API v3 function is sorted by publishedAt date.

That is: if I get the top element of the returned list whether I would get the last activity by the channel. I want ultimately to get the last activity performed by the channel (the aim is to find whether a channel is active or not), without the need to load the whole collection of activities and sort it manually.

The YouTube API documentation is not explicit about it and I was wondering whether someone has experience with this.

Thanks a million!

Upvotes: 1

Views: 381

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 116968

Activity.list() returns in what ever order google sees fit I don't think there is going to be any way to guarantee that it will remain that way either as its not documented.

There is also no way to sort the list before it is returned. Your best bet is going to be to retrieve the whole list and sort it locally.

Upvotes: 1

Related Questions