youtube-transcript.ai

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. It runs on our servers, so there is nothing to install and no YouTube blocking to work around.

https://youtube-transcript.ai/transcript/VIDEO_ID.txt?key=YOUR_KEY

Replace VIDEO_ID with the 11-character ID from a YouTube link and YOUR_KEY with your free API key. Create one here: sign in with Google, 10 requests a day free.

Building with ChatGPT, Claude or Cursor? Copy the instructions and paste them into your chat. The assistant gets the endpoint, the auth and the error handling in one go.

Or hand it over directly: open in ChatGPT · open in Claude · view as plain text

Free to start

A free API key covers 10 transcripts a day. Pro is 1,000 a day for $120 a year, on the same key and the same URL.

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.

Any language

Add lang=es, lang=ja or any other caption language to the URL. Leave it out and you get the default track, human-written captions before auto-generated ones.

Made for LLMs

The response is one Markdown document: title, source link, then the transcript in short timestamped paragraphs. Paste it into a prompt as it is. No JSON to unpack.

What comes back

Plain UTF-8 Markdown (text/markdown). A short header, then the transcript:

# 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...

Get your API key

Every request needs a key. Create a free key (Google sign-in, about a minute), then send it as an Authorization: Bearer header, or as ?key= in the URL for tools that only take a URL.

Use it in Python

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)

Use it in JavaScript

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())

Use it in n8n

  1. Add an HTTP Request node and set Method to GET.
  2. Set URL to https://youtube-transcript.ai/transcript/{{ $json.videoId }}.txt, using whichever field holds the video ID in your workflow.
  3. Turn on Send Headers and add a header named Authorization with the value Bearer YOUR_KEY.
  4. Under Options, set Response Format to Text. The transcript arrives in the data field, ready for an AI node.

Use it in Make

  1. Add the HTTP app and choose Make a request.
  2. Set URL to https://youtube-transcript.ai/transcript/VIDEO_ID.txt with your video ID mapped in, and Method to GET.
  3. Add a header named Authorization with the value Bearer YOUR_KEY.
  4. Leave Parse response off. The transcript is the text of the response body.

From the command line

curl -H "Authorization: Bearer YOUR_KEY" \
  "https://youtube-transcript.ai/transcript/dQw4w9WgXcQ.txt?lang=en"

Limits

Using Claude or ChatGPT instead?

You do not need to write code. Connect the YouTube Transcript MCP server with the same key and ask your assistant about any video.

Need every parameter?

The API reference lists the query parameters, the full response format and the error cases.