Skip to content
YT Metrics CLI logo

YT Metrics CLI

Stop clicking through YouTube Studio dashboards one channel at a time. Analyze dozens of channels in a single command — engagement metrics, structured reports, and transcripts, straight from your terminal.

Comparing YouTube channels means opening Studio for each one, copy-pasting numbers into a spreadsheet, and writing formulas by hand. By the time you can start analyzing, hours are gone. There is no way to batch-fetch metrics, rank channels against each other, or track trends over time without building your own tooling.

YT Metrics CLI wraps the YouTube Data API v3 in a single CLI. Point it at a YAML file of channels, run one command, and get a timestamped folder of reports: CSV for raw data, TXT for human-readable analysis, URL lists for the best and latest content. Every video gets six engagement metrics computed automatically.

Multi-Channel Batch Analysis

Define channels by @handle, legacy username, or raw ID in a simple YAML file. One command fetches up to 100 videos per channel with full statistics — batched in groups of 50 to respect API limits.

Six Engagement Metrics

Engagement rate, view rate, like rate, comment rate, subscriber-relative engagement, and views per minute. Every formula is transparent: (likes + comments) / views * 100. No black boxes.

Five Export Formats

Every run writes a timestamped folder with CSV data, per-channel stats (top 5 videos, performance distribution), cross-channel trends (duration categories, viral detection), and URL lists for the best and latest videos. Plus a self-documenting README.

Transcript Downloader

Fetch video transcripts with multi-language support. Tries your preferred languages first, falls back to the first available transcript, and finally checks a local fixtures directory for offline use.

Terminal window
# Clone and install
git clone https://github.com/mlorentedev/yt-metrics-cli.git
cd yt-metrics-cli
make install
# Configure
cp .env.example .env # Set YOUTUBE_API_KEY
cp channels.example.yml channels.yml # Add channels to analyze
# Analyze channels — reports land in output/<timestamp>/
yt-metrics channels
# Download a single video transcript
yt-metrics transcript -v dQw4w9WgXcQ

Python 3.12+

Type-hinted throughout. Modular architecture with clear separation between API, metrics, and export layers.

YouTube Data API v3

Channel resolution (handle, username, ID), playlist enumeration, batch video statistics.

youtube-transcript-api

Multi-language transcript fetch with automatic fallback chain.

uv + Makefile

Fast package management with uv. Makefile for one-command install, check, test, and build workflows.