How to turn YouTube videos into structured text for AI pipelines
Key Takeaways
Why not just use the YouTube Data API for transcripts? YouTube's own API doesn't expose caption text at all for most videos — it can tell you captions exist, not what they say — so getting the actual transcript text has always required reading the caption track directly off the video page.
What happens when a video has no captions at all?
The transcript actor can fall back to Whisper transcription automatically (whisperFallback: true), transcribing the audio track directly rather than failing on caption-less videos — billed as a separate premium event since it's meaningfully more compute-intensive than reading an existing caption file.
Does this only work for YouTube? No — a separate Whisper-based transcriber actor covers over 1,800 sites (via yt-dlp), including TikTok, Instagram, X, SoundCloud, and raw podcast RSS feeds, for cases where the source isn't YouTube at all.
Two Actors, Two Different Jobs
| Job | Actor | When to use it |
|---|---|---|
| Read existing YouTube captions | YouTube Transcript Scraper | Fast, cheap, works for any video that already has captions (creator-uploaded or YouTube auto-generated) |
| Transcribe audio directly with Whisper | Video & Audio Transcriber | No captions exist, or the source isn't YouTube at all (TikTok, podcasts, direct audio files) |
Reading Existing Captions
The YouTube Transcript Scraper takes video, Shorts, or youtu.be URLs and reads the caption track YouTube already has — either creator-uploaded or YouTube's own auto-captions:
{
"videoId": "dQw4w9WgXcQ",
"title": "Never Gonna Give You Up",
"author": "Rick Astley",
"lengthSeconds": 213,
"transcript": [
{ "text": "We're no strangers to love", "startMs": 18040, "endMs": 20100 },
{ "text": "You know the rules and so do I", "startMs": 20100, "endMs": 23200 }
],
"transcript_only_text": "We're no strangers to love. You know the rules and so do I...",
"transcriptSource": "captions",
"language": "en"
}
transcript_only_text is the field to hand straight to an LLM or chunker — plain text, no timestamps, no HTML. Keep the full transcript[] array instead when you need startMs/endMs for anything that has to reference a specific moment in the video (search-and-jump, clip generation). language accepts an ISO code to request a translated track when the exact one you want is missing, and setting whisperFallback: true transcribes the audio with Whisper for the fraction of videos that have no caption track at all — transcriptSource tells you afterward whether a given row came from captions, auto-captions, or whisper.
Transcribing Anything Else
For content that isn't on YouTube — or YouTube content you want transcribed with a specific Whisper model rather than reading whatever captions exist — the Video & Audio Transcriber runs OpenAI's Whisper (via the faster faster-whisper implementation) inside the actor itself, no OpenAI API key required:
{
"text": "Welcome back to the show. Today we're talking about...",
"segments": [{ "start": 0.0, "end": 4.2, "text": "Welcome back to the show." }],
"srt": "1\n00:00:00,000 --> 00:00:04,200\nWelcome back to the show.\n",
"language": "en",
"durationSeconds": 1847,
"transcribedSeconds": 1847,
"billedMinutes": 30.8,
"model": "base"
}
It covers anything yt-dlp can open — over 1,800 sites including TikTok, Instagram Reels, X, SoundCloud, Rumble, and Bilibili — plus direct .mp3/.mp4 files and podcast RSS feeds (maxEpisodesPerFeed takes just the newest N episodes automatically). Choose tiny/base/small for the Whisper model size, or set translateToEnglish: true to get an English translation regardless of the source language. maxMinutesPerItem caps cost per item, and failed items are never billed.
Building a RAG-Ready Chunk
function chunkTranscript(transcriptOnlyText, maxChars = 1000) {
const sentences = transcriptOnlyText.match(/[^.!?]+[.!?]+/g) || [transcriptOnlyText];
const chunks = [];
let current = "";
for (const sentence of sentences) {
if ((current + sentence).length > maxChars) {
chunks.push(current.trim());
current = "";
}
current += sentence;
}
if (current.trim()) chunks.push(current.trim());
return chunks;
}
Chunking on sentence boundaries rather than a fixed character count avoids splitting mid-sentence, which matters for embedding quality — a chunk cut off mid-thought embeds as a worse semantic match than a complete sentence, even at the same token length. For more on this step, see How to Structure Web-Scraped Data for AI Pipelines.
FAQ
Which is cheaper: reading captions or running Whisper? Reading existing captions — Whisper transcription is billed per minute of audio actually processed, which costs meaningfully more than reading a caption file YouTube already generated.
Can you get subtitles (SRT/VTT), not just plain text, from both actors?
Yes — both return transcript_srt/transcript_vtt (YouTube Transcript Scraper) or srt/vtt (Video & Audio Transcriber) alongside the plain-text field.
Browse the rest of ParseBird's video and developer tools for the other pieces of a scraped-content-to-AI pipeline.