Direct API access
Base URL: https://youtube-transcript-api-production-0221.up.railway.app x-api-key: YOUR_API_KEY
Loading YouTube Transcript API...
Documentation
Request examples, response formats, authentication headers, parameters, and common error responses for transcript-powered applications.
Authentication
Protected endpoints require authentication. Use x-api-key for direct API access, or RapidAPI headers when calling through the RapidAPI marketplace.
Base URL: https://youtube-transcript-api-production-0221.up.railway.app x-api-key: YOUR_API_KEY
Base URL: https://youtube-transcript27.p.rapidapi.com x-rapidapi-key: YOUR_RAPIDAPI_KEY x-rapidapi-host: youtube-transcript27.p.rapidapi.com
Usage model
A single transcript request counts as 1 video processed. A single metadata request counts as 1 video processed. A single languages request counts as 1 video processed. A batch request with 10 video IDs counts as 10 videos processed.
This makes pricing easier to estimate for batch workflows like podcast analysis, YouTube channel processing, AI summarization, and search indexing.
Endpoints
Batch processing is the main workflow for AI summarizers, channel analysis, research tools, and content pipelines.
The default response is format=segments, which returns timestamped segments with offset and duration. This is the safest default for citation, clipping, subtitle, and research workflows. Use format=text when you only need clean joined text for summarization, search indexing, or AI prompts.
Processes multiple YouTube video IDs in one request. Use format=text for AI summarization pipelines, or format=segments for timestamps.
/api/batch| Name | Required | Description |
|---|---|---|
videos | Yes | Array of 1–10 YouTube video IDs. |
lang | No | Transcript language code. Defaults to en. |
format | No | segments or text. Defaults to segments. |
{
"success": true,
"count": 2,
"successful": 2,
"failed": 0,
"results": [
{
"success": true,
"videoId": "dQw4w9WgXcQ",
"language": "en",
"format": "text",
"source": {
"provider": "yt-dlp",
"requestedLanguage": "en",
"returnedLanguage": "en",
"isAutoGenerated": true
},
"text": "Full clean transcript text...",
"cache": {
"status": "miss",
"fetchedAt": "2026-08-21T10:00:00.000Z",
"ttlSeconds": 86400
}
}
]
}Returns transcript data for a YouTube video. Use format=text for clean joined text, or format=segments for timestamped segments.
/api/transcript?id=VIDEO_ID&lang=en&format=segments| Name | Required | Description |
|---|---|---|
id | Yes | 11-character YouTube video ID. |
lang | No | Transcript language code. Defaults to en. |
format | No | segments or text. Defaults to segments. |
{
"success": true,
"videoId": "dQw4w9WgXcQ",
"language": "en",
"source": {
"provider": "youtube-transcript",
"requestedLanguage": "en",
"returnedLanguage": "en",
"isAutoGenerated": null
},
"transcript": [
{
"text": "Hello everyone",
"offset": 1200,
"duration": 800
}
],
"cache": {
"status": "hit",
"fetchedAt": "2026-08-21T10:00:00.000Z",
"ttlSeconds": 86400
}
}Returns a clean plain-text transcript for summarization and search pipelines.
/api/transcript?id=VIDEO_ID&lang=en&format=text| Name | Required | Description |
|---|---|---|
id | Yes | 11-character YouTube video ID. |
lang | No | Transcript language code. Defaults to en. |
format | No | Set to text. |
{
"success": true,
"videoId": "dQw4w9WgXcQ",
"language": "en",
"format": "text",
"source": {
"provider": "yt-dlp",
"requestedLanguage": "en",
"returnedLanguage": "en",
"isAutoGenerated": true
},
"text": "Full clean transcript text...",
"cache": {
"status": "hit",
"fetchedAt": "2026-08-21T10:00:00.000Z",
"ttlSeconds": 86400
}
}Returns public title, description, thumbnail, and channel details.
/api/metadata?id=VIDEO_ID| Name | Required | Description |
|---|---|---|
id | Yes | 11-character YouTube video ID. |
{
"title": "Example Video Title",
"description": "Example description",
"thumbnail": "https://...",
"channel": "Example Channel"
}Checks common transcript language availability.
/api/languages?id=VIDEO_ID| Name | Required | Description |
|---|---|---|
id | Yes | 11-character YouTube video ID. |
{
"success": true,
"videoId": "dQw4w9WgXcQ",
"languages": [
{
"code": "en",
"name": "English",
"available": true
}
]
}Checks whether the API deployment is reachable.
/api/health{
"status": "ok"
}Request examples
curl --request POST \
--url 'https://youtube-transcript-api-production-0221.up.railway.app/api/batch' \
--header 'content-type: application/json' \
--header 'x-api-key: YOUR_API_KEY' \
--data '{"videos":["dQw4w9WgXcQ","JbhBdOfMEPs"],"lang":"en","format":"text"}'curl --request GET \
--url 'https://youtube-transcript-api-production-0221.up.railway.app/api/transcript?id=dQw4w9WgXcQ&lang=en&format=segments' \
--header 'x-api-key: YOUR_API_KEY'curl --request GET \
--url 'https://youtube-transcript-api-production-0221.up.railway.app/api/transcript?id=dQw4w9WgXcQ&lang=en&format=text' \
--header 'x-api-key: YOUR_API_KEY'curl --request GET \
--url 'https://youtube-transcript-api-production-0221.up.railway.app/api/metadata?id=dQw4w9WgXcQ' \
--header 'x-api-key: YOUR_API_KEY'curl --request GET \
--url 'https://youtube-transcript-api-production-0221.up.railway.app/api/languages?id=dQw4w9WgXcQ' \
--header 'x-api-key: YOUR_API_KEY'curl --request POST \
--url 'https://youtube-transcript27.p.rapidapi.com/api/batch' \
--header 'content-type: application/json' \
--header 'x-rapidapi-host: youtube-transcript27.p.rapidapi.com' \
--header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' \
--data '{"videos":["dQw4w9WgXcQ","JbhBdOfMEPs"],"lang":"en","format":"text"}'curl --request GET \
--url 'https://youtube-transcript27.p.rapidapi.com/api/transcript?id=dQw4w9WgXcQ&lang=en&format=segments' \
--header 'x-rapidapi-host: youtube-transcript27.p.rapidapi.com' \
--header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY'curl --request GET \
--url 'https://youtube-transcript27.p.rapidapi.com/api/transcript?id=dQw4w9WgXcQ&lang=en&format=text' \
--header 'x-rapidapi-host: youtube-transcript27.p.rapidapi.com' \
--header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY'curl --request GET \
--url 'https://youtube-transcript27.p.rapidapi.com/api/metadata?id=dQw4w9WgXcQ' \
--header 'x-rapidapi-host: youtube-transcript27.p.rapidapi.com' \
--header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY'curl --request GET \
--url 'https://youtube-transcript27.p.rapidapi.com/api/languages?id=dQw4w9WgXcQ' \
--header 'x-rapidapi-host: youtube-transcript27.p.rapidapi.com' \
--header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY'Errors
The API returns structured error codes instead of empty successful responses when captions are unavailable, a language is missing, a video is restricted, or YouTube blocks server-side access. Use /api/languages before transcript requests when your workflow requires a specific language.
{
"success": false,
"error": {
"code": "missing_api_key",
"message": "Missing API key"
},
"requestId": "..."
}{
"success": false,
"error": {
"code": "invalid_api_key",
"message": "Invalid API key"
},
"requestId": "..."
}{
"success": false,
"error": {
"code": "invalid_request",
"message": "Invalid request parameters"
},
"requestId": "..."
}{
"success": false,
"error": {
"code": "invalid_video_id",
"message": "Invalid YouTube video ID"
},
"requestId": "..."
}{
"success": false,
"error": {
"code": "language_not_available",
"message": "Requested language is not available"
},
"requestId": "..."
}{
"success": false,
"error": {
"code": "private_or_restricted",
"message": "Video is private or restricted"
},
"requestId": "..."
}{
"success": false,
"error": {
"code": "transcript_not_found",
"message": "Transcript is not available for this video"
},
"requestId": "..."
}{
"success": false,
"error": {
"code": "youtube_transcript_error",
"message": "YouTube transcript fetch failed"
},
"requestId": "..."
}{
"success": false,
"error": {
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded"
},
"requestId": "..."
}{
"success": false,
"error": {
"code": "redis_unavailable",
"message": "Redis is not configured correctly"
},
"requestId": "..."
}Reliability
Transcript extraction uses cache, YouTube transcript extraction, yt-dlp fallback, cookies, and optional proxy routing. Some videos may still fail if captions are disabled, the requested language is unavailable, the video is private/restricted, or YouTube blocks server-side access.
Successful transcript responses include cache metadata and source metadata so callers can inspect freshness, provider, requested language, returned language, and whether the returned track is auto-generated when known.
Recommended production pattern: call /api/languages first for unknown videos, request format=segments when timestamps matter, and use format=text for summarization-only workflows.