YouTube Transcript API
Extract video transcripts, subtitles, and captions programmatically. Build powerful content tools with our simple REST API.
API Features
Fast & Reliable
Lightning-fast response times with 99.9% uptime. Built on robust infrastructure.
50+ Languages
Support for auto-generated and manual transcripts in over 50 languages.
Secure
API keys are hashed and stored securely. All requests are encrypted via HTTPS.
Real-time
Get transcripts instantly as soon as they're available on YouTube.
API Key Management
Quick Start
Get up and running with the API in under 2 minutes
Get your API key
Subscribe and generate an API key from the section above
Add the header
Include X-API-Key header in requests
Make requests
Start fetching transcripts from any YouTube video
Try it now:
curl -X GET "https://youtube-tanscript.vercel.app/transcripts/dQw4w9WgXcQ/first" \
-H "X-API-Key: yt_your_api_key_here"Authentication
All API requests require authentication via API key
Include your API key in the X-API-Key header with every request. Your API key grants unlimited access to all transcript endpoints.
Request Header
X-API-Key: yt_your_api_key_hereKeep your API key secure
Never expose your API key in client-side code or public repositories. Use environment variables and server-side requests.
Base URL
https://youtube-tanscript.vercel.appCode Examples
Examples in popular programming languages
curl -X GET "https://youtube-tanscript.vercel.app/transcripts/dQw4w9WgXcQ/first" \
-H "X-API-Key: yt_your_api_key_here"API Endpoints
GET/transcripts/{video_id}/first
Get the first available transcript for a video. Returns complete transcript with metadata including language, timestamps, and text content.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
video_id | string | Required | YouTube video ID (e.g., dQw4w9WgXcQ) |
preserve_formatting | boolean | Optional | Keep original text formatting (default: false) |
Response
{
"video_id": "dQw4w9WgXcQ",
"language": "English",
"language_code": "en",
"is_generated": false,
"snippets": [
{
"text": "We're no strangers to love",
"start": 18.0,
"duration": 3.5
},
...
]
}GET/transcripts/{video_id}
Fetch transcript snippets for a video with optional language selection. Perfect for when you need specific language transcripts.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
video_id | string | Required | YouTube video ID |
languages | string | Optional | Comma-separated language codes (e.g., 'de,en') |
preserve_formatting | boolean | Optional | Keep original text formatting |
Response
[
{
"text": "We're no strangers to love",
"start": 18.0,
"duration": 3.5
},
{
"text": "You know the rules and so do I",
"start": 21.5,
"duration": 3.0
},
...
]GET/transcripts/{video_id}/list
List all available transcripts and metadata for a video. Useful for discovering available languages before fetching.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
video_id | string | Required | YouTube video ID |
Response
[
{
"video_id": "dQw4w9WgXcQ",
"language": "English",
"language_code": "en",
"is_generated": false,
"is_translatable": true,
"translation_languages": [...]
},
{
"video_id": "dQw4w9WgXcQ",
"language": "Spanish",
"language_code": "es",
"is_generated": true,
"is_translatable": true
}
]GET/transcripts/{video_id}/translate/{from_lang}/{to_lang}
Get transcript translated to a different language. Translate from any available source language to your target language.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
video_id | string | Required | YouTube video ID |
from_lang | string | Required | Source language code (e.g., 'en') |
to_lang | string | Required | Target language code (e.g., 'es') |
Response
[
{
"text": "No somos ajenos al amor",
"start": 18.0,
"duration": 3.5
},
...
]GET/transcripts/{video_id}/raw
Get raw transcript data as received from YouTube. Returns unprocessed data for advanced use cases.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
video_id | string | Required | YouTube video ID |
Response
{
"video_id": "dQw4w9WgXcQ",
"raw": [
{
"text": "We're no strangers to love",
"start": 18.0,
"duration": 3.5
},
...
]
}Error Codes
Common error responses you may encounter
| Status Code | Description |
|---|---|
401 | Unauthorized - Missing or invalid API key |
404 | Not Found - Video not found or no transcript available |
429 | Too Many Requests - Rate limit exceeded (free tier only) |
500 | Internal Server Error - Something went wrong on our end |
Rate Limits
Unlimited Access for Subscribers
As a subscriber, you have unlimited API requests with no rate limits.
Frequently Asked Questions
What is the YouTube Transcript API?
The YouTube Transcript API is a RESTful API that allows developers to programmatically extract transcripts, subtitles, and captions from any YouTube video. It returns JSON responses with text, timestamps, and duration for each transcript segment.
How do I get an API key?
API keys are available to paid subscribers. Sign up for a subscription, then generate your API key from the API page or your dashboard settings.
What languages are supported?
The API supports 50+ languages including English, Spanish, French, German, Japanese, Korean, Chinese, and many more. You can also translate transcripts between supported languages.
Are there rate limits?
Paid subscribers have unlimited API access with no rate limits. This allows you to build production applications without worrying about hitting request caps.