YouTube transcript

Get YouTube transcript (v2)

Changed on

Get a YouTube video's transcript — pass a video URL or 11-character ID as video_url.

By default you get English, or the video's first available language if there's no English.

To choose a language, set language to a comma-separated list in priority order; we return the first one that's available. Example: language=de,en,asr tries German, then English, then the auto-generated captions.

  • asr = the video's auto-generated captions (ASR = automatic speech recognition).
  • asr-<code> = auto-generated captions in a specific language, e.g. asr-hi.
  • A plain code like hi returns the human-made captions if they exist, otherwise the auto-generated ones (asr-hi).
  • Language codes ignore region (de matches de-DE) and are case-insensitive. Up to 10 codes.

The language field in the response always tells you exactly what you got. Tip: call GET /api/v2/youtube/info first (it's free) to see which languages a video offers.

get/api/v2/youtube/transcript

Request

  • Base URL
    https://transcriptapi.com
  • Auth
    HTTP bearer

Query parameters

video_urlstring required

YouTube video URL or bare 11-char ID

languagestring nullable

Optional comma-separated language priority list (e.g. de,en,asr). Omit it to get English, or the video's first available language. We return the first code that's available. asr = auto-generated captions; asr-<code> = a specific auto language (e.g. asr-hi). Codes ignore region (de matches de-DE). The response's language field tells you exactly what you got — ask for hi and you'll see asr-hi if only auto-generated captions exist.

language_fallbackboolean

Only used with language. true (default): a plain code like hi returns the human-made captions when they exist, otherwise the auto-generated ones. false: a plain code returns human-made captions only; if none exist for any code you listed you get a 404 with available_languages (no credit used). With false, a plain code whose kind is auto is skipped and the next code is tried. asr / asr-<code> still ask for auto-generated captions.

send_metadataboolean

Include basic video metadata in response

format'json' | 'text'

Available transcript formats for v2 (restricted).

Response format: json or text

include_timestampboolean

Include timestamps in transcript output

Response

Transcript retrieved successfully

video_idstring required

YouTube video ID

languagestring required

Language of the returned transcript

length_secondsinteger nullable

Total video length in whole seconds (e.g. 213). null when the source doesn't expose a fixed length — live streams and the rare fallback extraction path.

lengthTextstring nullable

Total video length as a human-readable string, e.g. '3:33' or '1:02:45'. null in the same cases as length_seconds. Matches the lengthText format used by the search/channel/playlist endpoints.

Changes

    • info

      added the new optional query request parameter language_fallback

    • info

      added the optional property // to the response with the status

    • warning

      the optional response header X-RateLimit-Limit removed for the status 429

    • warning

      the optional response header X-RateLimit-Remaining removed for the status 429

    • warning

      the optional response header X-RateLimit-Reset removed for the status 429