Analytics¶
ytstudio analytics queries the YouTube Analytics API: channel-wide totals,
per-video performance, and ad-hoc queries against the full metric and
dimension catalogue. Output defaults to a Rich table; pass -o json for
scripting.
Common queries¶
ytstudio analytics overview # channel summary for the last 28 days
ytstudio analytics overview --days 7 # rolling 7-day window
ytstudio analytics overview --no-compare # totals only, no growth deltas
ytstudio analytics video <video-id> # one video's recent performance
ytstudio analytics video <video-id> --days 90 # longer window for one video
By default overview also compares each metric to the previous equal-length
window and shows the percent change (green up, red down). Pass --no-compare
for plain totals. In JSON output the comparison is exposed as previous
(the prior window's metrics) and pct_change (percent change per metric,
null when there is no prior-window baseline).
Custom queries¶
analytics query is a thin wrapper over the YouTube Analytics
reports.query endpoint, so anything you can express against that API is
reachable from the CLI.
ytstudio analytics query \
-m views,estimatedMinutesWatched,averageViewDuration \
-d day \
--start 2026-04-01 --end 2026-04-30
ytstudio analytics query \
-m views -d country \
--sort -views -n 10
Sort fields take a - prefix for descending. Use -f key==value (repeatable)
to filter, for example -f video==dMH0bHeiRNg.
Discover what is available:
ytstudio analytics metrics # list every metric the API exposes
ytstudio analytics dimensions # list every dimension the API exposes
Run ytstudio analytics --help (or open the
Command reference) for every flag.
Output¶
Quota¶
The YouTube Analytics API is a separate API from the YouTube Data API, with its own query-cost based quota that is far more generous in practice, so analytics reads do not consume your Data API budget. See API quota for the full picture.