UnionP
UnionP

Reputation: 1638

Querying only unwatched videos for a subscription using the Youtube API

(I asked this question a year and a half ago on the Google Groups forum, and back then Jeffrey Posnick said this wasn't possible, I'm trying again, hoping that with time and the v3 API, this is now possible)

I've just started tinkering with the API and am wondering if there's a way to query for only *unwatched *videos for a particular subscription. For example, if you go to http://www.youtube.com/my_subscriptions and look at New Videos it will limit the videos shown to only videos you haven't yet watched within your subscriptions. Is this possible with the API?

Clearly the watched/unwatched status relative to an account is stored on the Google servers, is this available through the API?

If not, is there any plans for that?

Thanks!

Upvotes: 15

Views: 10063

Answers (1)

Steven Grosmark
Steven Grosmark

Reputation: 1384

I Haven't tried this yet, but using the YouTube Analytics API instead of the YouTube Data API, you might be able to get what you want: request a report where metrics=views and dimension=video, and sort by views in ascending order.

For example:

https://www.googleapis.com/youtube/analytics/v1/reports
  ?metrics=views
  &dimensions=video
  &sort=views
  &ids={your channel id}

One thing that I would be concerned about with this approach is that if YOU watch a video yourself, as a part of the upload/sanity check process, the views count will be non-zero. Also note that there is a sizable delay between when a video is viewed, and when that view is reported via the analytics api - it could be anywhere from 24 to 36 hrs.

Upvotes: 0

Related Questions