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
| Parameter | In | Type | Description |
|---|---|---|---|
| videoId | path | string (11 chars) | YouTube video ID. |
| lang | query | string | BCP-47 language code. Defaults to the first available track. Exact match first, then language prefix (en-US falls back to en). |
| format | query | json | text | srt | vtt | Output format. Default json; text/srt/vtt return text/plain formatted subtitles. |
| translate | query | string | Translate 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}/languagesProbe available tracks and ASR status before fetching full transcripts (0 credits / Free).
Parameters
| Parameter | In | Type | Description |
|---|---|---|---|
| videoId | path | string (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/batchPOST 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
| Parameter | In | Type | Description |
|---|---|---|---|
| video_ids | body | string[] (≤50) | Array of YouTube video IDs. |
| lang | body | string | BCP-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}