[Home](/) / [How To](/how-to/) / Video transcripts

How to

# How to use a video transcript API in Python

Four platforms, four different ways captions break. One API call handles all of them.

**Short answer**

Send a mixed list of TikTok, Instagram, YouTube and X URLs to the **Video Transcript Scraper** with the Apify Python client. Each result says which platform it came from and whether the text came from subtitles or speech-to-text.

## A real use case

A research team collects videos about a product recall from four platforms. One script transcribes all 300 links and writes them to a CSV for coding.

## Step by step

1. **Install**`apify-client`.
2. **Call the actor** with your URLs.
3. **Iterate the dataset** for results.

### Input (paste into the JSON tab)

```
{
  "urls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "https://www.tiktok.com/@tiktok/video/7106594312292453675"
  ],
  "speechToText": "fallback"
}
```

### Call it from code

```
# pip install apify-client
from apify_client import ApifyClient

client = ApifyClient("your-apify-token")
run = client.actor("scrape-lads/video-transcript-scraper").call(run_input={
    "urls": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw",
        "https://www.tiktok.com/@tiktok/video/7106594312292453675",
    ],
    "speechToText": "fallback",
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["platform"], item["status"], item.get("wordCount"))
```

### What you get back

```
[
  {
    "platform": "youtube",
    "status": "ok",
    "transcriptSource": "subtitles",
    "wordCount": 47
  },
  {
    "platform": "tiktok",
    "status": "ok",
    "transcriptSource": "speech-to-text",
    "wordCount": 132
  }
]
```

Trimmed example. Names and numbers are illustrative; your run returns real data with more fields.

## Tips

- Rows that failed (private, deleted, no speech) come back with a `status` and `errorCode` and are not charged.
- Getting blocked with youtube-transcript-api? See [why it happens](/blog/youtube-transcript-api-ip-blocked/).

## What it costs

$2 per 1,000 transcripts across all platforms.

Plus a small per-run start fee. Apify's free plan includes monthly credit, enough to test. Check the listing for current pricing.

## FAQ

**Does it work from a server or Lambda?**

Yes. The scraping runs on Apify, so your server's IP is never blocked.

## Related

- [**Video Transcript Scraper**](/video-transcript-api/) Transcripts for TikTok, Instagram, YouTube and X videos. $2 / 1,000 transcripts.
- [How to get the transcript of a TikTok video](/how-to/get-tiktok-video-transcript/)
- [How to transcribe Instagram Reels to text](/how-to/transcribe-instagram-reels/)
- [How to download YouTube transcripts in bulk](/how-to/download-youtube-transcripts-in-bulk/)
- [How to transcribe a Twitter (X) video](/how-to/transcribe-twitter-x-video/)
- [How to get a recipe from a TikTok video](/how-to/get-recipe-from-tiktok-video/)
- [All How To guides](/how-to/)

## Try it on your own data

Paste the input above, run it, and see your results in a couple of minutes.
[Open Video Transcript Scraper](https://apify.com/scrape-lads/video-transcript-scraper?utm_source=scrapelads&utm_medium=site&utm_campaign=how-to-use-a-video-transcript-api-in-python&utm_content=video-transcript-scraper)
