Skip to content

Docs

GET /v1/transcripts/{videoId}

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).

Response fields

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

GET/v1/transcripts/dQw4w9WgXcQ
1curl "https://api.ytapi.dev/v1/transcripts/dQw4w9WgXcQ?lang=en&format=json" \
2  -H "Authorization: Bearer yta_YOUR_KEY"
200 OK
1{
2  "video_id": "dQw4w9WgXcQ",
3  "lang": "en",
4  "is_auto_generated": false,
5  "is_translated": false,
6  "segments": [
7    { "start": 0.0, "duration": 4.2, "text": "First line of the speech" },
8    { "start": 4.2, "duration": 3.1, "text": "Introduction to chapter", "type": "heading" }
9  ]
10}

GET /v1/transcripts/{videoId}/languages

GET/v1/transcripts/{videoId}/languages

Probe available tracks and ASR status before fetching full transcripts (0 credits / Free).

Parameters

ParameterInTypeDescription
videoIdpathstring (11 chars)YouTube video ID.
GET/v1/transcripts/dQw4w9WgXcQ/languages
1curl "https://api.ytapi.dev/v1/transcripts/dQw4w9WgXcQ/languages" \
2  -H "Authorization: Bearer yta_YOUR_KEY"

POST /v1/transcripts/batch

POST/v1/transcripts/batch

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.

Request body

ParameterInTypeDescription
video_idsbodystring[] (≤50)Array of YouTube video IDs.
langbodystringBCP-47 language code.
POST/v1/transcripts/batch
1curl -X POST "https://api.ytapi.dev/v1/transcripts/batch" \
2  -H "Authorization: Bearer yta_YOUR_KEY" \
3  -H "Content-Type: application/json" \
4  -d '{"video_ids":["dQw4w9WgXcQ","dQw4w9WgXcQ"],"lang":"en"}'
200 OK (Batch Response)
1{
2  "results": [
3    {
4      "video_id": "dQw4w9WgXcQ",
5      "status": "ok",
6      "transcript": {
7        "video_id": "dQw4w9WgXcQ",
8        "lang": "en",
9        "segments": [{ "start": 0.0, "duration": 4.2, "text": "..." }]
10      }
11    }
12  ]
13}