Search videos, scrape channels and playlists, and download subtitle transcripts via Apify in sub-3ms cold-starts. Structured YAML output by default, raw JSON for agent tool loops.
$ youtube search "rust tutorial" --max-results 2
Engineered from the ground up to replace heavy interpreted scripts with a fast, safe, and autonomous-friendly CLI.
Compiled natively to static machine code with blocking HTTP (ureq + rustls). No heavy Tokio runtime, no JIT pauses, and no startup latency in high-frequency script loops.
Credentials never land on disk unencrypted by default. Integrates natively with macOS Keychain (/usr/bin/security), Windows DPAPI, and Linux Secret Service.
Produces human-readable YAML by default for terminal users and pure JSON via --json for LLM tool loops and jq pipelines. Standardized error envelopes with stable exit codes.
Filter by upload date, duration, video type, 4K, HD, Creative Commons, and live streams. Support for regular videos, Shorts, and livestreams in a single invocation.
Download video subtitles in SRT, VTT, XML, or plaintext format. Perfect for indexing long-form videos into RAG systems or LLM research pipelines.
Store multiple Apify credentials under named profiles. Use --account <name>, pass --api-key per command, or fall back to APIFY_TOKEN in CI/CD.
Simple, deterministic commands for all your YouTube extraction needs.
| Command | Description | Key Options |
|---|---|---|
youtube search <QUERY> |
Search YouTube for videos, shorts, and streams | --max-results, --sort, --date, --hd, --4k, --download-subs |
youtube scrape <URL> |
Scrape video, channel, playlist, or hashtag | --max-results, --sort, --download-subs, --subs-format |
youtube login [NAME] |
Authenticate with Apify and store key in OS keystore | --api-key, --api-key-stdin, --force |
youtube accounts list |
List configured accounts and secret store type | --check (verifies each key against Apify) |
youtube accounts test <NAME> |
Test stored token and inspect Apify identity | None |
youtube accounts remove <NAME> |
Purge account credentials from local keystore | --yes |
youtube agent-readme |
Print embedded manual for autonomous agents | --json (outputs machine-readable rules) |