GitHubLog in
YouTube Transcript API

YouTube Transcript API

Returns the transcript of a YouTube video, as plain text or timestamped segments. The video is given as a URL or an 11-character id. The caption track is used when the video has one; otherwise AI Fallback Transcription transcribes the audio (on by default), inline for videos under 20 minutes and as a job for longer ones.

Caption transcript1 creditManual or auto-generated track
AI Fallback Transcription1 / 5 minOn by default with no captions; on delivery, minimum 1
Failed requestsFreeA request that fails costs nothing
Supported URLswatchyoutu.be/shorts/embed/live//v/video idAll URL formats
POST/api/v2/transcripts/videoidempotent

How a request resolves

  1. Caption track foundManual or auto-generated captions are read and returned.200
  2. No captions, under 20 minutesAI Fallback Transcription runs while the request is held open for up to 45 seconds. No polling.200
  3. 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

Body parameters

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 (see mode).

curl https://transcriptfetch.com/api/v2/transcripts/video \
  -H "Authorization: Bearer $TRANSCRIPTFETCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"video":"dQw4w9WgXcQ"}'
SuccessExample response envelope
{
  "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

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.