YouTube Transcript (RAG-ready)
Pricing
$5.00 / 1,000 transcripts
YouTube Transcript (RAG-ready)
YouTube transcripts for LLM, RAG and AI agents: videos, playlists and channels, split by chapter in Markdown with token counts. Pay only for transcripts returned — failed videos are free.
Pricing
$5.00 / 1,000 transcripts
Rating
0.0
(0)
Developer
xiao liang
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
Get clean transcripts from YouTube videos, playlists and channels — already split by chapter, in Markdown, with token counts. Built for people feeding YouTube into LLMs, RAG pipelines and AI agents.
You only pay for transcripts that are actually returned. Videos without captions, private or deleted videos are reported but never charged.
What you get for each video
| Field | Description |
|---|---|
status | ok, no_captions, unavailable or error |
language, is_generated | Caption language and whether it is auto-generated |
segments | [{start, dur, text}] with timestamps in seconds |
plain_text | Full transcript as one string |
markdown_by_chapter | # Title + ## Chapter sections — ready for chunking |
token_count | Tokens (cl100k_base), so you can budget LLM calls |
meta | Title, channel, duration, upload date, view count, chapters |
Input
- Videos, playlists or channels — any mix of video URLs, 11-character IDs, playlist URLs or channel URLs (
https://www.youtube.com/@handle). - Preferred languages — e.g.
["en", "de"]. Falls back to any available language. - Max videos per playlist/channel — latest N videos.
- Include metadata and chapters — on by default.
- Bypass cache — results are cached for 7 days; turn this on to always fetch fresh.
{"videos": ["https://www.youtube.com/watch?v=kCc8FmEb1nY", "https://www.youtube.com/@3blue1brown"],"languages": ["en"],"maxPerSource": 20}
Example output
{"video_id": "aircAruvnKk","status": "ok","language": "en","is_generated": false,"token_count": 3817,"markdown_by_chapter": "# But what is a neural network? | Deep learning chapter 1\n\n## Introduction example\n\n...","meta": {"title": "But what is a neural network? | Deep learning chapter 1", "channel": "3Blue1Brown", "chapters": [{"title": "Introduction example", "start": 0}]}}
Why this Actor
- Chapter-aware Markdown —
markdown_by_chapterfollows the video's own chapters, so chunks for RAG keep their meaning. - Token counts included — budget LLM calls before you send anything.
- No charge for failures — no captions, private or deleted videos are returned with a status and are free.
- Videos, playlists and channels in one input; preferred language with automatic fallback.
Use it from code, n8n or an AI agent
Full runnable examples (LangChain, LlamaIndex, MCP, Python, JS): github.com/1359484419/youtube-transcript-rag-examples
Python
from apify_client import ApifyClientclient = ApifyClient("<YOUR_APIFY_TOKEN>")run = client.actor("xiaoliang527/youtube-transcript-rag").call(run_input={"videos": ["https://www.youtube.com/watch?v=aircAruvnKk"], "languages": ["en"]})for item in client.dataset(run["defaultDatasetId"]).iterate_items():if item["status"] == "ok":print(item["meta"]["title"], item["token_count"])
JavaScript / TypeScript
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: process.env.APIFY_TOKEN });const run = await client.actor('xiaoliang527/youtube-transcript-rag').call({videos: ['https://www.youtube.com/@3blue1brown'], maxPerSource: 10,});const { items } = await client.dataset(run.defaultDatasetId).listItems();
LangChain (RAG)
from langchain_apify import ApifyDatasetLoader # pip install langchain-apifyfrom langchain_core.documents import Documentfrom apify_client import ApifyClientrun = ApifyClient("<YOUR_APIFY_TOKEN>").actor("xiaoliang527/youtube-transcript-rag").call(run_input={"videos": ["https://www.youtube.com/watch?v=kCc8FmEb1nY"]})docs = ApifyDatasetLoader(dataset_id=run["defaultDatasetId"],apify_token="<YOUR_APIFY_TOKEN>",dataset_mapping_function=lambda i: Document(page_content=i.get("markdown_by_chapter", ""),metadata={"video_id": i["video_id"], "title": (i.get("meta") or {}).get("title")}),).load()# split by "## " headings and index into your vector store
Claude, Cursor and other MCP clients
Add the Apify MCP server and enable this Actor as a tool:
{"mcpServers": {"apify": {"url": "https://mcp.apify.com?tools=xiaoliang527/youtube-transcript-rag","headers": { "Authorization": "Bearer <YOUR_APIFY_TOKEN>" }}}}
Then ask: "Summarize the chapters of https://youtu.be/aircAruvnKk".
n8n / Make / Zapier
Use the official Apify node or app → Run Actor → xiaoliang527/youtube-transcript-rag → Get dataset items.
Pricing
$0.005 per transcript returned ($5 per 1,000). Nothing is charged for videos without captions, private, deleted or invalid videos. Results are cached for 7 days, so re-running the same video returns instantly.
FAQ
Does it work for auto-generated captions? Yes — is_generated tells you which kind you got.
Can I choose the language? Pass languages in order of preference, e.g. ["de", "en"]. If none is available, the first available language is returned.
Shorts and live replays? Supported when they have captions.
Reliability
Every day a regression set of real videos runs against the live Actor; failures by type (blocked, no captions, unavailable) are tracked so breakages are fixed fast.
Limits
Only public captions are returned. The Actor does not download audio or video, does not transcribe audio, and does not access private, members-only or age-restricted content.