← Back to blog

11 min read

YouTube Transcript for AI Training: Datasets and RAG

Building an AI training set from YouTube starts with a decision, not a scraper. YouTube captions suit retrieval, domain fine-tuning, and evaluation sets. They suit factual-precision training badly, because an auto-generated caption track is a speech recognizer's best guess and carries word-level errors that no cleaning pass fully removes. Everything below follows from that split: how to scope a dataset, pick channels, export captions in bulk, clean them, chunk them, and record where every line came from.

The last section covers copyright, and it is the one place in this guide where the correct answer is that nobody knows yet. Three US courts ruled on AI training and fair use between February and June 2025, on different facts and with different outcomes, and none of them involved video captions. Treat provenance logging as the part of the pipeline that survives whichever way the law lands.

Are YouTube captions good training data for an LLM?

YouTube captions are strong training data for retrieval and domain-specific fine-tuning, and weak for anything that needs word-level factual accuracy. Three properties account for the strength.

  • They record how people actually speak. Contractions, disfluencies and mid-sentence topic pivots appear in captions and not in books or papers, which puts the text closer to the distribution a chat model meets in production.
  • They cluster by domain. Twenty channels in one field produce a focused corpus without the labeling and filtering pass that extracting the same material from a generic web crawl would require.
  • They carry timing. Every caption segment has a start time, so chunk boundaries, alignment, and citation back to a specific second in a specific video are all lookups rather than inferences.

None of that makes YouTube captions a replacement for labeled data, and the failure modes further down this page are real. As a raw ingredient for a domain corpus, a carefully chosen channel list goes further than most open datasets of comparable size. Our bulk transcript guide covers the download tooling; this page covers what happens to the captions afterwards.

What should you decide before downloading anything?

Decide the target task first, because it sets the quality bar for every later filter. Collecting first and choosing the task later is the mistake that produces a 50,000-video corpus nobody can use. Answer four questions on paper before the first export:

  1. What is the dataset for? Fine-tuning, retrieval, evaluation, and exploratory analysis each tolerate a different error rate.
  2. Which domain? The answer is your channel list, and the channel list is most of the dataset.
  3. How much data do you actually need? A focused 500-transcript set from manually captioned channels usually beats a sprawling 50,000-transcript set for fine-tuning on a strong base model.
  4. What are the known failure modes? Auto-caption errors, sponsor reads, and non-target-language segments are the three to plan for before you start filtering.

Scoping is cheap to check. The GET /api/v1/resolve endpoint turns a channel or playlist URL into its video list, consumes no quota, and does not fetch transcripts, so you can count a 900-video channel and decide against it without spending a credit.

Which channels produce usable transcripts?

Channels with manually uploaded captions produce the usable transcripts, and everything else is a quality trade you should make deliberately. Four filters do most of the work:

  • Manual captions over auto-generated. A channel that uploads real caption files gives you near-publication text. Auto-captions are fine for bulk retrieval and need cleaning before anything factual.
  • Steady audio. A studio podcast produces cleaner auto-captions than a field-reporting channel with wind and crowd noise, because the recognizer is working from cleaner input.
  • Long-form over Shorts. Short-form videos give you truncated captions and little contextual coherence per file.
  • One language per video. Channels that switch language mid-video break language-ID filters downstream, which is how non-target text reaches a supposedly monolingual training set.

How do you export thousands of transcripts without a scraper?

Two paths handle bulk caption export: yt-dlp from a terminal, and a hosted bulk downloader. yt-dlp is free, open source, and the right answer if you are comfortable in a shell and can write the loop yourself. It writes caption files in WebVTT by default and converts to SRT on request, so a JSON pipeline means parsing subtitle files and normalizing the shapes yourself.

YouTube Video Transcript takes the channel or playlist URL and returns a ZIP with one file per video, in TXT, SRT, JSON, CSV, Markdown, or DOCX through the API. Those six are the complete list; there is no WebVTT export. For a training pipeline, JSON is the one to pick, because each file arrives in the same shape:

{
  "video_id": "abc12345678",
  "title": "Video title",
  "language": "en",
  "segments": [
    { "text": "welcome to my channel", "start": 0.08, "end": 3.36 }
  ]
}

Times are seconds. One file per video, one schema across the whole export, which is what makes a chunking script a dozen lines rather than a parser project. The format reference documents all six, including the one shape difference worth knowing: the single-video sync endpoint returns { text, start, duration } while the bulk export returns { text, start, end }. Code that consumes both should normalize at the boundary.

The largest single job YouTube Video Transcript has handled pulled 3,713 videos from one channel, and 16,466 transcripts have gone through the service so far, at a median of 1.9s per transcript. Figures as of September 2026.

Two limits worth knowing before you plan around this. We read the captions YouTube already has, so a video with captions disabled has nothing to fetch, and those videos are refunded rather than billed when a bulk job finishes. And keep the raw exports somewhere immutable, with cleaning steps writing to a separate location, so a bad filter never costs you a re-pull.

How do you clean YouTube captions before training?

Four cleaning passes remove the material that a model will otherwise memorize and reproduce.

  1. Cut sponsor segments. A sponsor read is repeated boilerplate across dozens of videos, which is exactly the signal a model learns fastest. SponsorBlock publishes community-submitted sponsor timestamps through a public API. Check its license terms before you use that data in a commercial pipeline.
  2. Strip intros and outros. A channel that opens every video with the same 30-second hook will teach the model that hook. A string-frequency pass across one channel's transcripts finds them without hand-labeling.
  3. Drop recognizer noise. Runs with erratic capitalization, very short tokens, or unusual punctuation density usually mark stretches where the speech recognizer lost the audio.
  4. Deduplicate twice. Re-uploads, clip channels, and cross-posts put the same content under different video IDs, so deduplicate on the video ID and again on near-identical transcript openings.

How should you chunk transcripts for RAG or fine-tuning?

For retrieval, chunk each transcript into 300 to 800 token windows with 10 to 20 percent overlap, and treat that as a starting point to tune against your own retrieval evaluation rather than a settled number. Carry video ID, channel, start and end times, and published date on every chunk. Because the export JSON already stores start and end per segment, citing the exact second in a source video is a field copy, not a re-alignment job.

For fine-tuning, the chunking depends on the task. Instruction tuning needs paired prompts and responses, which monologue captions do not contain, so a synthesis step has to generate the pairs before training. Continued pretraining on long-form captions works with plain sliding windows and no pairing step at all.

What provenance should you log for every chunk?

Log five fields per chunk: source video ID, channel ID, caption type, export date, and the filters applied. This is the step teams skip and then regret, because six months later a channel owner emails asking for removal or a compliance review lands, and the log is the difference between a five-minute answer and a rebuild.

Caption type takes one extra step to capture. The bulk export JSON carries video_id, title, language, and the segments array, and it does not carry a manual-versus-auto flag. The single-video endpoint does: GET /api/v1/transcript/:id returns is_auto_generated along with the available caption tracks. If caption type is one of your filters, record it at fetch time from that endpoint rather than trying to infer it from the text later.

Is it legal to train an AI model on YouTube transcripts?

No court has ruled on whether training a model on YouTube captions is lawful, and the broader copyright question about AI training is unsettled as of August 2026. What exists is a small set of decisions about other corpora, decided on their own facts, pointing in different directions.

In Bartz v. Anthropic (N.D. Cal., June 2025), Judge William Alsup held that training a large language model on lawfully acquired books was a transformative fair use, while holding separately that retaining pirated copies in a permanent library was not; Anthropic later agreed to a $1.5 billion settlement over the pirated copies. Days later, in Kadrey v. Meta, Judge Vince Chhabria granted Meta summary judgment on fair use but wrote that the result turned on what those particular plaintiffs failed to argue rather than on a general rule. In February 2025, in Thomson Reuters v. Ross Intelligence (D. Del.), the court rejected a fair use defense for a legal research tool trained on Westlaw headnotes. Fair use is a defense assessed case by case, not a standing permission, and none of these cases involved video captions.

Two constraints are clearer than the fair use question. First, YouTube's Terms of Service restrict automated access to the service and downloading content outside the paths YouTube provides. That is a contract question, so it does not disappear if a fair use argument succeeds. Second, in the EU, Directive (EU) 2019/790 allows general text and data mining under Article 4 only where the rightsholder has not reserved the right in a machine-readable way, while Article 3 gives research organizations a narrower exception that cannot be opted out of. Article 53 of the EU AI Act additionally requires providers of general-purpose AI models to publish a sufficiently detailed summary of the content used to train them.

This is not legal advice and it does not tell you whether your dataset is lawful. Practically: the fair use analysis is most favorable for non-commercial research, favorable is not the same as settled, and a commercial training run needs a lawyer and possibly a licensing conversation with the creators whose material dominates the set. Redistributing raw transcripts verbatim at scale is the weakest position of all, because it is the use least likely to read as transformative. Publish provenance, honor takedown requests, and keep the export log that lets you act on one.

What goes wrong most often?

Five failure modes account for most of the damage in training runs sourced from YouTube.

  • Caption timing drift. Some auto-caption tracks run seconds out of sync with the audio. Sample-check alignment before training if timestamps drive the task.
  • Mixed languages. Bilingual channels and auto-translated tracks slip non-target-language text into a set that everything downstream assumes is monolingual.
  • Sponsor repetition. Repeated sponsor reads are the most memorizable text in the corpus, which is why they are worth filtering aggressively rather than sampling out.
  • Invented text over music. Auto-captioners sometimes emit text during songs or silence. Drop segments the track marks as music.
  • Stale exports. Videos get edited, channels get deleted, and a dataset pulled once drifts from the public record. Re-pull on a schedule for any ongoing project.

What does a finished pipeline look like?

A worked shape: you are fine-tuning a small open model for a conversational medical-information agent. You pick 15 credentialed clinician channels with manually uploaded captions, resolve each one to check its video count for free, export roughly 4,000 transcripts as JSON, strip intros and sponsor reads, chunk at 500 tokens with 20 percent overlap, synthesize instruction and response pairs from the monologue text, and train a LoRA adapter on the result.

The transcript side of that run costs $19, because 4,000 transcripts fits inside the Pro plan's 5,000 per month. The pattern that makes it work is not the model choice: it is the focused domain, credentialed sources, manual captions, explicit filters, and a provenance log written at export time rather than reconstructed later.

What does bulk transcript export cost?

Between 0.25 and 0.9 cents per transcript, depending on plan. A 4,000-transcript collection run fits inside Pro at $19, and the first 30 each month are free with a Google sign-in.

PlanPriceTranscriptsPer transcript
Free$030 a month, Google sign-inFree
Starter$9/mo1,000/mo0.9¢
Pro$19/mo5,000/mo0.38¢
Business$49/mo20,000/mo0.25¢

Unused transcripts do not roll over, and the allowance resets on your billing anniversary, so a one-off 4,000-video collection run is cheapest inside a single billing month rather than spread across two. Upgrading resets the allowance immediately; downgrading does not. The pricing page has the full comparison, and the API documentation covers the endpoints, rate limits, and the Idempotency-Key header that makes a retried dataset refresh safe to run twice.

Where to start

Paste a channel or playlist URL into YouTube Video Transcript, pick JSON, and download the ZIP: one file per video, the same schema in every file, timing on every segment. The first 30 transcripts each month are free with a Google sign-in, which is enough to run a small playlist through your chunking and embedding code before you decide whether the corpus is worth building at all. After that it is $9 a month for 1,000 transcripts.

For the mechanics of pulling captions in the first place, see the captions download guide. If you are still choosing a tool for the pipeline, the 2026 roundup of transcript downloaders compares the options on bulk support, output formats, and price.

Frequently asked questions

Are YouTube transcripts good for AI training?

YouTube transcripts work well for conversational-tone fine-tuning, domain-specific retrieval, and evaluation sets. They work badly for training that needs factual precision, because auto-generated captions carry word-level recognition errors. Manually uploaded captions are closer to publication quality, which makes caption type the first filter in a serious dataset.

Is it legal to use YouTube transcripts for AI training?

No court has ruled on YouTube captions specifically, and the copyright position on AI training is unsettled as of August 2026. In Bartz v. Anthropic (N.D. Cal., June 2025) training on lawfully acquired books was held to be fair use while retaining pirated copies was not; in Thomson Reuters v. Ross Intelligence (D. Del., February 2025) a fair use defense was rejected. YouTube's Terms of Service separately restrict automated access and downloading, which is a contract question rather than a copyright one. Consult a lawyer before a commercial training run, and log provenance either way.

How many YouTube transcripts do I need for fine-tuning?

A few thousand high-quality transcripts is a reasonable starting budget for domain-specific fine-tuning on a strong base model, and 200 to 500 videos from one or two channels is enough to shift tone or persona. A focused 500-transcript set from manually captioned channels usually beats a 50,000-transcript set scraped indiscriminately.

What format should transcripts be in for AI training?

JSON, for anything that gets chunked or embedded. A YouTube Video Transcript bulk export gives one JSON file per video containing video_id, title, language, and a segments array of { text, start, end } with times in seconds. TXT is enough for continued pretraining, and SRT suits tasks that consume subtitle timing directly.

How do I handle auto-caption errors?

Filter by caption type first and exclude auto-generated tracks from runs where factual precision matters. For the auto-generated tracks you keep, run a spell-check pass and flag high-typo chunks for review. Full denoising is not worth the cost: use auto-captions as-is for retrieval and reserve clean corpora for precision tasks.

Can I use YouTube transcripts for RAG?

Yes, and RAG is the use case YouTube transcripts fit best, because every caption segment carries a start time, so a retrieved chunk can cite the exact second in the source video. Chunk by time windows of roughly 30 to 60 seconds, embed each chunk, and carry video ID plus start time into the citation metadata.

How does YouTube Video Transcript help?

You paste a channel or playlist URL and get a ZIP with one consistently shaped file per video, in TXT, SRT, JSON, CSV, DOCX, or Markdown. GET /api/v1/resolve counts a channel's videos without consuming quota, videos with no captions are refunded rather than billed, and the first 30 transcripts each month are free with a Google sign-in.

We use Google Analytics cookies and note which site referred you, so we know how people find us. Nothing personal, nothing sold. See our Privacy Policy.