Retrieve a channel performance report via YouTube Analytics API
domain: developers.google.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Enable the YouTube Analytics API in the Google Cloud Console and obtain OAuth 2.0 credentials with the yt-analytics.readonly scope.
Construct a request to the reports.query endpoint specifying ids=channel==MINE (or a specific channel ID), startDate, endDate in YYYY-MM-DD format, and the metrics you want (e.g., views, estimatedMinutesWatched, averageViewDuration).
Add optional dimensions (e.g., day, country) and filters to narrow the report scope.
Send the GET request with the access token in the Authorization header and parse the columnHeaders and rows in the JSON response.
Iterate over the rows array, matching each row's values to the corresponding column header names to build your dataset.
Known gotchas
YouTube Analytics API uses its own separate quota from the YouTube Data API; monitor both independently in the Cloud Console.
Data for the most recent 2–3 days may be incomplete or subject to revision; avoid treating very recent figures as final.
The ids parameter value must be URL-encoded when constructing the query string.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?