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

CommandWhat it does
searchSearch public videos, channels, and playlists
channelChannels, activities, sections, and uploads
videoVideos, statistics, popular charts, AI trainability
playlistPlaylists and playlist items
commentComments, replies, and comment threads
subscriptionPublic channel subscriptions
live-chatLive chat (one page or continuous REST polling)
category / language / regionYouTube metadata lists
analyticsOAuth-only overview, video, traffic, demographic, and raw reports
login / status / logoutManage API-key and OAuth credentials
skills installConfirm and install the bundled agent skill
version / updateShow build info; checksum-verified self-update