ravenjohn
ravenjohn

Reputation: 13

Youtube Analytics API returns Insufficient permission to access this report

Whenever I try to get an earnings related metric in the API, it returns "Insufficient permission to access this report". But when I remove it and replace with simple metrics like "views" or "likes", it works.

Here's the request:

https://developers.google.com/apis-explorer/#search/youtube%20analytics/youtubeAnalytics/v1/youtubeAnalytics.reports.query?ids=channel%253D%253DMINE&start-date=2013-01-01&end-date=2017-02-04&metrics=views%252CestimatedRevenue&_h=1&

Upvotes: 1

Views: 1388

Answers (2)

D V Yogesh
D V Yogesh

Reputation: 3700

JavaScript

var OAUTH2_SCOPES = [
  'https://www.googleapis.com/auth/youtube',
  'https://www.googleapis.com/auth/youtube.force-ssl'
];

to retrieve comments from the YouTube API add https://www.googleapis.com/auth/youtube.force-ssl this into OAUTH2_SCOPES array

Upvotes: 1

KENdi
KENdi

Reputation: 7741

Well, I try it my self and like you, I also got the 401 error when I use the metrics estimatedRevenue.

I found here in this SO question that 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.

This linked issue might also help you.

Upvotes: 1

Related Questions