crawlfetch

Transcribe YouTube and TikTok videos with Whisper

Speech-to-text models only need the audio. Fetching the audio track directly — instead of the full video — makes transcription pipelines faster and cheaper. CrawlFetch returns it from one request.

Pipeline

  1. Resolve the URL with format=m4a (or read audioUrl).
  2. Download the audio (or stream it straight into your STT provider if it accepts a URL).
  3. Optionally downsample to 16 kHz mono — what most speech models expect — with ffmpeg.
  4. Send the file to Whisper (local or hosted) or any speech-to-text API and store the transcript with the video ID.

Example with local Whisper

import os, subprocess, requests
import whisper # pip install openai-whisper
v = requests.get(
"https://api.crawlfetch.com/v1/resolve",
params={"url": "https://youtu.be/aqz-KE-bpKQ", "format": "m4a"},
headers={"Authorization": f"Bearer {os.environ['CRAWLFETCH_KEY']}"},
timeout=15,
).json()
with requests.get(v["downloadUrl"], stream=True) as r, open("a.m4a", "wb") as f:
for c in r.iter_content(1 << 20):
f.write(c)
subprocess.run(["ffmpeg", "-y", "-i", "a.m4a", "-ar", "16000", "-ac", "1", "a.wav"], check=True)
print(whisper.load_model("base").transcribe("a.wav")["text"])

FAQ

Does the API return subtitles or transcripts?

No — it returns media and metadata. Use a speech-to-text model on the audio.

Why downsample to 16 kHz?

Most speech models resample to 16 kHz internally; doing it first reduces upload size.

Related

Last updated 2026-10-25

Add video downloads to your product today.

1,000 credits on signup plus 500 every month. That is roughly 180 YouTube clips to start, with no card.

Create free account