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

401/403 Errors When Accessing Financial Data (`estimatedRevenue`) of Multiple Brand Accounts Using YouTube Analytics API

$
0
0

I’m developing an integration with the YouTube Analytics API to access financial data (estimatedRevenue) for multiple brand accounts (channels) that I manage. I have administrator permissions for all channels, and they are all monetized.

Authentication is being handled through OAuth 2.0, using the following scopes:

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

What I've Tried

  1. Successful Authentication:
  • I can successfully authenticate my main Google account using client_id and client_secret.
  • I’m able to retrieve general data like views and likes via the YouTube Data API, but financial data through the YouTube Analytics API remains inaccessible.
  1. Requests Made for Multiple Channels:
  • For each channel, I’m using the correct channelId and sending the date range in the proper format.

  • Example endpoint used: GET /v2/reports?ids=channel==UCV7p2362kGftQc07bpVomUQ &startDate=2024-09-01 &endDate=2024-09-01 &metrics=estimatedRevenue &dimensions=month &sort=month

  1. Errors Encountered:
  • 401 Unauthorized:"Insufficient permission to access this report."
  • 403 Forbidden:"Forbidden."
  1. OAuth Playground Tests:
  • I tested using the OAuth Playground, selecting the correct brand account during authentication and using the appropriate scopes. Despite this, the same errors persist.
  1. Additional Verifications:
  • All channels are monetized and are part of the YouTube Partner Program.
  • I am the administrator of all brand accounts and can view financial data in YouTube Studio.

What I’d Like to Know:

  1. Is it possible to access financial data of brand accounts using the Google account managing them?
  2. Are there any additional steps required to authorize brand accounts in the API, beyond selecting the correct account during authentication?
  3. Would the onBehalfOfContentOwner parameter apply in this case? If so, how can I obtain and use it correctly?
  4. How can I ensure the scopes used are sufficient to access estimatedRevenue data?

What I've Reviewed:


Viewing all articles
Browse latest Browse all 3831

Trending Articles