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)
tmp="$(mktemp)" && {
curl --proto '=https' --proto-redir '=https' -fsSL \
https://davis7dotsh.github.io/open-yt-cli/install.sh -o "$tmp" && sh "$tmp"
status=$?
rm -f "$tmp"
(exit "$status")
}
The installer detects your platform, verifies the release's SHA-256 checksum before
installing, and defaults to ~/.local/bin — no root required.
Windows (PowerShell):
$tmp = Join-Path ([IO.Path]::GetTempPath()) ("oytc-install-" + [Guid]::NewGuid() + ".ps1")
try {
irm https://davis7dotsh.github.io/open-yt-cli/install.ps1 -OutFile $tmp -ErrorAction Stop
& $tmp
} finally {
Remove-Item -LiteralPath $tmp -Force -ErrorAction SilentlyContinue
}
Alternatively, 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 |