Skip to main content
POST https://api.transcriptmagic.com/api/youtube/transcript
Works on watch URLs, youtu.be short links, /shorts/ paths, and m.youtube.com mobile URLs.

Request

curl -X POST https://api.transcriptmagic.com/api/youtube/transcript \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}'

Response

{
  "success": true,
  "type": "video",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "transcript": [
    {
      "text": "We're no strangers to love",
      "startMs": "18800",
      "endMs": "25960",
      "startTimeText": "0:18"
    },
    {
      "text": "You know the rules and so do I",
      "startMs": "21800",
      "endMs": "29119",
      "startTimeText": "0:21"
    }
  ],
  "transcript_only_text": "We're no strangers to love. You know the rules and so do I...",
  "language": "English",
  "videoId": "dQw4w9WgXcQ",
  "captionTracks": [
    {
      "baseUrl": "https://www.youtube.com/api/timedtext?...",
      "name": { "simpleText": "English" },
      "languageCode": "en",
      "isTranslatable": true
    }
  ],
  "credits": 997
}
The YouTube endpoint returns the per-line timed array directly as transcript — there is no separate segments field. If you just want the text without timings, read transcript_only_text instead.

Supported URL formats

FormatExample
Standard watch URLhttps://www.youtube.com/watch?v=…
YouTube Shortshttps://www.youtube.com/shorts/…
youtu.be short linkhttps://youtu.be/…
Mobile URLhttps://m.youtube.com/watch?v=…
Live replay (with captions)Any of the above, completed live streams

FAQ

Yes. Any public YouTube URL works — Shorts (youtube.com/shorts/…), long-form videos, live replays, mobile links, and youtu.be short links are all accepted. Just POST the full URL.
Unlisted videos work as long as you provide the full URL. Age-restricted videos that require sign-in are not supported — the API can only fetch publicly viewable captions.
Whichever caption track YouTube exposes — that covers 100+ languages for auto-captions and every language creators manually publish. The language field on the response tells you which track was returned, and captionTracks lists every available track for the video. Translation is a separate step you run after fetching.
Yes. Each item in the transcript array includes startMs, endMs, and startTimeText — build SRT/VTT, chaptered summaries, or jump-to-moment UI directly from the response. See the response schema page for an SRT generator example.
When the creator has uploaded manual captions, accuracy is essentially 100%. When only YouTube auto-captions exist, accuracy matches YouTube’s own ASR — very good for clear speech, weaker on heavy music.