YouTube Transcript API: Captions to Structured JSON
Fetch the transcript of any YouTube video as clean JSON with a hosted YouTube transcript API. Pass a single URL or a batch array; each video comes back as one row with the full plain text, timestamped snippets, language details, and the video's title, channel, and view count.
When to use this skill
- The user wants a YouTube transcript API, or asks to get, fetch, or download the transcript of a YouTube video.
- They want subtitles or captions as JSON, SRT, VTT, or plain text.
- They ask to extract the transcript from a YouTube video, a Short, or a list of URLs.
- Their own transcript library keeps failing with IpBlocked or RequestBlocked from a cloud or datacenter IP.
Not for: videos with no caption track at all (those return an error row, not a transcript), private or age-gated videos, or generating captions with speech-to-text (this API reads YouTube's published caption tracks; it does not run ASR).
What you get (one row per video)
non_timestamped (full transcript text), timestamped (snippets with text, start, duration), language, language_code, source_type (Manual or Auto-generated), is_translatable, translation_languages, total_seconds, duration_human, snippet_count, video_id, url, success. With metadata on (the default): title, channel_name, channel_url, view_count, like_count, upload_date, thumbnail_url, tags, categories. Optional extra formats: srt, vtt, text. A video that cannot be transcribed comes back as an error row (success false with error_type and error_message) instead of failing the run.
Prerequisites
The Actor
Run it with the Apify CLI
Single video:
apify actors call "johnvc/YoutubeTranscripts" -i '{"youtube_url":"https://www.youtube.com/watch?v=jNQXAC9IVRw"}' \
--json \
--output-dataset \
--user-agent apify-awesome-skills/apify-youtube-transcript-api \
2>/dev/null
Batch, with SRT and VTT added to each row:
apify actors call "johnvc/YoutubeTranscripts" -i '{"youtube_url":["https://www.youtube.com/watch?v=jNQXAC9IVRw","https://www.youtube.com/shorts/s4UkCaf_scs"],"output_formats":["srt","vtt"]}' \
--json \
--output-dataset \
--user-agent apify-awesome-skills/apify-youtube-transcript-api \
2>/dev/null
Every call carries the three flags this repo expects: --json, --user-agent apify-awesome-skills/apify-youtube-transcript-api, and 2>/dev/null. The --output-dataset flag prints the dataset rows (the transcript data) on success instead of just run metadata.
Run it from Claude or another AI agent (MCP)
The Actor is MCP-ready. Add the hosted server URL:
https://mcp.apify.com/?tools=actors,docs,johnvc/YoutubeTranscripts
Then ask, for example: "Get the transcript of this YouTube video and summarize it." MCP setup docs: https://docs.apify.com/platform/integrations/mcp
Workflow
- Collect the URL or URLs. Standard watch URLs, Shorts, youtu.be, embed, and mobile URLs all work; batches go in one array.
- Pick the language if it matters.
languages is an ordered preference list (default ["en"]); first available track wins, with fallback to whatever exists.
- Optional: discover before fetching.
"list_only": true returns available_transcripts per video (language, manual vs generated, translatable) without fetching or charging for any transcript.
- Optional: request
output_formats (srt, vtt, text) if the user needs subtitle files rather than JSON.
- Run the Actor and read the dataset. Deliver
non_timestamped for reading or LLM input, timestamped for alignment, srt or vtt for players.
Inputs
youtube_url (string or array, required)
languages (ordered array of ISO 639-1 codes, default ["en"])
translate_to (single ISO code; see limits below)
transcript_type (any, manual, generated; default any)
output_formats (array: srt, vtt, text)
preserve_formatting (boolean, keeps inline italic and bold tags)
list_only (boolean, discovery mode, free of the per-video charge)
include_metadata (boolean, default true; set false for slightly faster runs)
Cost
Billing is per video successfully transcribed, at a fraction of a cent per video; a thousand-video batch costs on the order of a few cents. Failed videos and list_only discovery runs are not charged the per-video fee. Details and the live-price check are in references/gotchas.md.
Honest limits
- Translation (
translate_to) only covers the languages YouTube exposes for auto-translation, roughly 18 codes. An unsupported code returns the original track unchanged; check for the translated_to field in the output to confirm translation actually happened.
- No captions means no transcript: the API reads YouTube's caption tracks, so a video with captions disabled returns an error row.
- Very large batches take time; the Actor processes several videos in parallel, but thousands of URLs can run for many minutes.
Troubleshooting
- Error row with
error_type IpBlocked or RequestBlocked: rare and transient; the Actor retries with fresh sessions automatically. Rerun the failed URLs; only successes are charged.
- Empty
translated_to after requesting translation: the target code is not in translation_languages for that video. Pick a supported code from a list_only run.
- Timed-out run on a huge batch: split the input into smaller arrays, or raise the run timeout in the run options.
See references/gotchas.md for cost guardrails and error recovery, and references/actor-index.md for the Actor routing table.
Related Actors
1---2name: apify-youtube-transcript-api3description: Get YouTube transcripts as structured JSON with a hosted YouTube transcript API (the Apify Actor johnvc/YoutubeTranscripts). Pass one video URL or a batch array and get back non_timestamped text, timestamped snippets, language metadata, and optional SRT, VTT, and plain text formats, plus video title, channel, and view count. Works with standard videos and Shorts, handles language preference and translation, and runs from cloud IPs without IpBlocked errors. Use when the user wants a youtube transcript api, needs to get or download a YouTube transcript or subtitles, asks to extract the transcript from a YouTube video, or wants captions as JSON, SRT, or VTT. Pay-per-video billing, MCP-ready for Claude and other AI agents.4license: MIT5---67# YouTube Transcript API: Captions to Structured JSON89Fetch the transcript of any YouTube video as clean JSON with a hosted YouTube transcript API. Pass a single URL or a batch array; each video comes back as one row with the full plain text, timestamped snippets, language details, and the video's title, channel, and view count.1011## When to use this skill1213- The user wants a YouTube transcript API, or asks to get, fetch, or download the transcript of a YouTube video.14- They want subtitles or captions as JSON, SRT, VTT, or plain text.15- They ask to extract the transcript from a YouTube video, a Short, or a list of URLs.16- Their own transcript library keeps failing with IpBlocked or RequestBlocked from a cloud or datacenter IP.1718Not for: videos with no caption track at all (those return an error row, not a transcript), private or age-gated videos, or generating captions with speech-to-text (this API reads YouTube's published caption tracks; it does not run ASR).1920## What you get (one row per video)2122`non_timestamped` (full transcript text), `timestamped` (snippets with `text`, `start`, `duration`), `language`, `language_code`, `source_type` (Manual or Auto-generated), `is_translatable`, `translation_languages`, `total_seconds`, `duration_human`, `snippet_count`, `video_id`, `url`, `success`. With metadata on (the default): `title`, `channel_name`, `channel_url`, `view_count`, `like_count`, `upload_date`, `thumbnail_url`, `tags`, `categories`. Optional extra formats: `srt`, `vtt`, `text`. A video that cannot be transcribed comes back as an error row (`success` false with `error_type` and `error_message`) instead of failing the run.2324## Prerequisites2526- Apify account (sign up at https://apify.com?fpr=9n7kx3&fp_sid=awesomeskills).27- Authentication via `apify login`, or an `APIFY_TOKEN` environment variable (Apify Console, Settings, Integrations).2829## The Actor3031- Store page: https://apify.com/johnvc/YoutubeTranscripts?fpr=9n7kx3&fp_sid=awesomeskills32- Actor ID: `johnvc/YoutubeTranscripts`33- Pricing: pay per video transcribed; failed videos are free (see `references/gotchas.md`).3435## Run it with the Apify CLI3637Single video:3839```bash40apify actors call "johnvc/YoutubeTranscripts" -i '{"youtube_url":"https://www.youtube.com/watch?v=jNQXAC9IVRw"}' \41 --json \42 --output-dataset \43 --user-agent apify-awesome-skills/apify-youtube-transcript-api \44 2>/dev/null45```4647Batch, with SRT and VTT added to each row:4849```bash50apify actors call "johnvc/YoutubeTranscripts" -i '{"youtube_url":["https://www.youtube.com/watch?v=jNQXAC9IVRw","https://www.youtube.com/shorts/s4UkCaf_scs"],"output_formats":["srt","vtt"]}' \51 --json \52 --output-dataset \53 --user-agent apify-awesome-skills/apify-youtube-transcript-api \54 2>/dev/null55```5657Every call carries the three flags this repo expects: `--json`, `--user-agent apify-awesome-skills/apify-youtube-transcript-api`, and `2>/dev/null`. The `--output-dataset` flag prints the dataset rows (the transcript data) on success instead of just run metadata.5859## Run it from Claude or another AI agent (MCP)6061The Actor is MCP-ready. Add the hosted server URL:6263`https://mcp.apify.com/?tools=actors,docs,johnvc/YoutubeTranscripts`6465Then ask, for example: "Get the transcript of this YouTube video and summarize it." MCP setup docs: https://docs.apify.com/platform/integrations/mcp6667## Workflow68691. Collect the URL or URLs. Standard watch URLs, Shorts, youtu.be, embed, and mobile URLs all work; batches go in one array.702. Pick the language if it matters. `languages` is an ordered preference list (default `["en"]`); first available track wins, with fallback to whatever exists.713. Optional: discover before fetching. `"list_only": true` returns `available_transcripts` per video (language, manual vs generated, translatable) without fetching or charging for any transcript.724. Optional: request `output_formats` (`srt`, `vtt`, `text`) if the user needs subtitle files rather than JSON.735. Run the Actor and read the dataset. Deliver `non_timestamped` for reading or LLM input, `timestamped` for alignment, `srt` or `vtt` for players.7475## Inputs7677- `youtube_url` (string or array, required)78- `languages` (ordered array of ISO 639-1 codes, default `["en"]`)79- `translate_to` (single ISO code; see limits below)80- `transcript_type` (`any`, `manual`, `generated`; default `any`)81- `output_formats` (array: `srt`, `vtt`, `text`)82- `preserve_formatting` (boolean, keeps inline italic and bold tags)83- `list_only` (boolean, discovery mode, free of the per-video charge)84- `include_metadata` (boolean, default true; set false for slightly faster runs)8586## Cost8788Billing is per video successfully transcribed, at a fraction of a cent per video; a thousand-video batch costs on the order of a few cents. Failed videos and `list_only` discovery runs are not charged the per-video fee. Details and the live-price check are in `references/gotchas.md`.8990## Honest limits9192- Translation (`translate_to`) only covers the languages YouTube exposes for auto-translation, roughly 18 codes. An unsupported code returns the original track unchanged; check for the `translated_to` field in the output to confirm translation actually happened.93- No captions means no transcript: the API reads YouTube's caption tracks, so a video with captions disabled returns an error row.94- Very large batches take time; the Actor processes several videos in parallel, but thousands of URLs can run for many minutes.9596## Troubleshooting9798- Error row with `error_type` IpBlocked or RequestBlocked: rare and transient; the Actor retries with fresh sessions automatically. Rerun the failed URLs; only successes are charged.99- Empty `translated_to` after requesting translation: the target code is not in `translation_languages` for that video. Pick a supported code from a `list_only` run.100- Timed-out run on a huge batch: split the input into smaller arrays, or raise the run timeout in the run options.101102See `references/gotchas.md` for cost guardrails and error recovery, and `references/actor-index.md` for the Actor routing table.103104## Related Actors105106- Google Short Videos API (find Shorts by keyword, then feed the URLs into this transcript API): https://apify.com/johnvc/google-short-videos-api?fpr=9n7kx3&fp_sid=awesomeskills