youtube-captions

One YouTube video's captions (its transcript) in one language, as one row: the whole text, the timed lines, whether they are auto-generated, and every caption language the video has. video is the watch URL, a youtu.be or shorts link, or the 11-character id; language a code such as en, es or pt-BR (default en), or any for the default captions. A person's track comes before an auto-generated one. No captions in that language gives no row and a warning listing the languages. 1 to 3 s; when YouTube refuses, a slower second source gives the default captions (billed even when it has none).

stagedyoutube.comWASM module8 fields3-4 units; 1 record on fallback, 0-1 rowfresh 1 h
‹ Recipes
…json
POST api.crawl4ai.com/recipes/…

$ crawl recipe

              
Live · your key · counts against your quota✓ 200 OK
# Hit Run - the rows render here as a table, with the cost

Fields

8 columns on every row. null means the site does not state it.
fieldtypemeaning
video_idstringThe 11-character id of the video.
titlestringThe video's title as YouTube shows it.
languagestringThe language code of the captions in the row (en, es, pt-BR), as YouTube names the track; null when the row came from the second source, which gives the video's default captions without a code.
is_auto_generatedbooleantrue when YouTube made the captions by speech recognition, false when a person wrote or uploaded them; null on the second source.
available_languagesobject[]Every caption track the video has, {code, name, auto}: auto is true for an auto-generated track. On the second source code is null (it names languages only).
textstringThe whole transcript as plain text: every line in order, joined by spaces, line breaks removed.
segmentsobject[]The timed lines in order, {start_s, duration_s, text}, seconds as numbers (27.103). On an auto-generated track a line's duration can run past the next line's start: YouTube shows two lines at once.
urlstringThe video's watch URL.

null means the site does not state it.

video_idstringThe 11-character id of the video.
titlestringThe video's title as YouTube shows it.
languagestringThe language code of the captions in the row (en, es, pt-BR), as YouTube names the track; null when the row came from the second source, which gives the video's default captions without a code.
is_auto_generatedbooleantrue when YouTube made the captions by speech recognition, false when a person wrote or uploaded them; null on the second source.
available_languagesobject[]Every caption track the video has, {code, name, auto}: auto is true for an auto-generated track. On the second source code is null (it names languages only).
textstringThe whole transcript as plain text: every line in order, joined by spaces, line breaks removed.
segmentsobject[]The timed lines in order, {start_s, duration_s, text}, seconds as numbers (27.103). On an auto-generated track a line's duration can run past the next line's start: YouTube shows two lines at once.
urlstringThe video's watch URL.

How it behaves

Cost. 3-4 units; 1 record on fallback, 0-1 row. A failed run costs 0.

Freshness 1 h. The same input within 1 h is served from cache at 0 units.

How it answers. Answers at once for one input; a large run goes as a job you poll.

Questions about this recipeQuestions

Short answers. The API reference has the long ones.

Call POST /recipes/youtube-captions with your key and video and language. You get rows with the 8 fields above. The recipe is tested against the live site every 6 hours.

Need more from YouTube?

Extra fields, higher volume, or a private copy with a freshness SLA. We build it on Enterprise.

Request a change

For developers

Get a free API key and run your first crawl.

1,000 credits every month. No credit card. Your self-hosted setup keeps working.

For teams

Talk to us about volume, regions and an SLA.

A 30-minute call with the team that writes the crawler. DPA on request, invoice billing, your choice of US, EU or Singapore.