Supported URLs
All URL formats- Watch URL
https://www.youtube.com/watch?v=dQw4w9WgXcQ - Short URL
https://youtu.be/dQw4w9WgXcQ - Shorts URL
https://www.youtube.com/shorts/dQw4w9WgXcQ - Embed URL
https://www.youtube.com/embed/dQw4w9WgXcQ - Legacy /v/ URL
https://www.youtube.com/v/dQw4w9WgXcQ - Completed live URL
https://www.youtube.com/live/dQw4w9WgXcQ - Video ID
dQw4w9WgXcQ
Body parameters
- type
string- required
true- description
- A video URL or 11-character YouTube video ID.
- Accepts YouTube (watch, youtu.be, /shorts/), TikTok, and Instagram URLs, plus direct media file URLs (mp4/mp3/wav/…).
- Under the default
mode, a video without captions is transcribed by AI Fallback Transcription (seemode).
- type
string- required
false- default
"auto"- values
captionsaudioauto- description
- Where the text may come from.
"auto"(the default) reads the caption track, and when there is none transcribes theaudiowith AI Fallback Transcription, charged on delivery at 1 credit per started 5 minutes ofaudio, minimum 1 (a 20-minute video is 4; the 4-hour cap is 48)."captions"reads an existing caption track only and answers 422no_captionswhen there is none: the one mode that never charges foraudio."audio"skipscaptionsand always uses AI Fallback Transcription, at the same rate.- A caption fetch is always 1 credit.
- AI Fallback Transcription on short media may finish inline after a wait of up to 45 seconds; longer work returns 202 with a job to poll or deliver by callback.
- type
boolean- required
false- default
true- description
- Which form the transcript comes back in.
true(the default) returns thesegmentsarray, each with start, duration and text.falsereturns a single joinedtextstring instead.- On the single-transcript 200 exactly one of the two is present, never both, since segments already contain every word the joined text does; job results and batch entries carry both text and segments.
- The older strings
"segment"and"none"mean the same two things and are still accepted.
- type
boolean- required
false- default
false- description
- Beta.
trueaddsmarkdownto the transcript: a title line, a line with the channel, length and link, then paragraphs that each open with their time (linked to that moment on YouTube).- Works with
timestampson or off. - Free.
- Absent by default, so leaving it out changes nothing.
- type
boolean | { max_tokens, overlap_tokens }- required
false- description
- Beta.
- Adds
chunks: the transcript split into pieces sized for an embedding model or vector store. - Each piece has index, text, start and end (seconds,
nullwhen the transcript has no timings), url (opens the video at start on YouTube; the item's link on other platforms) and tokens. - Pieces break between caption lines, never mid-word, and overlap the previous piece slightly.
trueusesmax_tokens500 andoverlap_tokens50; an object sets either:max_tokens100 to 2000,overlap_tokens0 to 200 and smaller thanmax_tokens.- Tokens are counted with OpenAI's o200k_base encoding.
- Free.
- Absent by default.
- type
string (https URL)- required
false- description
- Where to POST the finished transcript when a request escalates to AI Fallback Transcription, instead of polling the job.
- The delivery body is a trimmed envelope - {ok, status,
job_id, data} on success, {ok, status,job_id, error} on failure - without the usage andrequest_idthe poll URL adds. - When a signing secret is configured on our side, the body is signed with HMAC-SHA256 over the exact bytes and sent as an X-TranscriptFetch-Signature: sha256=<hex> header so you can verify it came from us.
- Must be a public https URL on the standard port; the URL is checked again at delivery time, so an unreachable or private address still gets a 202 but never receives a delivery.
- The job stays pollable either way, so a missed delivery is never a lost transcript.
- type
boolean- required
false- default
false- description
- Legacy alias for
"mode", still supported. trueis identical to"mode":"audio"(always AI Fallback Transcription); omitted orfalseis"mode":"auto", the default, which still uses AI Fallback Transcription when a video has no captions.- Send one or the other, not both.
falsenever turned the fallback off, which is why the field was replaced: send"mode":"captions"for that.
- Legacy alias for
How a request resolves
- Caption track foundManual or auto-generated captions are read and returned.200
- No captions, under 20 minutesAI Fallback Transcription runs while the request is held open for up to 45 seconds. No polling.200
- Longer, or still running after 45 sAnswers with a job to poll, or POSTs the result to your callback_url. Retrying is safe and hits the cache once it is done.202
{
"ok": true,
"request_id": "req_…",
"data": {
"kind": "transcript",
"video_id": "dQw4w9WgXcQ",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"platform": "youtube",
"title": "Example video",
"channel": "Example Channel",
"duration": 212,
"language": "en",
"thumbnail_url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/mqdefault.jpg",
"source": "captions",
"segments": [
{
"start": 0,
"duration": 3.5,
"text": "We're no strangers to love"
}
]
},
"usage": {
"credits_spent": 1,
"balance": 99,
"bytes": 14233
}
}Every YouTube endpoint
- POSTTranscriptText or segments for a YouTube video.
- POSTSearchSearch YouTube with date and length filters.
- POSTChannel VideosList a YouTube channel's videos.
- POSTPlaylistList a playlist's videos, page by page.
- POSTShortsList a channel's Shorts to transcribe.
- POSTChannel MonitorNew uploads from a channel, by webhook.
Same call, other platforms:TikTok Transcript APIInstagram Transcript API
Frequently asked questions
Which YouTube URLs does the transcript endpoint accept?
Standard watch URLs, youtu.be short links, Shorts, embed and live URLs, and the bare video id. The full list, with an example of each, is on the YouTube URL formats page.
What happens when a YouTube video has no captions?
With the default mode, auto, AI Fallback Transcription transcribes the audio instead. Media under 20 minutes is held open for up to 45 seconds and returns the finished transcript inline; longer media, or a transcription still running when the hold expires, answers 202 with a job_id and poll_url. Send mode captions to fail with no_captions instead.
Do I get timestamps?
Yes by default: data.segments carries start, duration and text for every caption cue. Send timestamps false to get a single data.text string instead; a response never carries both.
How is a YouTube transcript billed?
A transcript served from captions costs 1 credit. One from AI Fallback Transcription is billed by duration, on delivery. A request that fails, or a video that is private, removed or otherwise unavailable, costs nothing.