Skip to content

Docs

GET /v1/transcripts/{videoId}

Returns the video transcript as timestamped segments. Manual captions and auto-generated (ASR) tracks are both supported. Cost: 1 credit per successful call; failures are free.

Parameters

ParameterInTypeDescription
videoIdpathstring (11 chars)YouTube video ID.
langquerystringBCP-47 language code. Defaults to the first available track. Exact match first, then language prefix (en-US falls back to en).
formatqueryjson | text | srt | vttOutput format. Default json; text/srt/vtt return text/plain formatted subtitles.
translatequerystringTranslate the transcript into this language (YouTube machine translation).

Request examples

curl "https://api.ytapi.dev/v1/transcripts/dQw4w9WgXcQ?lang=en&format=json" \
  -H "Authorization: Bearer yta_YOUR_KEY"

Response

200 OK
{
  "video_id": "dQw4w9WgXcQ",
  "lang": "en",
  "is_auto_generated": false,
  "is_translated": false,
  "segments": [
    { "start": 0.0, "duration": 4.2, "text": "First line of the speech" },
    { "start": 4.2, "duration": 3.1, "text": "Introduction to chapter", "type": "heading" }
  ]
}

type: heading marks chapter titles (only present when YouTube exposes them). Timestamps are seconds (float).

List available languages (0 credits)

Probe available tracks and ASR status before fetching full transcripts:

curl "https://api.ytapi.dev/v1/transcripts/dQw4w9WgXcQ/languages" \
  -H "Authorization: Bearer yta_YOUR_KEY"

Batch transcripts

POST up to 50 video IDs in one call. HTTP 200 means the batch ran; individual items can still fail. You are billed 1 credit per status: "ok" item, 0 for error items.

curl -X POST "https://api.ytapi.dev/v1/transcripts/batch" \
  -H "Authorization: Bearer yta_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"video_ids":["dQw4w9WgXcQ","dQw4w9WgXcQ"],"lang":"en"}'
200 OK (Batch Response)
{
  "results": [
    {
      "video_id": "dQw4w9WgXcQ",
      "status": "ok",
      "transcript": {
        "video_id": "dQw4w9WgXcQ",
        "lang": "en",
        "segments": [{ "start": 0.0, "duration": 4.2, "text": "..." }]
      }
    },
    {
      "video_id": "dQw4w9WgXcQ",
      "status": "ok",
      "transcript": {
        "video_id": "dQw4w9WgXcQ",
        "lang": "en",
        "segments": [{ "start": 0.0, "duration": 3.5, "text": "..." }]
      }
    }
  ]
}