Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

YouTube Reporting API returns as 403 when estimatedAdRevenue is included as a metric

$
0
0

I am working on a program to do some calculations with ad revenue from YouTube. I have set up OAuth 2.0 through the cloud console and have gotten access and refresh tokens that have the following scopes:

https://www.googleapis.com/auth/youtubehttps://www.googleapis.com/auth/yt-analytics.readonlyhttps://www.googleapis.com/auth/yt-analytics-monetary.readonly

Making this request returns a valid response

https://youtubeanalytics.googleapis.com/v2/reports?ids=channel==123456789&metrics=views&dimensions=&startDate=1970-01-01&endDate=2050-01-01

{"kind": "youtubeAnalytics#resultTable","columnHeaders": [        {"name": "views","columnType": "METRIC","dataType": "INTEGER"        }    ],"rows": [        [            301        ]    ]}

However, if I add estimatedAdRevenue as a metric using the same authentication, the response is a 403.

{"error": {"code": 403,"message": "Forbidden","errors": [            {"message": "Forbidden","domain": "global","reason": "forbidden"            }        ]    }}

Because the query is successfully getting private data (view count), my assumption is that the 403 is because my channel is not monetized, but I can not find that anywhere in the documentation. My end-goal is to get a report of estimated ad revenue per video and I'm pretty sure that getting past this 403 is exactly what I need.


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>