How to Download YouTube Subtitles as SRT or VTT with an API

6 min read Summarize with Claude ChatGPT Gemini Perplexity
Download YouTube Subtitles as SRT or VTT with an API

Subtitles with the video

JSON
{
  "url": "https://www.youtube.com/watch?v=VIDEO_ID",
  "resolution": "1080",
  "captions": true,
  "caption_langs": "en,es",
  "caption_format": "srt"
}

The finished job has the video in download_url and the subtitle files in extras. extras_status shows the result per language, so you can see straight away if Spanish was missing while English worked.

Subtitles only, no video

For transcripts, search indexes or training text, skip the video. It's far faster and uses almost no bandwidth:

JSON
{
  "url": "https://www.youtube.com/watch?v=VIDEO_ID",
  "skip_download": true,
  "captions": true,
  "caption_langs": "en",
  "caption_format": "vtt"
}

skip_download also returns an .info.json file with the video's metadata: title, channel, upload date, duration, view count and more. In this mode, if captions fail, the job fails, because there's nothing else to deliver.

SRT, VTT or ASS?

FormatUse it for
srt (default)Video editors, most media players, and plain-text processing. The simplest format
vttWeb players using the HTML5 <track> element, and platforms that ask for WebVTT
assStyled subtitles with fonts, colours and positioning, for burning into video

Languages

  • Use language codes separated by commas: en, es, de, or regional codes like pt-PT.
  • Up to 5 languages per request. "all" isn't accepted, so list the ones you need.
  • The default is en.

When a video has no captions

Not every video has captions in every language. When one you asked for is missing, the video still downloads, the job is marked "partial": true, and the warning gives code 71 (captions not available). Code 70 means caption requests were rate-limited; those are retried. Plans with transcripts can turn on Whisper transcript when captions are missing in the dashboard, so videos without captions still come back with a transcript.

File names

By default caption files are named {id}.{lang}.{ext}, for example VIDEO_ID.en.srt, which keeps them matched to their video. You can change the pattern in the dashboard under Extra Features.

The same thing with yt-dlp

bash
yt-dlp --skip-download --write-subs --write-auto-subs --sub-langs "en,es" --convert-subs srt "https://www.youtube.com/watch?v=VIDEO_ID"

--write-subs fetches captions written by the creator and --write-auto-subs adds YouTube's automatic ones. --convert-subs needs ffmpeg. On servers, subtitle requests get rate-limited like video requests do, which is the usual reason batch jobs return empty files.

Plans

Captions are included from the Starter plan ($12/month). The free trial covers video, audio and metadata. Requesting captions on a plan without them returns code 58 (feature locked).

FAQ

How do I download YouTube subtitles as SRT?

With the VideoDL API, send "captions": true and "caption_format": "srt" with the video URL. With yt-dlp, use --write-subs --sub-langs en --convert-subs srt.

Can I download YouTube captions without the video?

Yes. Add "skip_download": true to the request. You get the subtitle files and an info.json with the video's metadata, without downloading the video.

How many subtitle languages can I request at once?

Up to 5 per request, as comma-separated codes like "en,es,de". List the languages you need, because "all" isn't accepted.

What's the difference between SRT and VTT?

Both are timed text. SRT is the simplest and works in most editors and players. VTT (WebVTT) is the standard for web players and supports a little extra styling.

What happens if a video has no captions?

The video still downloads and the job is marked partial, with a captions-not-available warning (code 71). Plans with transcripts can generate a Whisper transcript instead.

Captions and metadata, by API

SRT, VTT or ASS in up to 5 languages per request, with or without the video. From $12/month.