How to use the Youtube Analytics API to get the metric “earnings”?

限于喜欢 提交于 2019-11-28 05:48:48

问题


I am a Youtube Partner and I have monetized videos on Youtube. Already receive a small monthly amount through some channels that have associated with my Google Adsense account.

Now, I would like to generate a report gathering the monetary values and views received from each channel. I did the following question on Google Code, because I thought there was some problem in the API, but it happened that I was using the API incorrectly. See the link below.

http://code.google.com/p/gdata-issues/issues/detail?id=4826#makechanges

Now, I still could not make it work because I do not know where to find the requested data in the response I got from the link above.

Where do I find this CMS_ID? I have more than one channel, so I need to have each accepted as a Youtube Content Manager to use the API and retrieve the gains? Someone here on Stack Overflow already managed to use the Youtube Analytics API using the metric "earnings"?

My code is in Python based on the example from Google here:

https://developers.google.com/youtube/analytics/v1/code_samples/python

I'm using the following scopes:

YOUTUBE_SCOPES = ["https://www.googleapis.com/auth/youtube.readonly",  
                      "https://www.googleapis.com/auth/yt-analytics.readonly", 
                      "https://www.googleapis.com/auth/youtubepartner",
                      "https://www.googleapis.com/auth/yt-analytics-monetary.readonly"]

回答1:


As of right now, it's only possible to retrieve monetary information in YouTube Analytics API reports when those reports are run via the context of a content owner, as described in the documentation.

It is possible to have a monetized channel that is opted in for Google AdSense ads without having that channel managed by a content owner, in which case you would not be able to get those metrics via the YouTube Analytics API.

Let's use the issue you previously opened to track the request to open up this type of report to non-content owners as well, as that's a more appropriate place for feature requests than Stack Overflow.



来源:https://stackoverflow.com/questions/17946003/how-to-use-the-youtube-analytics-api-to-get-the-metric-earnings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!