Get transcript
get_transcriptFetch the transcript or subtitles of any YouTube video using a URL or ID, in text, JSON, SRT, VTT, or XML, with title and duration metadata in the same call.
Instructions
Get the transcript (subtitles) of a YouTube video. Accepts a video id or any YouTube URL. Set video_metadata=true to get the title, channel and duration in the SAME call — do not call get_video_info first, that is a second billed call for data this one already returns. format=text returns plain readable text (default, cheapest to read); format=json returns timed segments with start/duration in seconds; srt/vtt return ready subtitle file bodies and srv3 the raw YouTube XML. Prefer text unless you need timestamps or a file. Costs 1 credit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | Track kind. Omit to prefer a manual track and fall back to auto | |
| lang | No | Language code of the track, e.g. 'en', 'de'. Default 'en'. | |
| video | Yes | YouTube video id or URL | |
| format | No | 'text' = plain text (default), 'json' = timed segments, 'srt'/'vtt' = subtitle file body, 'srv3' = raw YouTube XML (srv3 does not combine with segment) | |
| segment | No | Max characters per segment. Raise it when chunking the transcript for embeddings or retrieval — 500-1500 gives chunks with enough context; lower it for subtitle-sized lines. Left out, an auto-generated track is cut into ~180-character segments and a manual one is returned exactly as its author broke it, so pass this whenever you need one size regardless of which track answers. | |
| video_metadata | No | Include the video's title, channel, duration and views alongside the transcript. Replaces a separate get_video_info call — same one credit either way. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | ||
| language | No | ||
| metadata | No | ||
| video_id | No | ||
| transcript | No | format=json: array of {text, start, duration} segments (seconds); text/srt/vtt/srv3: one string in that format | |
| available_langs | No |