YTAPI.devDocs
Last updated Sep 13, 2026
||MarkdownView as Markdown|Agent setup

Extract transcript

extractTranscript(params, options?): TranscriptResponse

POST/v1/transcripts1 Credit

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.

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.

transcripts:read
ParametersExpand Collapse
video_id:string

Body param:

11-character YouTube video ID or a full video URL.

format?:string

Body param:

Output format: word_timestamps, markdown, segments, sentences, text, srt, vtt, json3, or words. Default word_timestamps.

word_level?:boolean

Body 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?:string

Body param:

Track selection: manual_first, asr_first, manual_only, or asr_only. Default manual_first.

deadline_ms?:number

Body param:

Max upstream processing deadline in milliseconds before fallback. Default 10000.

ReturnsExpand Collapse
video_id:string

Echoed YouTube video ID.

language:string

Negotiated ISO language code, for example en or zh-Hans.

track_type:string

ASR (auto-generated) or MANUAL (creator-uploaded).

format:string

Format actually returned.

data:object

Payload shape depends on format. Markdown responses include token estimates for LLM windows.

markdown?:string

Structured paragraphs with timestamp references. Present when format is markdown.

estimated_tokens?:number

Approximate 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.