DEV Community

Charbel Daccache
Charbel Daccache

Posted on

How to Get a Transcript of a TikTok, Instagram Reel or YouTube Short (with Python)

To get a transcript of a TikTok, Instagram Reel, YouTube Short or X video, read the platform's own subtitles when they exist, and transcribe the audio with speech-to-text when they don't. This guide shows how to do both automatically with one API call, for a list of links or a creator's latest videos, and get back clean text with timestamps.

This is part 2 of "How my fun projects turned into APIs". Each post takes one side project, explains how it works, and ends with something you can call from your own code. Part 1 covered finding TikTok creator emails.

Table of contents

  1. Why short video transcripts are hard to get
  2. How the video transcript scraper works
  3. How to get a video transcript in 4 steps
  4. How to get TikTok and Instagram transcripts with Python
  5. How to get video transcripts with JavaScript
  6. What data you get for each video
  7. How much it costs
  8. FAQ

Why short video transcripts are hard to get

For long YouTube videos, transcripts are easy: there's a button. For short-form video, every platform is different:

  • TikTok has captions on some videos and none on others.
  • YouTube Shorts usually have auto-captions, but there's no easy way to pull them in bulk.
  • Instagram Reels publish no subtitles at all.
  • X (Twitter) videos publish none either.

So you end up with four tools, four formats, and a lot of copy-paste.

The project that started it

After the pet site from part 1, my next weekend project was a small data study: do TikTok recipes actually match the classic versions of the same dishes on big recipe sites? I wanted to compare ingredients and steps across a few hundred cooking videos.

The captions were useless for that. Half of them said "recipe in the comments" or just listed hashtags. The real recipe was in what the creator said. So I needed what was spoken in each video, as text, for TikTok, Reels and Shorts at once.

I started with TikTok's own captions, which were fast and free when they existed. Then I hit the first Instagram Reel and found there were no captions to read. So I added a fallback: download the audio and run it through Whisper speech-to-text. Then I added YouTube, then X, and put everything in the same output format.

When the study was done, the transcript tool was more useful than the study. So I turned it into a public API.

How the video transcript scraper works

The tool is an Apify Actor called Video Transcript Scraper. It reads public videos as a logged-out visitor, so it needs no account, no cookies and no API key for any platform.

1. Platform subtitles first

TikTok captions and YouTube captions are the cheapest and most accurate source, because the creator or the platform already did the work. When they exist, the scraper uses them. Each row says whether the subtitles were written by the creator (creator) or generated by the platform (auto).

2. Whisper speech-to-text as the fallback

When a video has no subtitles (every Instagram Reel, X videos, and TikToks without captions), the scraper transcribes the audio with Whisper large-v3 turbo. It handles 90+ languages and is very accurate on clear speech. Every row says which method was used in transcriptSource, so you always know where the text came from.

3. Videos by link or by creator

You can paste video links, or paste a creator's profile and take their latest videos. That makes it easy to transcribe a creator's whole recent output in one run.

How to get a video transcript in 4 steps

  1. Create a free Apify account. The free plan's monthly credit covers hundreds of transcripts.
  2. Open Video Transcript Scraper and click Try for free.
  3. Paste this input (switch the input editor to JSON):
{
  "urls": [
    "https://www.tiktok.com/@garyvee/video/7696603359335288078",
    "https://www.instagram.com/reel/Dd-VQPnRz0t/",
    "https://www.youtube.com/shorts/aNI2jv7lBPQ"
  ],
  "speechToText": "fallback",
  "includeSegments": true
}
Enter fullscreen mode Exit fullscreen mode
  1. Click Start. A few videos take seconds. Export the results as JSON, CSV or Excel, or read them through the API.

To transcribe a creator's latest videos instead, use profiles:

{
  "profiles": ["https://www.tiktok.com/@garyvee", "https://www.youtube.com/@MrBeast/shorts"],
  "maxVideosPerProfile": 10,
  "speechToText": "fallback"
}
Enter fullscreen mode Exit fullscreen mode

How to get TikTok and Instagram transcripts with Python

Install the client with pip install apify-client, then:

from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run = client.actor("scrape-lads/video-transcript-scraper").call(run_input={
    "urls": [
        "https://www.tiktok.com/@garyvee/video/7696603359335288078",
        "https://www.instagram.com/reel/Dd-VQPnRz0t/",
    ],
    "speechToText": "fallback",
})

for video in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(video["platform"], video["transcriptSource"])
    print(video["transcript"][:200], "\n")
Enter fullscreen mode Exit fullscreen mode

Your API token is in Apify Console under Settings → API & Integrations.

How to get video transcripts with JavaScript

Install the client with npm install apify-client, then:

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('scrape-lads/video-transcript-scraper').call({
  profiles: ['https://www.tiktok.com/@garyvee'],
  maxVideosPerProfile: 5,
  speechToText: 'fallback',
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((v) => console.log(v.url, v.wordCount, v.transcript.slice(0, 120)));
Enter fullscreen mode Exit fullscreen mode

What data you get for each video

One row per video, in the same format for all four platforms. A real result for an Instagram Reel:

{
  "url": "https://www.instagram.com/reel/Dd-VQPnRz0t/",
  "platform": "instagram",
  "status": "success",
  "author": "feelgoodfoodie",
  "durationSec": 30,
  "language": "en",
  "transcript": "If you want an easier way to cut spaghetti squash, microwave it first for three minutes. Then it's so much easier to cut in half...",
  "segments": [
    { "start": 0, "end": 2.5, "text": "If you want an easier way to cut spaghetti squash," },
    { "start": 2.5, "end": 4.4, "text": "microwave it first for three minutes." }
  ],
  "wordCount": 100,
  "transcriptSource": "speech-to-text",
  "stats": { "views": 171362, "likes": 2831, "comments": 357, "shares": null }
}
Enter fullscreen mode Exit fullscreen mode
Field What it is
transcript The full transcript as one text
segments { start, end, text } with times in seconds
transcriptSource subtitles (platform captions) or speech-to-text (Whisper)
subtitleKind creator or auto
language Two-letter language of the transcript
author, caption, durationSec, publishedAt Video details
stats Views, likes, comments and shares, when the platform shows them
status, errorCode success, no_transcript or failed, with a reason

What people use it for

  • AI and RAG: feed creator videos into a knowledge base or a custom GPT.
  • Content research: see what top creators actually say in their hooks and calls to action.
  • Repurposing: turn short videos into blog posts, newsletters and captions.
  • Brand monitoring: search spoken mentions of products or competitors.

How much it costs

You pay per transcript, with no subscription:

  • $2 per 1,000 subtitle transcripts (TikTok and YouTube videos with captions)
  • $5 per 1,000 speech-to-text transcripts (Reels, X videos, videos without captions), covering the first minute of audio. Longer videos add $0.0025 per extra minute.
  • $0.005 per run
  • Failed, private, removed and silent videos are free

Example: 1,000 TikTok transcripts plus 1,000 Instagram Reels under a minute cost about $7.

FAQ

How do I get the transcript of an Instagram Reel?

Instagram doesn't publish subtitles for Reels, so the only way is to transcribe the audio. Paste the Reel link into the scraper and leave speech-to-text on "fallback". It returns the spoken text with timestamps.

Can I get a transcript of a TikTok video?

Yes. If the TikTok has captions, the scraper reads them directly. If it doesn't, it transcribes the audio with Whisper. Either way you get the same output format.

Is there an official API for TikTok or Instagram transcripts?

No. TikTok, Instagram and X have no public transcript API, and YouTube's Data API only lets video owners download captions. This scraper reads public subtitles where they exist and transcribes the speech where they don't.

Which languages are supported?

Whisper handles 90+ languages. Set the language field (for example es) to pick a specific subtitle track or help Whisper with a less common language.

Which videos can't be transcribed?

Private, deleted and age-restricted videos. Music-only videos come back as no_speech. None of these are charged.

Is it legal to scrape video transcripts?

The scraper only reads public videos anyone can watch without logging in. You are responsible for how you use the text: respect copyright and platform terms, and don't republish creators' content without permission.

Try it

Next in the series: the transcripts gave me the words, but I still had to turn them into actual recipes. Part 3 is about the tool that does that: video in, structured recipe JSON out.

Top comments (0)