Skip to content
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.

Supported URLs

All URL formats
  • Watch URLhttps://www.youtube.com/watch?v=dQw4w9WgXcQ
  • Short URLhttps://youtu.be/dQw4w9WgXcQ
  • Shorts URLhttps://www.youtube.com/shorts/dQw4w9WgXcQ
  • Embed URLhttps://www.youtube.com/embed/dQw4w9WgXcQ
  • Legacy /v/ URLhttps://www.youtube.com/v/dQw4w9WgXcQ
  • Completed live URLhttps://www.youtube.com/live/dQw4w9WgXcQ
  • Video IDdQw4w9WgXcQ

Body parameters

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