API reference
YouTube Transcript API
The simplest YouTube transcript API there is: add .txt to a video ID, send your API key, and get the full transcript back as a clean, readable document. The key is free for 10 requests a day. No SDK: one HTTPS request you can run from cURL or any language.
Quick start
First, create your free API key. It takes a Google sign-in and about a minute.
Then take the 11-character video ID and request this URL with the key:
https://youtube-transcript.ai/transcript/{VIDEO_ID}.txt
That's the whole API. For youtube.com/watch?v=dQw4w9WgXcQ the ID is dQw4w9WgXcQ, so:
curl -H "Authorization: Bearer YOUR_KEY" \
https://youtube-transcript.ai/transcript/dQw4w9WgXcQ.txtSetting this up in a tool? The API quick start has copy-paste steps for Python, JavaScript, n8n and Make.
Authentication
Every request needs your API key. Send it in either of two ways:
| Where | Example |
|---|---|
| Header | Authorization: Bearer YOUR_KEY |
| Query string | /transcript/{VIDEO_ID}.txt?key=YOUR_KEY |
The query string form is for tools that can only take a URL. Each response carries X-RateLimit-Limit and X-RateLimit-Remaining for today's quota. A missing or unknown key returns 401; a used-up quota returns 429 with Retry-After.
Endpoint reference
| Method | Endpoint | Returns |
|---|---|---|
| GET | /transcript/{VIDEO_ID}.txt |
Full transcript as a clean, timestamped Markdown document. |
Query parameters
| Parameter | Endpoint | Description |
|---|---|---|
key |
/transcript/{VIDEO_ID}.txt |
Your API key, if you are not sending it in the Authorization header. |
lang |
/transcript/{VIDEO_ID}.txt |
Optional. A YouTube language code such as en, es, or zh-Hant. Falls back to a human-uploaded track, then the auto-generated track. |
curl -H "Authorization: Bearer YOUR_KEY" \
"https://youtube-transcript.ai/transcript/dQw4w9WgXcQ.txt?lang=en"Response format
Content type is text/markdown; charset=utf-8. A short metadata header (title, source URL, language, duration, word count, and the other available caption languages) is followed by the transcript, grouped into short paragraphs with [m:ss] timestamps:
# Transcript: Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)
Source video: https://www.youtube.com/watch?v=dQw4w9WgXcQ
Language: en · Duration: 3:27 · Words: 481
Other available languages: a-en (en) [auto], de-DE (de-DE), ja (ja), pt-BR (pt-BR), es-419 (es-419)
To request a specific language: https://youtube-transcript.ai/transcript/dQw4w9WgXcQ.txt?lang=LANG_CODE
[0:00] We're no strangers to love. You know the rules and so do I...
[0:19] I just wanna tell you how I'm feeling. Gotta make you understand...The output is Markdown, so it renders cleanly in chats, docs, and agents while staying readable as plain text.
Code examples
JavaScript (fetch)
const id = 'dQw4w9WgXcQ'
const res = await fetch(`https://youtube-transcript.ai/transcript/${id}.txt`, {
headers: { Authorization: 'Bearer YOUR_KEY' },
})
const transcript = await res.text()
console.log(transcript)Python (requests)
import requests
video_id = "dQw4w9WgXcQ"
url = f"https://youtube-transcript.ai/transcript/{video_id}.txt"
transcript = requests.get(url, headers={"Authorization": "Bearer YOUR_KEY"}).text
print(transcript)Shell (cURL)
curl -s -H "Authorization: Bearer YOUR_KEY" \
"https://youtube-transcript.ai/transcript/dQw4w9WgXcQ.txt"Why this YouTube transcript API is the fastest path
- One request, one key. No OAuth flow, no SDK install. The video ID and your key are the request.
- Edge-cached for 24 hours. Responses are served from Cloudflare's global edge; repeat calls for the same video and language return in milliseconds.
- Agent- and LLM-friendly. The
.txtpath makes the response a readable document, so agents and pipelines can drop it straight into a prompt — no JSON parsing, no headless browser. - Open CORS. Call it straight from front-end JavaScript without a proxy.
- Clean, structured output. Caption cues are merged into readable paragraphs with light timestamps and a metadata header — ready to drop into a prompt, a summary pipeline, or a document.
Pricing & limits
Free
- 10 requests a day
- All videos with captions, all languages
- For trying the API and occasional use
Pro
- 1,000 requests a day
- Same endpoint, same key
- For scripts, agents and pipelines that run every day
Both plans use the same key. Create your key to start on Free, and upgrade from the same page. Every request counts as one, including repeats of the same video; the quota resets at 00:00 UTC. Need more than 1,000 a day? Email hello@youtube-transcript.ai.
FAQ
Is the YouTube transcript API free?
Yes, up to 10 requests a day with a free API key. The Pro plan raises that to 1,000 a day for $120 a year.
Do I need an API key or SDK?
You need a free API key and no SDK. Create the key, then make a plain HTTPS GET request to /transcript/{VIDEO_ID}.txt with Authorization: Bearer YOUR_KEY from any client or language.
What does it return?
UTF-8 Markdown (text/markdown): a metadata header (title, source, language, duration, word count, available languages), then the transcript in short paragraphs with [m:ss] timestamps. Still fully readable as plain text. CORS is open.
Can I pick the caption language?
Yes — add ?lang=en (or any YouTube language code). It falls back to a human-uploaded track, then the auto-generated one.
Which videos work?
Any public video that has captions — either creator-uploaded or YouTube auto-generated. Private, members-only, or caption-disabled videos can't be transcribed.
Does the transcript include timestamps?
Yes — the .txt endpoint groups the transcript into short paragraphs, each prefixed with an [m:ss] timestamp.
Start with a free key
10 requests a day, no card. Upgrade on the same key when you need more.