Fetch a transcript
Fetch a video's transcript as timestamped segments, in the best available language from your preference list.
GET /v1/youtube/video/{video_id}/transcript
Path parameter
| Parameter | Description |
|---|---|
video_id | The 11-character video id, e.g. dQw4w9WgXcQ. See identifiers. |
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
languages | string | en | Preferred transcript languages as comma-separated codes, in order of preference. The first available match is returned, e.g. en or en,es. |
Discover available languages first
Use list transcript tracks to see which languages a video offers before requesting a specific one.
Example
curl -G "$LISTENX_BASE/v1/youtube/video/abc123XYZ01/transcript" \
-H "X-API-Key: $LISTENX_KEY" \
--data-urlencode 'languages=en,es'
Response
{
"video": "abc123XYZ01",
"language": "English",
"language_code": "en",
"is_generated": true,
"segment_count": 412,
"segments": [
{ "text": "Hello and welcome back to the channel", "start": 0.0, "duration": 2.48 },
{ "text": "today we're testing three electric cars", "start": 2.48, "duration": 3.12 }
],
"billing": {
"endpoint": "youtube.transcript",
"units": 1,
"unit_price": "0.010000",
"amount": "0.010000",
"balance_after": "19.990000",
"request_id": "…"
}
}
Fields
| Field | Description |
|---|---|
video | The video id. |
language | Transcript language name, e.g. English. |
language_code | Transcript language code, e.g. en. |
is_generated | true if auto-generated rather than creator-provided. |
segment_count | Number of segments. |
segments[] | Transcript segments. |
Segment
| Field | Description |
|---|---|
text | Transcript text for the segment. |
start | Start time, in seconds from the video start. |
duration | Segment duration, in seconds. |
Each segment's start can be used to build a timestamped playback link into the
source video.
Billing
Billed per request — 1 unit per call. See Billing.
Errors
| HTTP | code | Meaning |
|---|---|---|
| 404 | not_found | No transcript is available (none published, or disabled for the video). |
| 429 | upstream_rate_limited | Transient upstream block — retry with backoff. |