Call the YouTube transcript API from your code
POST the video URL with your API key, from Python or any HTTP client. wait=60 holds the request open for up to 60 seconds. Read an unfinished job later by id. The create-transcription API reference lists the request fields and status codes.
Create a key in the dashboard and use it from your server or script. Store the returned transcription id as soon as the request succeeds. A wait timeout is not a failed transcription: the job can continue after the HTTP response. Check its status through GET /v1/transcriptions/:id instead of making another create request.
Model the integration as a job lifecycle. Your application may see queued, fetching and transcribing before a final status. A completed job has a transcript to read; a failed job has an error to handle. Keep those outcomes distinct so a network delay or unavailable video does not appear to your users as an empty successful transcript.
curl -X POST "https://api.transcript1.com/v1/transcriptions?wait=60" \
-H "Authorization: Bearer $TRANSCRIPT1_API_KEY" \
-H "Content-Type: application/json" \
-d '{"platform":"youtube","url":"https://youtu.be/dQw4w9WgXcQ"}'Check transcript_source in the response
A transcript made from captions says so, and says whether the track was creator-uploaded or auto-generated. billed_minutes is the media duration rounded up. See the transcription object reference for all response fields.
Retain transcript_source and caption_kind when your application needs provenance. Creator captions preserve their published wording and do not provide word-level timings. Auto-generated captions provide word starts, while speech-to-text provides word start and end times with confidence. The JSON below illustrates the response shape rather than quoting the example video.
Do not treat the top-level transcript text as the only useful result. Segments carry start and end seconds that let you build a source-linked reader, align notes with playback or retrieve the relevant passage for an assistant. Read JSON with include=words only when your interface needs the additional word data.
{
"id": "tr_8fK2Lm0PqRsTuVwXyZaBcD",
"status": "completed",
"transcript_source": "youtube_captions",
"caption_kind": "auto_generated",
"language": "en",
"billed_minutes": 4,
"transcript": {
"text": "Welcome back to the channel. Today we are looking at how transcripts are made.",
"segments": [
{ "start": 0, "end": 4.2, "speaker": null, "language": "en", "text": "Welcome back to the channel." }
]
}
}Choose captions or AI transcription
source is auto by default. Use captions to fail with no_captions (and no charge) when a video has no usable track, or stt to always transcribe the audio. The source selection guide explains how language and speaker options affect that choice.
Use captions-only mode when your workflow specifically requires the published caption track. Use speech-to-text when you need a fresh audio transcript or speaker diarization. With auto, requesting diarize=true takes the speech-to-text path even if captions exist. Combining diarization with captions-only mode is rejected rather than silently dropping the speaker option.
The language option also affects source selection. A usable caption track must match the requested language, or the original video language when auto is selected. Automatically translated tracks are not used. A language hint for speech-to-text does not turn this endpoint into a translation service.
{
"platform": "youtube",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"source": "stt"
}Handle unavailable videos and repeat requests
Classify errors before retrying. A private video, an age restriction or an active livestream requires a different input. A captions-only no_captions result requires a decision about whether speech-to-text is acceptable. By contrast, a processing job should be read again by id. The error reference provides the codes your client should handle.
For a retriable create request, use the Idempotency-Key contract. Recent-result reuse is a separate option for matching an earlier video and option set. Also distinguish reused from cached: a cached transcript can still be billed as a new job, while reading an existing completed job does not spend minutes.
If you are building a multi-platform application, YouTube, X, TikTok and Bluesky support usable native captions with speech-to-text as the auto fallback. The same create endpoint accepts TikTok, Instagram and other supported links. Your input validation should follow the source capability matrix rather than offer an unsupported source combination.