DEV Community

pantdeepakk5
pantdeepakk5

Posted on

Get YouTube Transcripts Programmatically: A Free, Step-by-Step Developer Guide

There's no official YouTube transcript API. If you've ever needed a video's spoken text - for a RAG pipeline, a content research tool, an AI agent, or just to skim a 40-minute talk in 30 seconds - you've probably hit that wall.

Here's the free, step-by-step way to do it, with real requests you can run right now.

1. Get a free API key (no card required)

Sign up at getyoutubetranscript.com (Google sign-in) and grab a key from your dashboard, or provision one straight from a script/agent with no browser at all:

# Step 1: request a one-time code
curl -X POST https://www.getyoutubetranscript.com/api/v1/signup \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com"}'

# Step 2: verify it, get your key back
curl -X POST https://www.getyoutubetranscript.com/api/v1/signup/verify \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com", "otp": "123456"}'
# => { "success": true, "api_key": "sk_live_..." }
Enter fullscreen mode Exit fullscreen mode

Either way you land with 100 free credits, 1 credit = 1 request, no expiry countdown, no card on file.

2. Fetch a transcript

curl "https://www.getyoutubetranscript.com/api/v1/transcript?v=dQw4w9WgXcQ" \
  -H "Authorization: Bearer sk_live_xxxxxxxxxxxx"
Enter fullscreen mode Exit fullscreen mode
{
  "success": true,
  "data": {
    "video_id": "dQw4w9WgXcQ",
    "language_code": "en",
    "title": "...",
    "author_name": "...",
    "transcript": "We're no strangers to love...",
    "word_count": 1842
  }
}
Enter fullscreen mode Exit fullscreen mode

v takes a raw video ID or a full URL - whichever's easier to pass around. Same call in Node:

const res = await fetch(
  'https://www.getyoutubetranscript.com/api/v1/transcript?v=dQw4w9WgXcQ',
  { headers: { Authorization: `Bearer ${process.env.YT_API_KEY}` } }
);
const { data } = await res.json();
console.log(data.transcript);
Enter fullscreen mode Exit fullscreen mode

and Python:

import requests

res = requests.get(
    "https://www.getyoutubetranscript.com/api/v1/transcript",
    params={"v": "dQw4w9WgXcQ"},
    headers={"Authorization": f"Bearer {API_KEY}"},
)
print(res.json()["data"]["transcript"])
Enter fullscreen mode Exit fullscreen mode

3. Search YouTube itself

Same key, a different endpoint - useful when you don't have a video ID yet:

curl "https://www.getyoutubetranscript.com/api/v1/search?q=rust+async&type=video&limit=10" \
  -H "Authorization: Bearer sk_live_xxxxxxxxxxxx"
Enter fullscreen mode Exit fullscreen mode

Returns video_results (title, link, videoId, channel, views, published_date, description) or, with type=channel, matching channels instead. Pass the response's continuation_token back as page_token to page through more results.

4. Pull a whole channel

Two ways depending on whether a human or a script is driving:

No code, no signup: /youtube-channel-transcripts - paste a channel URL/@handle, pick up to 10 videos, download every transcript as one .txt. Free, capped at 10 per batch since it's proxying real scraping cost with no account behind it.

Scripted / more than 10: the same metered API, uncapped.

# List a channel's uploaded videos, paginated
curl "https://www.getyoutubetranscript.com/api/v1/channel/videos?channel=@channelname" \
  -H "Authorization: Bearer sk_live_xxxxxxxxxxxx"
Enter fullscreen mode Exit fullscreen mode
{
  "success": true,
  "data": {
    "videos": [
      { "id": "abc123", "title": "...", "length": "10:37", "published_time": "3 days ago" }
    ],
    "has_more": true,
    "continuation_token": "opaque-token-pass-this-back-for-the-next-page"
  }
}
Enter fullscreen mode Exit fullscreen mode

Loop video_ids through /api/v1/transcript and you've got a full-channel export. There's also /api/v1/channel/search (search inside one channel) and a free /api/v1/channel/latest for the home-tab upload shelf.

5. Whole playlists

/api/v1/playlist?list=<playlist_id> works the same way - paginated, same continuation_token convention, one call per page.

6. Bonus: skip the code entirely, give it to an AI agent

All of the above is also exposed as an MCP server (https://www.getyoutubetranscript.com/api/mcp), so Claude, Cursor, or any MCP-compatible client can call these tools directly instead of you writing the fetch calls. It supports both a plain API key and full OAuth 2.1 (dynamic client registration), so a client can connect without you ever pasting a secret into it. Example prompt once connected: "search this channel's videos for anything about pricing and summarize what they said."

Rate limits & what's next

Free tier: 60 requests/min, 100 credits total. Once you outgrow that, it's $5/month for 1,000 credits (or $4.50/mo billed annually), 200-300 req/min depending on plan - no feature gating, the full API is available from the free tier on.

Docs: getyoutubetranscript.com/docs
MCP + skill repos: github.com/tubeagentkit

If you build something with this, I'd genuinely like to see it - drop a comment.

Top comments (0)