YouTube Transcript API clients (JavaScript, Python) and examples for TranscriptYT — transcripts as JSON, text, SRT, VTT in 150+ languages

TranscriptYT: YouTube Transcript API clients and examples

Official JavaScript and Python clients for the TranscriptYT YouTube Transcript API, plus examples.

Get the transcript of any public YouTube video as timestamped JSON, plain text, SRT, VTT, CSV, or Markdown, in 150+ languages. Videos without captions are transcribed with AI. Free tier: 100 transcripts, no card. Get an API key →

JavaScript / TypeScript

npm install transcriptyt
import { TranscriptYT } from "transcriptyt";

const client = new TranscriptYT({ apiKey: process.env.TRANSCRIPTYT_API_KEY });
const transcript = await client.getTranscript("https://youtu.be/dQw4w9WgXcQ");
console.log(transcript.title, transcript.segments.length);

const srt = await client.getTranscript("dQw4w9WgXcQ", { format: "srt" });

See js/README.md.

Python

pip install transcriptyt
from transcriptyt import TranscriptYT

client = TranscriptYT()  # reads TRANSCRIPTYT_API_KEY
transcript = client.get_transcript("https://youtu.be/dQw4w9WgXcQ")
print(transcript["title"], len(transcript["segments"]))

srt = client.get_transcript("dQw4w9WgXcQ", format="srt")

See python/README.md.

cURL

curl "https://transcript-yt.com/v1/transcript?url=dQw4w9WgXcQ&format=text" \
  -H "Authorization: Bearer $TRANSCRIPTYT_API_KEY"

Use it from an AI agent (MCP)

claude mcp add --transport http transcriptyt https://transcript-yt.com/mcp \
  --header "Authorization: Bearer $TRANSCRIPTYT_API_KEY"

Then paste a YouTube link into the chat. Setup for Cline, Cursor, and other clients: llms-install.md and the docs. Also on the official MCP Registry as io.github.rajdeep-automation/transcriptyt.

Examples

  • examples/summarize.py: summarize a video with Claude
  • examples/rag_langchain.py: load videos into LangChain documents with timestamp links
  • examples/download_subtitles.mjs: save SRT files for a list of videos

Errors

Errors raise TranscriptYTError with status and code. Retry BLOCKED, RATE_LIMITED, and UPSTREAM_ERROR with backoff; VIDEO_UNAVAILABLE, NO_CAPTIONS, and LANGUAGE_NOT_AVAILABLE are final; QUOTA_EXCEEDED (HTTP 402) means you're out of credits. Failed requests are never billed. Full list.

License

MIT

MCP Server · Populars

MCP Server · New

    PanStudio

    ZulipChat MCP Server

    ZulipChat MCP Server - A Model Context Protocol server that bridges AI agents with Zulip Chat. Built with FastMCP for lightning-fast performance, featuring comprehensive chat management and intelligent summarization. Transform your Zulip workspace into an AI-powered collaboration hub!

    Community PanStudio
    United-Compute

    GPU Price Tracker: open data

    This project tracks the market prices and performance metrics of various GPUs.

    Community United-Compute
    Graphify-Labs

    graphify

    Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local deterministic AST parsing, every edge explained, no vector store.

    Community Graphify-Labs
    superdesigndev

    Treg (OpenRouter for Tools)

    OpenRouter for agent tools. Join community here: https://discord.gg/6mQYYfFMAn

    Community superdesigndev