Get the transcript of any YouTube video — and of whole playlists, channels (@handle) or search results — as clean text, timed segments, SRT / VTT subtitles and chapters with their own text. No YouTube API key, no cookies, no proxies to manage.
This repo shows how to call the hosted YouTube Transcript Scraper on Apify from your code. It costs $0.50 per 1,000 transcripts; videos without captions are free.
Libraries that read captions directly work on your laptop but get "Sign in to confirm you're not a bot" as soon as they run on a server (AWS, GCP, Vercel, Docker…). The hosted Actor handles the blocking, retries and parsing for you and also lists playlists, channels and searches.
pip install apify-client
export APIFY_TOKEN=... # free account at apify.com → Settings → API & Integrationsimport os
from apify_client import ApifyClient
client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("tidydata/youtube-transcript-scraper").call(run_input={
"sources": [
"https://www.youtube.com/watch?v=iCvmsMzlF7o", # a video
"@lexfridman", # a channel (newest first)
"how to start a podcast", # a search
],
"maxVideosPerSource": 5,
"languages": ["en"], # optional: preferred caption languages
"includeSrt": True,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
if item["status"] == "ok":
print(item["title"], "-", item["wordCount"], "words")
print(item["transcript"][:300], "…")More: examples/python_basic.py · examples/python_rag_chunks.py (split by chapters for a vector DB) · examples/node.mjs · examples/curl.sh
| field | example |
|---|---|
title, channelName, durationSeconds, viewCount |
video metadata |
language, isAutoGenerated, availableLanguages |
which captions were used |
transcript |
readable paragraphs (or plain / [mm:ss] lines) |
segments |
[{start, duration, text}] in seconds |
chapters |
[{title, start, end, text}] when the video has chapters |
srt, vtt |
subtitle files as text |
status, error |
ok, no_transcript, language_not_available… (non-ok rows are free) |
watch?v= · youtu.be/ · /shorts/ · /live/ · /embed/ links · 11-character IDs · playlist links · channel links / @handles (add /shorts or /streams for those tabs) · plain search terms.
The Actor works with Make, Zapier, n8n, webhooks and schedules, and as a tool for AI agents through the Apify MCP server — see the Actor page.
- Audio & Video Transcription — Whisper transcription for your own audio/video files and podcast feeds.
- Merge, Deduplicate & Transform Datasets — keep only new videos across scheduled runs.
Examples in this repo are MIT-licensed. Transcripts belong to their creators — respect copyright when you republish them.
Links to apify.com include our affiliate ID: if you start a paid Apify plan through them, Apify pays TidyData a commission at no extra cost to you.