YouTube2Text - Video Transcription API
A text extraction service that converts YouTube video content into clean, timestampless transcripts for content analysis, research, and processing workflows. Available as a REST API and as an MCP server for AI agents.
Overview
YouTube2Text transforms YouTube videos into readable text by removing subtitle timing markers and metadata, delivering pure content suitable for:
- Content analysis and insights
- Text summarization workflows
- Research and documentation
- Content generation pipelines
- AI agent and RAG pipelines
Quick Start```bash
Get the free shared demo key (no account, 5 videos/month per IP)
curl -s https://youtube2text.org/api/demo-key
-> {"success":true,"apiKey":"yt_..."}
Fetch 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"
For your own key and higher limits, sign in with Google at youtube2text.org/app/keys.
## API Reference
**Base URL**: `https://youtube2text.org`
**Transcription Endpoint**: `/api/transcribe` (GET or POST)
Complete machine-readable reference: youtube2text.org/api.md (index: /llms.txt). Existing integrations using `https://api.youtube2text.org` continue to work.
### Request Format
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `url` | string | Yes | Any YouTube URL form (watch, `youtu.be`, Shorts, embed) or a bare 11-character video ID |
| `maxChars` | number | No | Character limit (default and max: 150,000) |
### Authentication
Include your API key in the request header:```
x-api-key: YOUR_API_KEY
Authorization: Bearer YOUR_API_KEY is also accepted.
HTTP Status Codes
| Code | Meaning |
|---|---|
| 200 | Transcription successful |
| 400 | Invalid request parameters |
| 401 | Authentication failed |
| 404 | Video or transcript not found |
| 429 | Rate limit exceeded |
| 500 | Server error |
Error Types
VALIDATION_ERROR: Parameter validation failedUNAUTHORIZED: Invalid API credentialsVIDEO_NOT_FOUND: YouTube video unavailableTRANSCRIPT_UNAVAILABLE: No captions availableINVALID_URL: Malformed video URLRATE_LIMIT_EXCEEDED: Quota or rate limit reached (retryAfterSecondsincluded)YOUTUBE_ERROR: Upstream YouTube failure, retry laterINTERNAL_ERROR: Server-side issue
All error responses include a docsUrl field pointing at the API reference.
MCP Server (AI agents)
The MCP server at https://youtube2text.org/mcp (streamable HTTP) exposes a transcribe_video(url, maxChars?) tool. OAuth 2.1 is supported, so clients like claude.ai connect without manual key handling; an API key header works for everything else.
- claude.ai: Settings → Connectors → Add custom connector →
https://youtube2text.org/mcp→ sign in with Google and click Allow. - Claude Code:
claude mcp add --transport http youtube2text https://youtube2text.org/mcp - Claude API: add
{"type": "url", "url": "https://youtube2text.org/mcp", "name": "youtube2text", "authorization_token": "YOUR_API_KEY"}tomcp_servers. - OpenAI Responses API: add
{"type": "mcp", "server_label": "youtube2text", "server_url": "https://youtube2text.org/mcp", "headers": {"x-api-key": "YOUR_KEY"}, "require_approval": "never"}totools.
Integration guides and recipes: youtube2text.org/blog.
Examples
This directory contains examples of how to use the YouTube2Text API with different AI models and in different programming languages.
Python
- Anthropic Claude Integration
- OpenAI Integration
- Google Gemini Integration
JavaScript
- Anthropic Claude Integration
- OpenAI Integration
TypeScript
- Anthropic Claude Integration
- OpenAI Integration