← yTranscript

YouTube Transcript API

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.

Your IPs stay clean

Open-source libraries get your servers blocked. With us, YouTube's bot detection becomes our problem, not yours — and failed requests are never charged.

Captionless videos work

Videos with no captions fall back to Whisper speech-to-text automatically. One endpoint, every video.

Simple JSON

Timestamped segments with language detection, plus video metadata on request. No XML scraping, no player-response parsing.

Quickstart

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 },
    ...
  ]
}

Use it from Claude, Cursor, and VS Code

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

Client libraries

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.

Reference

GET /api/v1/transcript
ParameterTypeDescription
videoIdstring11-character YouTube video ID
urlstringFull YouTube URL (alternative to videoId)
langstring, optionalPreferred language code (e.g. en, es). Defaults to the video's source language.
metadataboolean, optionalSet 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_unitsinteger, optionalThe 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.
Transcript response fields
video_idThe 11-character video ID.
langLanguage code of the transcript returned, such as en.
whispertrue when the video has no captions and was transcribed with AI.
cachedtrue when served from our cache (a repeat request within 24 hours).
units_chargedUnits this request cost.
audio_secondsOnly on a live AI transcription: the audio length the charge is based on.
segmentsArray of { text, offset, duration }. offset and duration are in milliseconds.
metadataOnly with metadata=true: the /api/v1/video fields, or null if they could not be read.
GET /api/v1/video

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:

  • X-Quota-Limit: Your plan's monthly units.
  • X-Quota-Used: Units used this month, including this request.
  • X-RateLimit-Remaining: Requests left in the current minute.
  • X-TopUp-Units-Remaining: Top-up units left. Sent once the monthly units are used up and requests draw on top-up units.
  • Retry-After: On 503: seconds to wait before retrying.

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

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
  }
}
StatusCodeMeaning
400bad_requestNo 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.
401unauthorizedThe API key is missing, invalid or revoked.
402quota_exceededThe 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.
404no_transcriptTranscript: the video has no transcript we can get. It may be private, removed or age-restricted, or have no speech.
404not_foundVideo info: the video is private, removed or doesn't exist.
422max_units_exceededThe 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.
429rate_limitedToo many requests this minute for your plan. Retry after retry_after_seconds. Extra fields: retry_after_seconds.
500fetch_failedFetching from YouTube failed unexpectedly. Retry.
503temporarily_unavailableYouTube is temporarily blocking our servers. The video isn't missing: retry after the Retry-After header. Extra fields: retry_after_seconds.

Pricing

Free

$0/mo
  • 50 units / month
  • 10 requests / minute
  • Whisper fallback included
  • No card required

Starter

$9/mo
  • 1,000 units / month
  • 30 requests / minute
  • Whisper fallback included
  • Cancel anytime

Developer

$29/mo
  • 10,000 units / month
  • 60 requests / minute
  • Whisper fallback included
  • Email support

Scale

$79/mo
  • 50,000 units / month
  • 300 requests / minute
  • Whisper fallback included
  • Priority support

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.

Your API keys

Checking your account…

YouTube Transcript API - Free Tier, No Card Required