Extract transcript
extractTranscript(params, options?): TranscriptResponse
This is the primary transcript endpoint. Submit a JSON body with the video id and optional format, language, and track policy. GET /v1/transcripts runs the same extractor with query parameters.
Successful requests consume 1 credit. Missing captions return 404 and are not billed.
Security
API Token
The preferred authorization scheme for the YouTube Transcript API. Create a key with transcripts:read in the developer dashboard.
Example: Authorization: Bearer YOUR_API_KEY
See Authentication for scopes and rate limits.
Accepted permissions (at least one required)
ParametersExpand Collapse
video_id:stringBody param:
11-character YouTube video ID or a full video URL.
format?:stringBody param:
Output format: word_timestamps, markdown, segments, sentences, text, srt, vtt, json3, or words. Default word_timestamps.
word_level?:booleanBody param:
Include millisecond word offsets. Only genuine ASR word-level tracks populate words. Default false.
languages?:string[]Body param:
Prioritized ISO language codes, for example ["en", "es"]. Default ["auto"].
track_policy?:stringBody param:
Track selection: manual_first, asr_first, manual_only, or asr_only. Default manual_first.
deadline_ms?:numberBody param:
Max upstream processing deadline in milliseconds before fallback. Default 10000.
ReturnsExpand Collapse
video_id:stringEchoed YouTube video ID.
language:stringNegotiated ISO language code, for example en or zh-Hans.
track_type:stringASR (auto-generated) or MANUAL (creator-uploaded).
format:stringFormat actually returned.
data:objectPayload shape depends on format. Markdown responses include token estimates for LLM windows.
markdown?:stringStructured paragraphs with timestamp references. Present when format is markdown.
estimated_tokens?:numberApproximate token count of the markdown payload.
segments?:Segment[]Timed caption segments. Each item may include a words array when word_level is true on ASR tracks.
Word-level tracks
If a video only has manual subtitles without word-level alignment, the API returns segments without fabricating a words array.