DEV Community

YouTubeTranscriptAPI
YouTubeTranscriptAPI

Posted on Originally published at youtubetranscriptapi.com

How to get a YouTube playlist transcript for every video

Condensed from the full guide on the YouTubeTranscriptAPI blog: https://youtubetranscriptapi.com/youtube-playlist-transcript

A 40-lecture course at 45 minutes a lecture is 30 hours of video. You can't search a video. You can search its transcript, if you can get the text out.

To get a YouTube playlist transcript for every video, list the playlist's video IDs, then fetch each video's transcript and save it under its playlist position. One 20-credit listing call returns up to 100 videos, and every transcript is a single credit, so a 40-video course costs 60 credits. Videos without captions return a 404 and are free.

List, fetch, save. The order comes from the playlist, not from the file names.

Two passes, and why position matters

The first pass lists every video ID with its position in the playlist. The second requests one transcript per ID and writes it to a file named by that position, so lecture 9 never lands after lecture 10. A hosted API does both passes over plain HTTPS, from a laptop or a server.

Doing it by hand works for three videos. You open each one, click "Show transcript" under the description, copy the text and paste it somewhere. For a 40-video playlist, that's 40 rounds of open, scroll, copy, paste. And the copied text loses the video title and link unless you add them yourself.

The script approach keeps three things together for every video: its position, its title and its link. Those three are what you need later when an AI tool quotes "lecture 12" back at you.

The guide's script lists the playlist, fetches five transcripts at a time, and writes a Markdown file per video named by its position. It also writes combined files sized for AI tools and a manifest.csv with each video's status. Re-running it skips saved videos and reuses the saved video list, so you never pay twice for the same listing or transcript.

It was tested against a local mock of the API: a 12-video playlist with one captionless video and one 429 produced 11 files, a manifest row marking the twelfth as missing, and one listing request across three runs. A 130-video test playlist with a 30-credit limit saved exactly 30 transcripts and exited cleanly. The next run fetched the other 99 without listing again.

What if a playlist has more than 100 videos?

The playlist endpoint returns the first 100 videos, and a has_more flag tells you when there are more. For longer playlists, list the videos with the YouTube Data API instead: its playlistItems.list call returns 50 videos per page for 1 quota unit with a free Google API key. Then send those IDs to the transcript endpoint as usual.

A 400-video playlist is 8 pages, so 8 units. Google gives projects 10,000 units a day by default, so listing is never the bottleneck. The script does this for you — pass --youtube-key or set YOUTUBE_API_KEY, and it reads the full list from Google, keeps each video's position, and skips the 20-credit listing call.

Why not get the transcripts from Google too? Because its captions.download method needs permission to edit the video. For someone else's playlist, the Data API can name the videos but can't hand you their words.

Which method should you use?

Use yt-dlp for one playlist on your own laptop, and a transcript API when you need text files you keep, on a server or on a schedule. Copying by hand and pasting links into NotebookLM need no setup but stop at small playlists. Browser extensions sit in between, and many put playlist export behind a paid tier.

Method Text you keep Long playlists Runs on a server
"Show transcript" by hand Yes, if you paste it Slow past a few videos No
NotebookLM YouTube sources No, it stays in the notebook 50 sources per notebook on the free plan No
yt-dlp VTT or SRT files Yes Often hits bot checks
Browser extension Usually TXT or ZIP Varies No
Transcript API script Markdown, ordered, with links Yes, with a Data API key past 100 Yes

For one course on your own laptop, we'd use yt-dlp. Flags like --skip-download --write-auto-subs save subtitle files without the video. Long playlist runs are where it gets fragile — one open yt-dlp issue from October 17, 2026 describes long playlist sessions failing after YouTube invalidates the session cookies. You also end up with VTT files full of timing lines and repeated cues, which need cleaning before an AI tool reads them well.

No code at all? Connect an MCP server to Claude or ChatGPT and ask for "the transcripts of the first 10 videos in this playlist." The list_playlist_videos tool costs 20 credits and each transcript 1.

Into NotebookLM, Claude or ChatGPT

Upload the combined Markdown files, not 100 separate ones. The script joins the per-video files in playlist order into parts of 100,000 words or fewer, each video under its own numbered heading with a link. In NotebookLM every uploaded file is one source, and the free Standard plan allows 50 sources per notebook, so a few combined files leave room for your notes. Pasting YouTube links into NotebookLM works too, until it doesn't — each link uses a source slot, so a 70-video course doesn't fit in one free notebook as links. As combined files, it takes a handful of slots.

The numbered headings matter more than they look. When you ask "where does the course first explain overfitting?", the answer can point at "008. Lecture 8" and a timestamp you can click.

For Claude and ChatGPT, add the parts as files in a Project. Then start with an inventory prompt before any summary: ask the model to list the videos it sees. If the model's list matches your manifest, the files went in whole. If it doesn't, you know before you trust its summary.

What it costs

Each playlist run pays 20 credits to list the videos and a single credit for each transcript it saves; failed calls cost nothing.

Playlist Credits Monthly Annual
12-video conference track 32 $0.10 $0.06
40-video course 60 $0.18 $0.12
100-video podcast season 120 $0.36 $0.24
300-video archive 300 $0.90 $0.60

Free accounts start with 100 credits. That covers one listing and 80 transcripts, which is most courses. The real bill is often lower — 404s for videos without captions, 429 rate limits and 5xx errors are never charged.

Keep a playlist current by running the script again with --refresh. It lists the playlist again, fetches transcripts only for videos it hasn't saved, renames saved files whose position changed, and rebuilds the combined files in the new order. Playlists change more than people expect — a course creator slips a bonus lecture in at position 3, a podcast moves its trailer to the end. The script matches saved transcripts by video ID instead, so a moved video keeps its text and only its file name changes. Renaming is free. Nothing is fetched twice.

A weekly refresh of a playlist that adds two videos a week is about 95 credits a month, because each listing is 20 credits. With a Data API key, the listing is free and the same job costs about 9.

Pass --language with a language code, such as --language es, for playlists in another language. The script records which language came back in manifest.csv, so a mixed-language playlist shows which videos arrived in a different language. Private, deleted or captionless videos come back as 404s, cost nothing, and get a row in the manifest instead of a file, so your playlist keeps its numbering with a visible gap where the missing video was.

I use youtubetranscriptapi.com for the fetching part — one GET with a Bearer key returns the transcript as JSON, 100 free credits, no card, and errors are never charged.

Full guide, with the tested script and the AI-tool prompts: https://youtubetranscriptapi.com/youtube-playlist-transcript

Disclosure: I work on YouTubeTranscriptAPI.

Top comments (0)