Skip to main content

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​

ParameterDescription
video_idThe 11-character video id, e.g. dQw4w9WgXcQ. See identifiers.

Query parameters​

ParameterTypeDefaultDescription
languagesstringenPreferred 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​

FieldDescription
videoThe video id.
languageTranscript language name, e.g. English.
language_codeTranscript language code, e.g. en.
is_generatedtrue if auto-generated rather than creator-provided.
segment_countNumber of segments.
segments[]Transcript segments.

Segment​

FieldDescription
textTranscript text for the segment.
startStart time, in seconds from the video start.
durationSegment 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​

HTTPcodeMeaning
404not_foundNo transcript is available (none published, or disabled for the video).
429upstream_rate_limitedTransient upstream block — retry with backoff.