YouTube transcript API
Code that reads YouTube captions tends to work on your laptop and fail once it is deployed, because YouTube turns away requests from cloud servers.
This YouTube transcript API does the fetching for you. One GET request returns a video's captions as JSON, plain text, SRT or VTT, with the title, channel and every caption language the video has.
100 credits a month are free. See plans.
YouTube transcript API quick start
- Sign in and create a key in your dashboard. It starts with
ytt_. - Send it in the
Authorizationheader.
curl "https://youtubetranscript.tools/api/v1/transcript?video=https://youtu.be/VIDEO_ID" \
-H "Authorization: Bearer ytt_your_key"Get a transcript
GET /api/v1/transcript · 1 credit
| Parameter | What it does |
|---|---|
video | Required. A YouTube link (watch, youtu.be, Shorts, live, embed) or the 11-character video ID. |
lang | Caption language code, such as en or pt-BR. Leave it out to get the language the video is spoken in. Captions written by the owner are preferred over automatic ones. |
format | json (default), text, srt or vtt. |
audio | true to transcribe the audio when the video has no captions: 5 credits per started minute of video, up to 60 minutes. It takes up to a minute or two. Ignored when captions exist. |
timestamps | With format=text only. true gives one [m:ss] line per caption; the default is paragraphs without times. |
JSON response:
{
"video": {
"id": "VIDEO_ID",
"title": "The video's title",
"channel": "Channel name",
"duration_seconds": 960,
"url": "https://www.youtube.com/watch?v=VIDEO_ID"
},
"language": { "code": "en", "name": "English", "auto_generated": false, "source": "captions" },
"available_languages": [
{ "code": "en", "name": "English", "auto_generated": false },
{ "code": "es", "name": "Spanish", "auto_generated": false }
],
"lines": [
{ "text": "First caption line.", "start": 0.0, "duration": 4.0 },
{ "text": "Second caption line.", "start": 4.0, "duration": 3.2 }
],
"credits_charged": 1,
"credits_remaining": 99
}start and duration are in seconds. language.source is captions, or audio when the transcript was made by speech-to-text. Every successful response carries X-Credits-Charged and X-Credits-Remaining headers.
List a playlist or channel
GET /api/v1/list · 1 credit per page of up to 50 videos
| Parameter | What it does |
|---|---|
url | Required. A playlist link or ID, a channel link, a channel ID starting with UC, or an @handle. A channel returns its uploads, newest first. |
page_token | The next_page_token from the previous page. |
{
"videos": [
{ "id": "VIDEO_ID", "title": "Video title", "published_at": "2026-01-01T00:00:00Z" }
],
"next_page_token": "CDIQAA",
"credits_remaining": 98
}next_page_token is null on the last page. Private and deleted videos are left out.
Check your credits
GET /api/v1/account · free
Returns your plan, the monthly limit, credits used and remaining, and the reset date.
Errors
Errors are JSON with a stable code and a readable message. A request that fails is never charged.
{ "error": { "code": "no_captions", "message": "This video has no captions." } }| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_video, invalid_lang, invalid_format, invalid_target, invalid_page_token | A parameter is missing or malformed. |
| 401 | unauthorized, invalid_api_key | No key was sent, or the key is wrong or revoked. |
| 402 | quota_exceeded | This month's credits are used up. |
| 404 | no_captions, lang_unavailable, unavailable, age_restricted, not_found, no_speech, live | The video has no captions (or none in that language), can't be read, has no speech in its audio, is still live, or the playlist or channel doesn't exist. |
| 413 | too_long | Audio transcription was asked for a video over 60 minutes. |
| 410 | removed | The transcript was taken down at the owner's request. |
| 429 | rate_limited | More than 240 requests in a minute. Wait and retry. |
| 503 | temporarily_unavailable | We couldn't reach YouTube. Retry shortly. |
YouTube transcript API questions
Does it work on videos without captions?
Yes, if you ask for it. Add audio=true and a video with no captions is transcribed from its audio by speech-to-text, for 5 credits per minute of video. Without it you get a no_captions error and are not charged. Once a video's audio has been transcribed, anyone can get it for 1 credit like any other transcript.
Is there an MCP server?
Yes. The same account and credits work in Claude, ChatGPT and other AI apps through the YouTube transcript MCP server.
What counts as a credit?
One successful transcript, or one page of a playlist or channel listing. Transcribing audio costs 5 per minute of video. Checking your account is free.