1

Assuming that I'm quite new to the YouTube Content ID API (and in general to YouTube Content ID), i'm looking for a method for get quickly the views and the earnings of a single asset.
Analyzing the YouTube Analytics API, I have not found anything making reference to the assets, then I tried to base myself on the claims to obtain the data which I need.
It's work, but, having to walk multiple pages, this takes many requests to the YouTube API server and it responds really slowly.

I would like, in practice, achieve a similar result:

enter image description here



I'm using PHP for this, but I do mostly GET requests directly basing on the documentation of YouTube Content ID API

Mirko
  • 165
  • 2
  • 12

1 Answers1

1

I've found the solution:
Using the Youtube Analytics API:

ids=contentOwner==MY_CONTENT_OWNER_ID
start-date=my_start_date
end-date=my_end_date
metrics=estimatedMinutesWatched,averageViewDuration,averageViewPercentage, views,subscribersGained
dimensions=video
filters=claimedStatus==claimed
max-results=10
sort=-views

I can obtain the top 10 videos claimed sorted by views.
With the video ids, I can get the views, the earnings and the asset id using the ClaimSearch reference in YouTube Content ID API I can find the rest of the informations that I need.

EDIT:
There is a dimension missed on the official documentation: asset.
I've updated the query of Analytics API:
ids=contentOwner==MY_CONTENT_OWNER_ID
start-date=my_start_date
end-date=my_end_date
metrics=estimatedMinutesWatched,averageViewDuration,averageViewPercentage, views,subscribersGained
dimensions=asset
filters=claimedStatus==claimed
max-results=10
sort=-views

and it show directly the assets.

Mirko
  • 165
  • 2
  • 12
  • This is no longer possible (Feb 2017) – Michal Holub Feb 28 '17 at 12:25
  • Yes, you're right. I think that the best solution now is to parse the YouTube Reports CSVs and make all filters internal to the server. – Mirko Feb 28 '17 at 12:36
  • 1
    It depends on what's needed though. If you're after views/clicks/shares... per asset and you want full list (not just top 500 from CMS frontend), the only option is pretty much use bulk reports API. Btw, there is a filter called 'group', theoretically, if you created a group for each asset and just put one asset id as the only item in that group, then maybe that filter would work. Not sure about the limits of this approach. – Michal Holub Mar 01 '17 at 06:29