API · YouTube
GET /youtube/videos/{id}/transcript
A YouTube video’s transcript: timestamped segments and full text, in a chosen language.
| |
|---|
| Request | GET /v1/youtube/videos/{id}/transcript |
| Operation id | youtube.video.transcript |
| Cost | 2 credits, refunded if the call fails |
| Auth | API key: Authorization: Bearer <key> or x-api-key. |
A YouTube video’s transcript: timestamped segments and full text, in a chosen language.
| Name | Type | Required | Description |
|---|
id | string | yes | A video or Short id, or any URL of it (watch, youtu.be, shorts, live, embed). Example: dQw4w9WgXcQ. |
| Name | Type | Required | Description |
|---|
language | string | no | ISO 639-1 language code (en, es, pt-BR). Example: en. |
original_audio | "0" | "1" | "true" | "false" | no | true: only the original spoken language (wins over language). One of 0, 1, true, false. |
| Status | Meaning | Schema |
|---|
200 | The transcript. | YouTubeTranscript |
400 | Invalid input. Nothing was charged. | Error |
401 | Missing or invalid API key. | Error |
402 | Not enough credits, a spend cap was reached, or payment is required. | Error |
403 | The target is private, or the account is suspended. | Error |
404 | The video, channel, playlist or post does not exist, was removed, or has nothing there. | Error |
429 | Too many requests. Wait for Retry-After seconds. | Error |
503 | YouTube is temporarily unavailable. Retryable; nothing was charged. | Error |
| Field | Type | Description |
|---|
kind | "youtube#transcript" | |
videoId | string | |
languageCode | string | |
languageName | string | |
isAutoGenerated | boolean | |
isTranslated | boolean | True when YouTube machine-translated the track into the asked language. |
text | string | The whole transcript, segments joined with spaces. |
segments | YouTubeTranscriptSegment[] | |
availableLanguages | YouTubeCaptionTrack[] | |
Errors use one shape everywhere; see Errors for every code and what to do.