YouTube

Video Captions

Retrieve available caption tracks for a YouTube video or request captions in SRT, XML, JSON3, or plain-text format. Use it to support transcription, accessibility, localization, or text analysis.

get/api/youtube/get-video-captions/v1

Query parameters

tokenstring required

Access token for this API service.

videoIdstring required

The unique identifier for a YouTube video.

languageCodestring

Caption language code, such as en, zh-Hans, or a.en. Leave it empty to retrieve available caption tracks.

format'srt' | 'xml' | 'json3' | 'txt'

YouTube caption output format

Caption output format.

Available Values:

  • srt: SubRip caption format with timeline cues
  • xml: Original XML caption format
  • json3: YouTube original JSON caption structure
  • txt: Plain text without timeline cues

Response

OK

code0 | 100 | 101 | 202 | 300 | 301 | 302 | 303 | 400 | 404 | 500 | 503 | 600 | 601 | 602 required
messagestring nullable required
{"stackTrail":"paths:/api/youtube/get-video-captions/v1:get:responses:200:content:application/json:schema:properties:data","oasType":"schema","type":"unknown"}
recordTimestring nullable required
requestIdstring

Changes

No recorded changes to this endpoint across all 1 revision of this API.