We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation .
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi anyone have an Idea to get the Estimation Revenues from youtube api..
I have tried the Analytics API with scopes " https://www.googleapis.com/auth/yt-analytics.readonly","https://www.googleapis.com/auth/youtubepartner","https://www.googleapis.com/auth/youtube.readonly " ," https://www.googleapis.com/auth/yt-analytics-monetary.readonly " ," https://www.googleapis.com/auth/youtube "
If I try to get the basic details like -likes comment, views we got the response
`execute_api_request( YOUTUBE_ANALYTICS.reports().query, ids='channel==MINE', startDate=datetime.now().strftime("%Y-01-01"), endDate=datetime.now().strftime("%Y-%m-%d"), metrics='views,estimatedMinutesWatched,likes,shares,comments', )`
{'kind': 'youtubeAnalytics#resultTable', 'columnHeaders': [{'name': 'views', 'columnType': 'METRIC', 'dataType': 'INTEGER'}, {'name': 'estimatedMinutesWatched', 'columnType': 'METRIC', 'dataType': 'INTEGER'}, {'name': 'likes', 'columnType': 'METRIC', 'dataType': 'INTEGER'}, {'name': 'shares', 'columnType': 'METRIC', 'dataType': 'INTEGER'}, {'name': 'comments', 'columnType': 'METRIC', 'dataType': 'INTEGER'}], 'rows': [[0, 0, 0, 0, 0]]} <class 'dict'>
But If I try with revenue metrices I got the Forbidden error
`execute_api_request( YOUTUBE_ANALYTICS.reports().query, ids='channel==MINE', startDate=datetime.now().strftime("%Y-01-01"), endDate=datetime.now().strftime("%Y-%m-%d"), metrics='views,estimatedMinutesWatched,subscribersGained,subscribersLost,estimatedRevenue,cpm,monetizedPlaybacks,playbackBasedCpm,adImpressions,likes,dislikes,averageViewDuration,shares,averageViewPercentage,subscribersGained,subscribersLost', )`
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://youtubeanalytics.googleapis.com/v2/reports?ids=channel%3D%3DMINE&startDate=2023-01-01&endDate=2023-04-11&metrics=views%2CestimatedMinutesWatched%2CsubscribersGained%2CsubscribersLost%2CestimatedRevenue%2Ccpm%2CmonetizedPlaybacks%2CplaybackBasedCpm%2CadImpressions%2Clikes%2Cdislikes%2CaverageViewDuration%2Cshares%2CaverageViewPercentage%2CsubscribersGained%2CsubscribersLost&alt=json returned "Forbidden">
The text was updated successfully, but these errors were encountered:
No branches or pull requests