Reliable transcript extraction over a simple REST endpoint. We handle YouTube's bot detection, IP rotation, and captionless videos (Whisper fallback) — you just call an API that works. The same key returns video metadata: title, views, chapters and more. Start free, no card required.
Open-source libraries get your servers blocked. With us, YouTube's bot detection becomes our problem, not yours — and failed requests are never charged.
Videos with no captions fall back to Whisper speech-to-text automatically. One endpoint, every video.
Timestamped segments with language detection, plus video metadata on request. No XML scraping, no player-response parsing.
curl "https://ytranscript.com/api/v1/transcript?videoId=dQw4w9WgXcQ" \ -H "Authorization: Bearer yk_live_YOUR_KEY"
{
"video_id": "dQw4w9WgXcQ",
"lang": "en",
"whisper": false,
"cached": false,
"units_charged": 1,
"segments": [
{ "text": "We're no strangers to love", "offset": 18800, "duration": 3600 },
...
]
}Our MCP server gives your AI assistant two tools: get_transcript and get_video_info. Ask it to summarize a video, find where a topic comes up, translate what was said, or check a video's length and chapters first. It works with any plan, including Free. Claude Code:
claude mcp add ytranscript -e YTRANSCRIPT_API_KEY=yk_live_YOUR_KEY -- npx -y ytranscript-mcp
Claude Desktop and Cursor use this config. VS Code uses the same entry under "servers":
{
"mcpServers": {
"ytranscript": {
"command": "npx",
"args": ["-y", "ytranscript-mcp"],
"env": { "YTRANSCRIPT_API_KEY": "yk_live_YOUR_KEY" }
}
}
}Setup for every client: GitHub · npm
JavaScript and TypeScript: ytranscript-api. Fully typed, and a failed request throws a YTranscriptError with the error code.
npm install ytranscript-api
import { YTranscript } from "ytranscript-api";
const yt = new YTranscript(process.env.YTRANSCRIPT_API_KEY);
const t = await yt.transcript("dQw4w9WgXcQ", { maxUnits: 15 });
console.log(t.text);No code at all: the YouTube Transcript Scraper on Apify runs the same API in bulk, paid per result, with no yTranscript account needed.
| Parameter | Type | Description |
|---|---|---|
| videoId | string | 11-character YouTube video ID |
| url | string | Full YouTube URL (alternative to videoId) |
| lang | string, optional | Preferred language code (e.g. en, es). Defaults to the video's source language. |
| metadata | boolean, optional | Set to true to add a metadata object (the fields of /api/v1/video) at no extra cost. It is null if the metadata can't be read; the transcript is still returned. |
| max_units | integer, optional | The most this request may cost. If the video has no captions and AI transcription would cost more, you get 422 max_units_exceeded with the estimate and nothing is charged. Use max_units=1 for captions only. |
| video_id | The 11-character video ID. |
| lang | Language code of the transcript returned, such as en. |
| whisper | true when the video has no captions and was transcribed with AI. |
| cached | true when served from our cache (a repeat request within 24 hours). |
| units_charged | Units this request cost. |
| audio_seconds | Only on a live AI transcription: the audio length the charge is based on. |
| segments | Array of { text, offset, duration }. offset and duration are in milliseconds. |
| metadata | Only with metadata=true: the /api/v1/video fields, or null if they could not be read. |
Metadata for one video: title, description, duration, views, likes, publish date, channel, tags, category, chapters and thumbnails. Takes videoId or url, like the transcript endpoint.
curl "https://ytranscript.com/api/v1/video?videoId=dQw4w9WgXcQ" \ -H "Authorization: Bearer yk_live_YOUR_KEY"
{
"video_id": "dQw4w9WgXcQ",
"title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
"description": "The official video for ...",
"duration_seconds": 213,
"view_count": 1836735032,
"like_count": 19502415,
"published_at": "2009-10-24T23:57:33-07:00",
"channel": {
"id": "UCuAXFkgsw1L7xaCfnd5JJOw",
"name": "Rick Astley",
"handle": "@RickAstleyYT",
"url": "https://www.youtube.com/@RickAstleyYT",
"subscriber_count": 4560000
},
"tags": ["rick astley", "never gonna give you up", ...],
"category": "Music",
"chapters": [{ "title": "Intro", "start_seconds": 0 }, ...],
"thumbnails": [{ "url": "https://i.ytimg.com/vi/...", "width": 480, "height": 360 }, ...],
"is_live": false,
"cached": false,
"units_charged": 1
}duration_seconds, tags and category can be null, and published_at can be a date without a time, when YouTube limits what it shows our servers. Counts are YouTube's own; subscriber_count is rounded the way YouTube displays it.
Units: caption transcripts cost 1 unit. AI transcription (videos with no captions) costs 1 unit per minute of audio, with a minimum of 5; the response reports units_charged and audio_seconds. Video metadata costs 1 unit, or nothing extra when you ask for it with a transcript (metadata=true). Failed requests cost nothing.
No surprise charges: a repeat request for the same video within 24 hours costs 1 unit, even if the first one needed AI transcription, and max_units lets you set the most a request may cost before any AI transcription starts.
Price lock: the price you sign up at is yours for as long as you stay subscribed. If our prices change, yours can only go down. Accounts with an API key created on or before November 16, 2026 never pay more than 15 units for an AI transcript, however long the video.
Timing: caption transcripts usually return in 2 to 3 seconds. AI transcriptions download the audio first and can take several minutes on long videos, so use a client timeout of at least 300 seconds.
Headers:
Reliability: extraction is an arms race with YouTube — success rates are high but not absolute, which is why failed requests never consume quota. We run multi-strategy fallbacks (edge, direct, residential, AI transcription) so your code only ever sees one endpoint.
Errors use the HTTP status below and a JSON body with a stable code to branch on, a readable message, and sometimes extra fields. Failed requests are never charged.
{
"error": {
"code": "max_units_exceeded",
"message": "This video has no captions, so it needs AI transcription, which would cost about 9 units. ...",
"max_units": 5,
"estimated_units": 9
}
}| Status | Code | Meaning |
|---|---|---|
| 400 | bad_request | No videoId or url, a value that isn't a YouTube video, or a max_units that isn't a whole number of 1 or more. |
| 401 | unauthorized | The API key is missing, invalid or revoked. |
| 402 | quota_exceeded | The monthly units are used up and there are no top-up units. Upgrade, buy a top-up pack, or wait for the monthly reset (UTC). Extra fields: quota, used, top_up_units. |
| 404 | no_transcript | Transcript: the video has no transcript we can get. It may be private, removed or age-restricted, or have no speech. |
| 404 | not_found | Video info: the video is private, removed or doesn't exist. |
| 422 | max_units_exceeded | The video has no captions and AI transcription would cost more than max_units. Nothing was transcribed. estimated_units is null when the length could not be read. Extra fields: max_units, estimated_units. |
| 429 | rate_limited | Too many requests this minute for your plan. Retry after retry_after_seconds. Extra fields: retry_after_seconds. |
| 500 | fetch_failed | Fetching from YouTube failed unexpectedly. Retry. |
| 503 | temporarily_unavailable | YouTube is temporarily blocking our servers. The video isn't missing: retry after the Retry-After header. Extra fields: retry_after_seconds. |
Need more without a subscription? Pay-as-you-go packs start at $10 for 1,000 units and never expire. Buy them from your dashboard below after signing in.
Checking your account…