Runs a YouTube Analytics report for your channel: views, watch time, subscribers.
curl -X POST "https://api.primaryapi.com/v1/run/youtube.analytics_report" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"startDate":"2026-11-01","endDate":"2026-11-14","metrics":["views","estimatedMinutesWatched","subscribersGained"],"dimensions":["day"],"sort":[{"field":"day"}],"limit":2}'{
"output": {
"found": true,
"data": {
"channel": "MINE",
"nextCursor": "eyJzIjozfQ",
"rows": [
{
"views": 1240,
"estimatedMinutesWatched": 3915,
"subscribersGained": 18,
"day": "2026-11-01"
}, …
],
"columnHeaders": [
{
"name": "day",
"columnType": "DIMENSION",
"dataType": "STRING"
}, …
]
}
},
"credits": 1
}Input and output
10 fields
2026-11-01.2026-11-14.["views","estimatedMinutesWatched","sub….["day"].[{"field":"day"}].2.4 fields
Good to know
Runs as your connected Google account. Needs the Read YouTube Analytics capability.
Reports cover your own channel or another channel you own.
Metric and dimension names are YouTube Analytics names. Not every combination is a supported report, and YouTube answers an unsupported one as invalid input.
Top-video, city and detail reports need a sort. A small limit (200, 250 or 25 rows).
The most recent days may not have data yet.
Revenue and ad metrics need youtube.revenue_report.
The same key and credits work for every API.