DEV Community

Get Anything
Get Anything

Posted on

Get any YouTube video's transcript as clean text for your LLM (no API key)

Feeding a YouTube video to an LLM starts with one thing: the transcript. Here's how to get it as clean, token-efficient text for summarization, Q&A, or a RAG knowledge base — without the YouTube Data API or any key.

Why not the official API?

The YouTube Data API doesn't return caption text without OAuth and extra hoops, and it has quotas. For transcripts, the captions track is public for most videos — you just fetch and clean it.

What you want out

  • The full transcript as plain text and as Markdown
  • Cleaned for LLMs: HTML entities decoded, newlines collapsed
  • Metadata (title, channel, duration) as a bonus
  • Works with auto-generated captions, falls back across languages

The easy way

The YouTube Transcript Scraper does exactly this. Give it video URLs and it returns pre-cleaned transcript and markdown fields, only charging for videos that actually have captions.

{ "videoUrls": ["https://www.youtube.com/watch?v=..."], "language": "en" }
Enter fullscreen mode Exit fullscreen mode

Pipe the markdown straight into your model:

import requests
items = requests.get("https://api.apify.com/v2/datasets/<DATASET_ID>/items?format=json").json()
context = items[0]["markdown"]
Enter fullscreen mode Exit fullscreen mode

Use cases

  • Summarize long talks and lectures in one prompt
  • Q&A over videos — chunk the transcript into a vector DB
  • Repurpose a video into a blog post or thread
  • Build a searchable archive of a channel

Connect it to Claude or ChatGPT

Every Apify actor is callable over MCP. Point Claude Desktop at https://mcp.apify.com and ask it to get a video's transcript and summarize it. Guide: Connect Apify actors to Claude & ChatGPT.

Try it: YouTube Transcript Scraper. Public captions only — respect creators' rights.

Top comments (0)