TTechAPI

How to get a YouTube transcript with an API (Python, no YouTube API key)

Three ways to get the transcript of a YouTube video as text: one video with a single REST call, whole channels and playlists with a short loop, or straight from your AI assistant. None of them needs a YouTube API key.

Updated 5 December 2026 · TTech Solutions

Why not the official YouTube API?

The official YouTube Data API can list a video's caption tracks, but downloading one (captions.download) needs OAuth and permission to edit the video. So it works for your own videos only, and each download costs 200 of your 10,000 daily quota units.

The open-source youtube-transcript-api library works well on a laptop. On cloud servers (AWS, Google Cloud, Azure) YouTube often blocks it, and you end up buying and rotating proxies yourself. The options below handle that for you.

Option 1: one video from Python

  1. Sign up for free and create an API key in your TTech dashboard.
  2. Send the key in the x-api-key header. Every call goes to https://api.ttechapi.com/v1/youtube plus the endpoint path.
  3. Run the code below with a video id or link.
Python
import requests

BASE = "https://api.ttechapi.com/v1/youtube"
HEADERS = {"x-api-key": "YOUR_API_KEY"}


def get(path, **params):
    data = requests.get(BASE + path, params=params, headers=HEADERS, timeout=60).json()
    if data.get("error"):  # errors come back as JSON with an error code and a message
        raise RuntimeError(f"{data['error']}: {data.get('msg') or data.get('message')}")
    return data


data = get("/get_transcript", id="arj7oStGLkU")   # a video id or link
print(data["selected"])   # language, and isAutoGenerated

segments = data["transcript"]
for seg in segments:
    seg["text"] = seg["text"].replace("\n", " ")   # captions keep their line breaks

text = " ".join(seg["text"] for seg in segments)
print(text[:300])

# With timestamps, so an LLM can cite where it was said
lines = [f"[{seg['startTime']}] {seg['text']}" for seg in segments]
print("\n".join(lines[:5]))
Terminal output of the Python script: the English caption track made by people, the transcript as one plain text, and the first lines with timestamps
Real output of the Python code above, for a TED talk.

The answer, shortened:

GET /get_transcript?id=arj7oStGLkU
{
  "id": "arj7oStGLkU",
  "selected": {"title": "English", "languageCode": "en", "isAutoGenerated": false},
  "transcript": [
    {"startMs": "12645", "endMs": "14015", "startTime": "0:12", "text": "So in college,"},
    {"startMs": "15349", "endMs": "16913", "startTime": "0:15", "text": "I was a government major,"}
  ],
  "languages": [
    {"title": "Arabic", "languageCode": "ar", "isAutoGenerated": false},
    {"title": "Armenian", "languageCode": "hy", "isAutoGenerated": false}
  ]
}
FieldWhat it is
transcriptTimed segments: startMs, endMs, startTime and text
selectedThe caption track you got, and whether YouTube made it automatically
languagesEvery caption language the video has

Want another language? Add lang=es (or any code from languages). A video without captions answers {"error": "NOT_FOUND", "code": "404", "msg": "This video has no captions"}. Each call costs 1 credit.

Option 2: many videos, whole channels or playlists

List a channel's videos with GET /channel/videos (30 a page) or a playlist with GET /playlist (100 a page). Then ask GET /get_transcript for each video. A video without captions answers an error, so the loop skips it.

Python: transcripts of a channel
import requests

BASE = "https://api.ttechapi.com/v1/youtube"
HEADERS = {"x-api-key": "YOUR_API_KEY"}


def get(path, **params):
    data = requests.get(BASE + path, params=params, headers=HEADERS, timeout=60).json()
    if data.get("error"):  # errors come back as JSON with an error code and a message
        raise RuntimeError(f"{data['error']}: {data.get('msg') or data.get('message')}")
    return data


page = get("/channel/videos", id="@TED", sort_by="newest")   # an @handle, a channel link or a UC id
for video in page["data"][:20]:   # the 20 newest videos
    try:
        data = get("/get_transcript", id=video["videoId"])
    except RuntimeError as err:   # for example, a video without captions
        print("skipped:", video["title"], err)
        continue
    text = " ".join(seg["text"].replace("\n", " ") for seg in data["transcript"])
    print(video["title"], "-", len(text), "characters")

# The next 30 videos:  get("/channel/videos", token=page["continuation"])
# A playlist instead:  get("/playlist", id="PL...")   100 videos a page

Each page of videos costs 1 credit and each transcript 1 credit, from the same credit balance as every other TTech API.

Option 3: ask your AI assistant

Add the TTech MCP server to Claude, Claude Code, Cursor, Codex, VS Code or ChatGPT. You sign in with your TTech account, so no key goes into the config. Then just ask: "Get the transcript of youtu.be/arj7oStGLkU and summarize it in five bullet points." The assistant calls the youtube_transcript tool.

Run this, then type /mcp in Claude Code and sign in to TTech.

Terminal
claude mcp add --transport http ttech https://mcp.ttechapi.com/mcp

Or install our Claude Code plugin from GitHub. It adds the same server and a YouTube research skill. Then type /mcp and sign in.

Terminal
claude plugin marketplace add ttechapi/claude-plugins
claude plugin install ttech@ttech

To skip the question before each tool call, add "mcp__ttech" to permissions.allow in .claude/settings.json.

Try it with your own account Sign up for free: one account for your API key, your credits and the MCP server.
Sign up for free

FAQ

Does it work for auto-generated captions?

Yes. selected.isAutoGenerated tells you whether YouTube made the captions automatically.

Can it translate a transcript?

No. You get the languages the video really has; ask your LLM to translate the text if you need another one.

What about videos without captions?

They have no transcript to read, so the call answers an error instead.

Do I need a YouTube API key?

No. You need only a TTech API key. There is no Google Cloud project and no YouTube quota.