YouTube Transcripts API
Transcripts, subtitles and captions from any YouTube video, Short or embed URL — with language selection, on-the-fly translation, SRT and WebVTT output, and full video metadata. A discovery mode lists what captions exist before you spend anything fetching them.
MEDIAN LAGon demand
PARAMETERS8
TOTAL USERS492
MONTHLY ACTIVE304
RUNS SUCCEEDED95.6%
RATING5.0 (5)
Input parameters
| PARAMETER | TYPE | REQ | DEFAULT | DESCRIPTION |
|---|---|---|---|---|
| youtube_url | string | string[] | yes | — | One URL or many. Standard videos, Shorts, youtu.be, embed and m.youtube.com all work. Processed in parallel; an invalid URL is recorded as an error rather than stopping the run. — drives your bill |
| languages | string[] | no | [en] | Ordered ISO 639-1 preferences — the first available match wins |
| translate_to | string | no | — | Translate the chosen transcript. Falls back to the original if translation is unavailable, without erroring. |
| transcript_type | enum | no | any | any · manual (human-made only) · generated (auto-captions only) |
| output_formats | string[] | no | [] | Extra formats alongside the structured fields: srt, vtt, text |
| preserve_formatting | boolean | no | false | Keep YouTube's inline and tags instead of stripping them |
| list_only | boolean | no | false | Discovery mode — list available captions, their language, manual/generated status and translation targets. Not billed as a video processed. |
| include_metadata | boolean | no | true | Title, channel, view and like counts, duration, upload date, thumbnail, tags. Adds 1–3 s per video. |
Worked examples
{ "youtube_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }
{
"youtube_url": [
"https://www.youtube.com/watch?v=aaaaaaaaaaa",
"https://youtu.be/bbbbbbbbbbb",
"https://www.youtube.com/shorts/ccccccccccc"
]
}
{
"youtube_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"list_only": true
}
{
"youtube_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"translate_to": "es",
"output_formats": ["srt"]
}
{
"youtube_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"transcript_type": "manual"
}
POWER-USER TIP
list_only is free reconnaissance — Discovery mode is not billed as a video processed. Run it first across a batch to see which videos actually have captions, in what languages, and which are translatable — then fetch only the ones worth fetching instead of paying for misses.
Coverage
5
URL formats accepted — watch · Shorts · youtu.be · embed · m.youtube.com
3
output formats — SRT · WebVTT · plain text, alongside the structured fields
3
transcript variants — any · manually created · auto-generated
Tasks
Saved runs with the inputs already filled in — each one a standalone page and a working configuration example.
Code
curl
curl -X POST "https://api.apify.com/v2/acts/johnvc~YoutubeTranscripts/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"youtube_url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ","languages":["en"]}'
Python
from apify_client import ApifyClient
client = ApifyClient("APIFY_TOKEN")
run = client.actor("johnvc/YoutubeTranscripts").call(
run_input={
"youtube_url": ["https://youtu.be/aaaaaaaaaaa", "https://youtu.be/bbbbbbbbbbb"],
"output_formats": ["srt"],
}
)
for v in client.dataset(run.default_dataset_id).iterate_items():
print(v.get("title"), len(v.get("non_timestamped") or ""))
What people use it for
- Feeding video content into a RAG pipeline
- Bulk subtitle generation for a channel
- Searchable archives of conference talks
- Competitive content analysis
- Accessibility and compliance workflows
- Training-data collection for language models