Docs

Your first transcript with the API

Three calls: get a token once, queue a video, poll until it is done.

1. Get a token

Tokens live on your account page and start with ytt_. You see the whole token once, when you create it, so put it straight into your environment. It spends the same minutes as the site, so nothing else has to be set up. Create your token.

2. Queue a video, then poll it

The queue call answers immediately with an id. That is not the transcript: the work runs after it, and you read the job until its state is done or failed. Every 3 seconds is plenty.

curl
curl -X POST https://api.youtubetotext.ai/v1/api/transcribe \
  -H "Authorization: Bearer ytt_<your-token>" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}'

3. Read the result

A finished job carries the text on txt, the cue formats on srt and webvtt, and 17 more fields including duration, is_preview and translations. A job that stopped with failed puts the reason on error and costs nothing.

Poll
curl https://api.youtubetotext.ai/v1/api/transcription/<job-id> \
  -H "Authorization: Bearer ytt_<your-token>"

Next