HomeBlog

Extract YouTube Transcripts with curl in 30 Seconds

Terminal pulling a YouTube transcript as text

You don't need an account, an SDK, or a headless browser to turn a YouTube video into plain text. youtube2text.org is a REST API: one call to get a key, one call to get the transcript.

Step 1: Grab the free demo key

curl -s https://youtube2text.org/api/demo-key

Response:

{"success": true, "apiKey": "yt_..."}

The demo key is shared and IP-limited (5 videos per month per IP) — perfect for trying things out or occasional scripting.

Step 2: Get a transcript

curl -s "https://youtube2text.org/api/transcribe?url=https://www.youtube.com/watch?v=VIDEO_ID&maxChars=5000" \
  -H "x-api-key: yt_YOUR_KEY"

Success response:

{"result": {"videoId": "...", "title": "...", "pubDate": "2025-01-01T00:00:00-07:00",
            "content": "full transcript text ...", "contentSize": 12345, "truncated": false}}

That's it. A few details worth knowing:

Handling errors

Every error comes back in the same machine-readable shape:

{"error": {"code": "RATE_LIMIT_EXCEEDED", "message": "...", "status": 429,
           "docsUrl": "https://youtube2text.org/api.md", "retryAfterSeconds": 3600}}

The codes you'll actually see:

When the demo key isn't enough

Sign in with Google at youtube2text.org/app/keys and create your own key: the free account also gets 5 videos/month, and paid plans go from 50/month to unlimited.

The complete machine-readable reference — parameters, every error code, MCP integration — lives at youtube2text.org/api.md. If you're wiring this into an AI agent instead of a shell script, read the MCP guide next.