oytc — open YouTube CLI
Read public YouTube data and your channel analytics. Read-only and scriptable.
oytc is a command-line client for the official YouTube Data API v3
and YouTube Analytics API. It covers search, channels, videos, playlists, comments,
live chat, and owner-authorized analytics — with stable JSON/JSONL/TSV output and retries.
Zero writes. API keys cover public data. Optional OAuth requests only read-only
YouTube and Analytics scopes for your own channel; uploads, moderation, and revenue are absent.
Install (macOS & Linux)
curl -fsSL https://davis7dotsh.github.io/open-yt-cli/install.sh | sh
The installer detects your platform, verifies the release's SHA-256 checksum before
installing, and defaults to ~/.local/bin — no root required.
Windows: use install.ps1
(irm https://davis7dotsh.github.io/open-yt-cli/install.ps1 | iex) or grab a zip from the
releases page.
Quick setup
# 1. Create a free YouTube Data API v3 key (see the setup guide below)
# 2. Save it securely (prompts without echo; never lands in shell history)
oytc login
# 3. Verify
oytc status --check
# 4. Go
oytc search "Go conference" --type video --limit 5
oytc channel get @GoogleDevelopers
oytc video stats dQw4w9WgXcQ --format json
# Optional owner analytics (see the OAuth setup guide)
oytc login --oauth
oytc analytics overview --by day
Commands
| Command | What it does |
|---|---|
search | Search public videos, channels, and playlists |
channel | Channels, activities, sections, and uploads |
video | Videos, statistics, popular charts, AI trainability |
playlist | Playlists and playlist items |
comment | Comments, replies, and comment threads |
subscription | Public channel subscriptions |
live-chat | Live chat (one page or continuous REST polling) |
category / language / region | YouTube metadata lists |
analytics | OAuth-only overview, video, traffic, demographic, and raw reports |
login / status / logout | Manage API-key and OAuth credentials |
skills install | Confirm and install the bundled agent skill |
version / update | Show build info; checksum-verified self-update |