HomeBlog

Free YouTube transcript API: curl, REST, and MCP

Extract YouTube transcripts as plain text — free, straight from curl or any HTTP client. Also an MCP server for Claude Code, Codex, claude.ai, and other AI agents.

AI agents: the complete machine-readable API reference lives at https://youtube2text.org/api.md (index: /llms.txt).

How it works

Call GET or POST https://youtube2text.org/api/transcribe with a YouTube `url` and optional `maxChars`, authenticated with an `x-api-key` header. No key yet? GET https://youtube2text.org/api/demo-key returns a shared demo key. MCP clients can instead connect to https://youtube2text.org/mcp with OAuth.

Quick start (curl)
# No key? Get the shared demo key first:
curl "https://youtube2text.org/api/demo-key"
# -> {"success":true,"apiKey":"yt_..."}

# Fetch a transcript (GET):
curl "https://youtube2text.org/api/transcribe?url=https://www.youtube.com/watch?v=VIDEO_ID&maxChars=5000"   -H "x-api-key: YOUR_API_KEY"
POST variant
curl -X POST "https://youtube2text.org/api/transcribe"   -H "x-api-key: YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"url": "https://www.youtube.com/watch?v=VIDEO_ID", "maxChars": 5000}'

Use it from AI models via MCP

claude.ai - custom connector with OAuth
# claude.ai (web or desktop):
# Settings -> Connectors -> Add custom connector
# URL: https://youtube2text.org/mcp
# Then sign in with Google and click Allow. Done - OAuth handles the rest.
Claude API - mcp_servers
# Claude API (Messages) with the MCP connector:
{
  "mcp_servers": [
    {
      "type": "url",
      "url": "https://youtube2text.org/mcp",
      "name": "youtube2text",
      "authorization_token": "YOUR_API_KEY"
    }
  ]
}
OpenAI Responses API
# OpenAI Responses API:
resp = client.responses.create(
    model="gpt-5",
    tools=[{
        "type": "mcp",
        "server_label": "youtube2text",
        "server_url": "https://youtube2text.org/mcp",
        "headers": {"x-api-key": "YOUR_API_KEY"},
        "require_approval": "never"
    }],
    input="Summarize https://www.youtube.com/watch?v=VIDEO_ID"
)

Possible statuses and error codes

Full reference

Complete machine-readable docs: https://youtube2text.org/api.md · index: /llms.txt · app & API keys: https://youtube2text.org/app/keys · source: github.com/dm-nosov/youtube2text