REST API
YouTube Transcript API for Python, n8n and AI agents
Send one GET request with a video ID and your key. You get the full transcript back as clean Markdown, with timestamps and the video title. Nothing to install, no YouTube blocking to work around.
- A transcript in about 1.4 seconds
- Up to 5,000 videos a day
- 10 free requests a day
- No SDK, one HTTPS request
curl -H "Authorization: Bearer YOUR_KEY" \ https://youtube-transcript.ai/transcript/dQw4w9WgXcQ.txt
# 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
[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...Quick start
Your first transcript in a minute
Request the URL
Put the 11-character ID from a YouTube link in place of VIDEO_ID, and your key in place of YOUR_KEY.
https://youtube-transcript.ai/transcript/VIDEO_ID.txt?key=YOUR_KEYUse the text
The response body is the transcript as Markdown. Save it, search it or paste it into a prompt as it is.
Examples
Use it from your stack
Send the key as an Authorization: Bearer header, or as ?key= in the URL for tools that only take a URL.
import requests
video_id = "dQw4w9WgXcQ"
r = requests.get(
f"https://youtube-transcript.ai/transcript/{video_id}.txt",
headers={"Authorization": "Bearer YOUR_KEY"},
timeout=60,
)
r.raise_for_status()
print(r.text)const id = 'dQw4w9WgXcQ'
const res = await fetch(`https://youtube-transcript.ai/transcript/${id}.txt`, {
headers: { Authorization: 'Bearer YOUR_KEY' },
})
if (!res.ok) throw new Error(`Transcript request failed: ${res.status}`)
console.log(await res.text())curl -H "Authorization: Bearer YOUR_KEY" \ "https://youtube-transcript.ai/transcript/dQw4w9WgXcQ.txt?lang=en"
- Add an HTTP Request node and set Method to
GET. - Set URL to the value below, using whichever field holds the video ID in your workflow.
- Turn on Send Headers and add a header named
Authorizationwith the valueBearer YOUR_KEY. - Under Options, set Response Format to Text. The transcript arrives in the
datafield, ready for an AI node.
- URL
https://youtube-transcript.ai/transcript/{{ $json.videoId }}.txt- Header
Bearer YOUR_KEY
- Add the HTTP app and choose Make a request.
- Set URL to the value below with your video ID mapped in, and Method to
GET. - Add a header named
Authorizationwith the valueBearer YOUR_KEY. - Leave Parse response off. The transcript is the text of the response body.
- URL
https://youtube-transcript.ai/transcript/VIDEO_ID.txt- Header
Bearer YOUR_KEY
Building with ChatGPT, Claude or Cursor? Copy the instructions into your chat. The assistant gets the endpoint, the auth and the error handling in one go.
Response
What comes back
Plain UTF-8 Markdown (text/markdown): a short header with the title, source and language, then the transcript in short timestamped paragraphs.
# 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
[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...- 200
The transcript.
X-RateLimit-LimitandX-RateLimit-Remainingshow today's quota.- 401
The key is missing or not recognised.
- 429
Today's quota is used up.
Retry-Aftergives the seconds until 00:00 UTC.
Why this API
Built for scripts and agents
Works from servers
Scripts that fetch captions from YouTube directly often get blocked on cloud hosts. Here your code only talks to us, and our fetch pipeline with proxy fallback handles YouTube.
Made for LLMs
One Markdown document: title, source link, then the transcript in short timestamped paragraphs. Paste it into a prompt as it is.
Any language
Add lang=es, lang=ja or any other caption language. Leave it out and you get the default track, human-written captions before auto-generated ones.
Free to start
A free key covers 10 transcripts a day. Pro is 1,000 a day for $120 a year, on the same key and the same URL. Ultra is 5,000 a day for $350.
Pricing
Start free, upgrade when you scale
Every request counts as one, including repeats of the same video. The count resets at 00:00 UTC.
Free
Try the API on a few videos a day
- 10 requests a day
- All videos with captions, all languages
- Google sign-in, no card
Pro Most popular
For scripts and agents that run every day
Everything in Free, plus:
- 1,000 requests a day
- Same key, same URL
SubKun Pro included: AI chat & bilingual subtitles right on YouTube
Ultra
For teams and production pipelines
Everything in Pro, plus:
- 5,000 requests a day
- Up to 3 keys sharing one quota
- Priority email support
FAQ
Common questions
Do I need an SDK?
No. It is one HTTPS GET request, so any HTTP client in any language works.
Do I need the full YouTube link?
Just the 11-character video ID. For youtube.com/watch?v=dQw4w9WgXcQ the ID is dQw4w9WgXcQ.
Which videos work?
Any video with captions, either written by the uploader or auto-generated by YouTube.
Can I pick the caption language?
Yes. Add ?lang= with a language code such as en, es or zh-Hant.
I use Claude or ChatGPT, not code.
Connect the YouTube Transcript MCP server with the same key and ask your assistant about any video.
Where is the full reference?
The API reference lists every parameter, the full response format and the error cases.