Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Obtaining the current user's YouTube content owner id

Good afternoon

I've created an app that is pulling data from YouTube Analytics API. My task is to get contentOwner monetary reports, and for that I need an OWNER_NAME which is an issue for me. I have test YouTube account that have monetary reports on it but its not connected to a youTube CMS.

  1. Is the connection to cms.youtube.com neccessay to pull contentOwner reports which are shown on youtube analytics?
  2. Does a user have to provide OWNER_NAME ( or ContentOwner_ID ? ) by himself, or can I pull it somehow?

Authorization grants access to the yt-analytics-monetary.readonly, yt-analytics.readonly, youtubepartner and few others.

like image 785
Karol Z. Błaszczyk Avatar asked Jun 20 '13 09:06

Karol Z. Błaszczyk


People also ask

How to get content Owner ID YouTube?

To retrieve a content owner report, call the API's reports. query method and set the ids parameter value in the API request to contentOwner==OWNER_NAME , where OWNER_NAME specifies the content owner's ID. Ask your partner manager if you are unsure of the value.

What is YouTube content Owner?

The content owner is the person or organization that claims videos and sets their monetization policy. A content owner has one or more channels associated with it, and one or more YouTube users who are designated as administrators.


1 Answers

Assuming you have an OAuth 2 token with access to the https://www.googleapis.com/auth/youtubepartner scope, you can make an API call to youtubePartner.contentOwners.list(fetchMine=true) to get back a list of YouTube content owners associated with the current OAuth 2 token. (There will normally only be one item returned.) You can then get the content owner id value from the id property of each item in the items list that's returned. This is the value that you can use when making content owner YouTube Analytics API reports, or using the onBehalfOfContentOwner delegation parameter in the YouTube Data API v3.

If you don't have access to the https://www.googleapis.com/auth/youtubepartner scope but you still want to write code that requests YouTube Analytics API content owner reports, you need to ask the content partner you're working with to tell you their content owner id.

I'd link to the documentation, but it's currently not exposed publicly. This is a common enough question that I thought it should be answered, though.

like image 112
Jeff Posnick Avatar answered Oct 04 '22 01:10

Jeff Posnick