Skip to content

add analytics query command with metrics/dimensions registry#2

Merged
jdwit merged 3 commits intomainfrom
feature/analytics-query
Feb 13, 2026
Merged

add analytics query command with metrics/dimensions registry#2
jdwit merged 3 commits intomainfrom
feature/analytics-query

Conversation

@jdwit
Copy link
Owner

@jdwit jdwit commented Feb 6, 2026

what

raw query engine for the youtube analytics api, plus self-documenting metrics/dimensions registry.

analytics query

direct access to the reports.query endpoint with full control over metrics, dimensions, filters, sorting, and date ranges. three output formats: table, json, csv.

# daily views and likes for the last week
ytstudio analytics query -m views,likes -d day --days 7

# top 10 videos by thumbnail CTR
ytstudio analytics query -m videoThumbnailImpressions,videoThumbnailImpressionsClickRate -d video --sort -videoThumbnailImpressions -n 10

# traffic sources for a specific video
ytstudio analytics query -m views -d insightTrafficSourceType -f video==dMH0bHeiRNg --sort -views

# csv export for spreadsheets
ytstudio analytics query -m views,likes,shares -d day --days 90 -o csv > report.csv

analytics metrics / dimensions

self-documenting registry of all 48 metrics and 25 dimensions from the youtube analytics api. browse by group, inspect individual metrics, get typo suggestions.

ytstudio analytics metrics                    # list all
ytstudio analytics metrics --group engagement # filter by group
ytstudio analytics metrics views              # detail view
ytstudio analytics dimensions --group geographic

registry module

  • 48 metrics across 10 groups (views, reach, watch_time, engagement, cards, annotations, revenue, playlist, audience)
  • 25 dimensions across 9 groups (time, geographic, content, traffic, playback, device, audience, sharing, ads)
  • validation before api calls with fuzzy matching for typo correction
  • core/monetary/filter-only flags per entry

tests

22 new tests (39 total for analytics + registry), all passing. lint clean.

jdwit added 3 commits February 6, 2026 20:24
- analytics query: raw query engine with full access to YouTube Analytics API
  supports all metrics, dimensions, filters, date ranges, sorting, and limits
  output formats: table, json, csv

- analytics metrics: list and inspect available metrics
  filterable by group, shows core/monetary tags, detail view per metric

- analytics dimensions: list and inspect available dimensions
  filterable by group, shows filter-only flag, detail view per dimension

- registry module with 48 metrics and 25 dimensions
  includes descriptions, groups, core/monetary/filter-only flags
  validation with fuzzy matching for typo suggestions (levenshtein)

- 22 new tests (39 total for analytics + registry)
@jdwit jdwit merged commit 04888b4 into main Feb 13, 2026
5 checks passed
@jdwit jdwit deleted the feature/analytics-query branch February 13, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant