Transcribe Any Social Video — YouTube, TikTok, Instagram, X — With One API Call
Disclosure: the Supadata links in this post are affiliate links. If you create an account through them we may receive account credits, at no extra cost to you. We use Supadata in our own production pipeline and only recommend tools we actually rely on.
If you’ve ever tried to pull a transcript out of a TikTok, an Instagram Reel, a Facebook video, an X post, and a YouTube clip, you already know the pain: that’s potentially five different scrapers, five sets of breakage, and a weekend you won’t get back. We ran into exactly this while building an internal “video → text” service, and the thing that finally made it boring (in the best way) was Supadata — one API that fetches a transcript from any of those platforms, and generates one with AI when no captions exist.
This tutorial shows you how to go from zero to a working, multi-platform transcriber in about ten minutes.
What you’ll need
- A Supadata API key — grab one here (the free tier is enough to follow along).
- Python 3 and the
requestslibrary:pip install requests. - Your key in an environment variable so it never ends up in your code:
export SUPADATA_API_KEY="your_key_here"
The basics
Supadata uses a simple header for auth — x-api-key (not a Bearer token) — and everything lives under https://api.supadata.ai/v1. Before you spend anything, check your balance; the /me endpoint is free:
curl -s "https://api.supadata.ai/v1/me" \
-H "x-api-key: $SUPADATA_API_KEY"
# => {"plan":"Free (100/mo)","maxCredits":100,"usedCredits":0}
A single transcript call looks like this (-G --data-urlencode safely encodes the video URL into the query string):
curl -s -G "https://api.supadata.ai/v1/transcript" \
--data-urlencode "url=https://www.youtube.com/watch?v=dQw4w9WgXcQ" \
--data-urlencode "mode=auto" \
--data-urlencode "text=true" \
-H "x-api-key: $SUPADATA_API_KEY"
Three things worth knowing about that call:
modecontrols behaviour.nativereturns an existing caption track (cheap — 1 credit).generateruns AI speech-to-text from the audio when there are no captions.autotries native first and falls back to generate for you.text=truegives you one clean string; omit it and you get timestamped segments instead.- It may be sync or async. Short clips return the transcript immediately (HTTP 200). Longer ones return 202 with a
jobIdyou poll until it’s done.
A real, reusable transcriber
Here’s a small Python helper that handles every case — captions, AI generation, and the async job — so you can throw any supported URL at it:
import os, time, requests
BASE = "https://api.supadata.ai/v1"
HEADERS = {"x-api-key": os.environ["SUPADATA_API_KEY"]}
def get_transcript(url, mode="auto", text=True):
"""Return a transcript for a YouTube/TikTok/Instagram/Facebook/X/file URL."""
r = requests.get(f"{BASE}/transcript", headers=HEADERS, params={
"url": url, "mode": mode, "text": str(text).lower(),
}, timeout=120) # AI generation can hold the connection ~90s before answering
if r.status_code == 206:
# native caption miss — note this still costs 1 credit
raise RuntimeError("No existing captions. Retry with mode='generate'.")
r.raise_for_status()
data = r.json()
# Short clips come back immediately; longer ones hand you a jobId to poll.
if "jobId" in data:
return poll_job(data["jobId"])
return data["content"]
def poll_job(job_id, timeout=300, interval=5):
deadline = time.time() + timeout
while time.time() < deadline:
data = requests.get(f"{BASE}/transcript/{job_id}", headers=HEADERS, timeout=30).json()
status = data.get("status")
if status == "completed":
return data["content"]
if status == "failed":
raise RuntimeError(f"Transcription failed: {data}")
time.sleep(interval)
raise TimeoutError("Transcript job timed out")
if __name__ == "__main__":
for url in [
"https://www.youtube.com/watch?v=dQw4w9WgXcQ",
# Add any real TikTok, Instagram, Facebook or X video URL here, e.g.
# "https://www.tiktok.com/@username/video/1234567890123456789",
]:
print(f"\n=== {url} ===")
print(get_transcript(url)[:500])
Point it at a YouTube link and a TikTok link and it just works — same code, different platform. That’s the whole pitch.
Two gotchas that will save you credits
While building on Supadata we learned a couple of things the hard way:
- A caption miss still costs a credit. When you ask for
mode=nativeand the video has no captions, the API returns206 transcript-unavailable— and that still bills one credit. So don’t loopnativeacross a big list “just to check”; useautoor go straight togeneratefor platforms that rarely have captions (TikTok, Instagram, Facebook). - AI generation is a flat, cheap cost per call, not per minute. In our testing, generating a transcript cost the same whether the video was 20 seconds or 15 minutes — so transcribing long videos is surprisingly affordable. Check
GET /mebefore a big batch and you’ll always know where you stand.
Where to go from here
From this one building block you can caption a content library, feed transcripts into an LLM for summaries, build a searchable archive of your own videos, or monitor what competitors are posting — all without maintaining a single scraper. Add the /metadata endpoint (title, author, stats) and you’ve got a complete ingestion layer.
If you want to try it, you can create a Supadata account here and run the code above with the free tier today.
We use Supadata in production for exactly this workflow. The links above are affiliate links — signing up through them supports this site at no cost to you.