BlogCore API

Video Transcription API: Turn Any Video Link Into Text

Why speech-to-text APIs still need you to fetch the video, and one call that turns a YouTube, TikTok, Loom or podcast link into a timestamped transcript.

On this page7 sections

If your app needs the words in a video, to summarize it, search it, caption it or feed it to an LLM, the input is almost always a link: a YouTube video, a TikTok, a Loom, an X post, a podcast episode. That's where most transcription setups have a gap. They're good at turning audio into text, but nobody gives them the audio.

What speech-to-text APIs expect

Dedicated speech-to-text APIs such as AssemblyAI, Deepgram and OpenAI's transcription models are accurate and well documented. What they take is an audio or video file you upload, or a URL that points straight at a media file. A YouTube watch page or a TikTok share link isn't a media file, so before you can call them you need a step that:

  • resolves the page link to the actual media, which is different for every site,
  • downloads it and pulls out the audio,
  • keeps working when the site changes its pages, and
  • works from your server, where many sites block or challenge datacenter traffic that looks fine from your laptop.

That fetch step is the part that breaks every few weeks. It's also wasted money when the video already has captions: running speech-to-text on a YouTube video that has a caption track costs more and is often less accurate than the captions.

One call from the link

Importly takes the page link and returns a timestamped transcript. With "mode": "auto" it uses the video's captions when there are some ($0.003) and runs speech-to-text when there aren't ($0.01 a minute), in the same request. "wait": true returns the finished transcript in the response:

bash
curl -X POST https://api.importly.io/transcribe \
  -H "Authorization: Bearer $IMPORTLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "mode": "auto",
    "wait": true,
    "maxCostDollars": 0.5
  }'

Every transcript has the same shape, whatever the site and whichever source produced it:

json
{
  "text": "All right, so here we are, in front of the elephants...",
  "source": "platform_captions",
  "captionKind": "manual",
  "language": "en",
  "duration": 19,
  "data": {
    "segments": [
      { "start": 1.2, "end": 3.36, "text": "All right, so here we are, in front of the elephants" }
    ]
  },
  "costInDollars": 0.003
}

source is platform_captions when captions were used and importly when speech-to-text ran. Your code reads text or data.segments either way. The full field list is in the transcripts docs.

Things that come up in production

  • Long videos. "wait": true holds the request for 30 seconds (a number asks for up to 60). A long video may still be running then; the response has a jobId, and you collect the result by polling GET /transcribe/status or with a webhookUrl.
  • Cost control. maxCostDollars caps what one request may cost, so a three-hour stream someone pasted fails with MAX_COST_EXCEEDED instead of running up a bill. Check the length first with POST /metadata/basic ($0.003) if you want to show the user a price.
  • Captions only. Send "mode": "captions" if you never want speech-to-text. A video without captions then fails with a price quote and isn't charged.
  • Language. Pass language (for example es) for non-English videos. It picks the caption track, and tells speech-to-text what to expect; without it, built-in speech-to-text assumes English.
  • Your own speech-to-text account. If you already pay AssemblyAI, Deepgram or OpenAI, pass provider and your key and Importly handles the fetch for $0.005 a minute, plus your provider's own fees.
  • Failures. Private, deleted and login-only videos fail with a clear code you can show the user. Failed transcriptions are refunded automatically.
  • The file too. If your app also keeps the video, add "includeTranscript": true to an import and get the file and the transcript from one job.

Which sites

Any public video or audio link on YouTube, TikTok, X, Instagram, Vimeo, Facebook, Reddit, Loom, LinkedIn, SoundCloud, Twitch, podcast episode pages and over 1,000 other sites, plus direct links to media files. Short and mobile links work too. See supported sites.

What it costs

TranscriptPrice
From the video's captions$0.003 per video
Importly speech-to-text$0.01 per minute, fetching included, $0.01 minimum
Your own speech-to-text key$0.005 per minute, plus your provider's fees

A 10-minute video with captions costs $0.003; without captions it's $0.10. It's free to try, no card required. See pricing.

Have your AI agent build it in

Connect https://mcp.importly.io/mcp to Claude Code, Cursor or another coding agent and ask it to add video transcripts to your app. It gets working code for your stack, writes the integration and tests real calls with your API key, and your backend uses the same key. The steps are in Have your agent build Importly into your app.

FAQ

Can I send a YouTube link straight to a speech-to-text API?

Usually not. Speech-to-text APIs take an uploaded file or a direct link to a media file. A YouTube page link has to be resolved and downloaded first, which is the step Importly does for you.

Is it cheaper to use captions or speech-to-text?

Captions, when the video has them: $0.003 a video against $0.01 a minute. "mode": "auto" uses captions first and only runs speech-to-text when there are none.

Does it work from serverless functions?

Yes. It's an HTTPS call, so it works the same from Vercel, Lambda, Cloudflare Workers or a container. Use wait for short videos and a webhook for long ones, so your function doesn't time out.

Can I get timestamps?

Yes. data.segments has start and end in seconds for every caption line or spoken sentence.

Related: Best YouTube transcript API, TikTok transcript API, Podcast transcription API, Loom video download API.

Keep reading

Put video and audio links to work in your app

One API for files, transcripts and metadata. Free to try, no card required.

Try free →