# YouTube Transcript API: Captions, No Proxy (`stas_k/youtube-transcript-api-fast`) Actor

Transcript runs that die on one video, or bill you for videos with no captions, still report success. Every video gets its own row with the reason when no transcript exists, plain text, timestamps, SRT and VTT, no proxies to set up on your side, and you pay only for delivered rows.

- **URL**: https://apify.com/stas_k/youtube-transcript-api-fast.md
- **Developed by:** [Stas K](https://apify.com/stas_k) (community)
- **Categories:** Developer tools, Videos
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 videos

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## YouTube Transcript API: Bulk Captions, Fast

**The most-installed YouTube transcript Actor in the Store sits at 3.7★ out of 5 on 49 reviews, and the
complaints repeat: "no data returned", "no response for this video".** That is what silence costs a
rating. This Actor never goes silent.

Every link you send becomes a row. Either the transcript - plain text, timestamped segments, ready
SRT and VTT, language, human-or-auto flag, video metadata - or a row with `status: FAILED` and a
machine-readable reason: `NO_CAPTIONS`, `LOGIN_REQUIRED`, `EMPTY_TRANSCRIPT`, `VIDEO_NOT_FOUND`,
`LIVE_STREAM`. You always know which video failed and why, instead of wondering which ones vanished.

### The pain this removes

| The usual story | What happens here |
|---|---|
| A video without captions simply disappears from the output | It comes back as a row with a reason and is **not charged** |
| "Sign in to confirm you're not a bot" - YouTube blocks data-centre IPs | The Actor retries through a clean egress path by itself. You are not told to go and buy residential proxies |
| One run per video, so 100 videos = 100 runs | Paste up to 1000 links; eight are fetched in parallel (100 links per run by default, `maxVideos`) |
| Transcript as a wall of text, subtitles left to you | `transcript`, `segments`, `srt`, `vtt` in the same row |
| You pay for the attempt, not the result | The charge fires **after** the transcript is stored |
| Language guessed silently | Ask for `en`, get `en`, or the original track - and `availableLanguages` tells you what exists |

### What you get per video

| Field | Meaning |
|---|---|
| `transcript` | the whole speech as one plain-text string |
| `segments` | every cue with `start` (seconds), `duration`, `text` |
| `srt`, `vtt` | subtitles ready to save and play |
| `language`, `availableLanguages` | which track was used and which ones exist |
| `isAutoGenerated` | true = YouTube speech recognition, false = human captions |
| `videoTitle`, `channel`, `durationSeconds`, `viewCount` | video metadata |
| `status`, `error`, `reason` | SUCCESS/FAILED and, when failed, exactly why |

### Who uses it

- **Content teams** - turn a channel's back catalogue into searchable text.
- **Research and journalism** - quote a video with timestamps, not with a memory of what was said.
- **SEO and repurposing** - transcript to blog post, subtitle files for re-uploads.
- **AI and RAG pipelines** - feed an assistant with what people actually said, as clean text.
- **Compliance and moderation** - keep a text record of published videos.

### Input

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/jNQXAC9IVRw",
    "https://www.youtube.com/shorts/kJQP7kiw5Fk",
    "kJQP7kiw5Fk"
  ],
  "language": "en",
  "preferManualCaptions": true,
  "includeSegments": true
}
```

All URL shapes are accepted: `watch?v=`, `youtu.be/`, `/shorts/`, `/embed/`, `/live/`, or a bare
11-character video ID.

### Use it from code

```bash
curl -X POST "https://api.apify.com/v2/acts/YOUR_USER~youtube-transcript-api-fast/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls":["https://youtu.be/jNQXAC9IVRw"]}'
```

Works as an MCP tool from Claude, Cursor and ChatGPT as well - the input is a plain list of links.

### Pricing

**$3 per 1,000 videos** ($0.003 per delivered transcript). Failures cost you nothing in transcript
charge: a video without captions, a video in a language it does not have, or a broken link is free.
The platform's own per-row fee on any dataset row ($0.00001) still applies to the rows it writes.

### How the requests travel (in plain words)

YouTube rate-limits data-centre addresses, so when the direct path is refused the Actor retries
through its own egress path and falls back to a direct connection otherwise. Your own proxy can be
plugged in through `proxyConfiguration` and then takes priority. Nothing about your run is stored on
that path - only the request for the video you asked for passes through it.

### Cache

A transcript that was fetched once is kept in the storage of the account that ran the Actor for 12 hours
(`cacheMinutes`). Ask for the same video again inside that window and it comes back instantly, marked
`fromCache: true` - and YouTube receives no second request for it. That last part is not a micro-saving:
repeated identical traffic is what gets an address rate-limited in the first place.

### Limits worth knowing

- Captions must exist on YouTube's side. A video whose uploader disabled them cannot be transcribed
  here - that is reported as `NO_CAPTIONS`, not as a charge.
- Age-restricted videos answer `LOGIN_REQUIRED`; we do not sign in with an account.
- Live streams in progress have no captions yet.
- `maxVideos` is 100 by default. Links beyond it come back as rows with `NOT_CHECKED_LIMIT` and the
  reason, so a 1000-link paste never looks like a 100-link answer.
- A run stops at your spending limit (`maxTotalChargeUsd`). Links that were not fetched still come
  back, as `NOT_CHECKED_CAP` rows with the reason; the run summary counts them next to `delivered`.

### Feedback

Found a video that fails although it clearly has captions? Open an issue on the Actor page with the
link - that is the fastest way to get it fixed.

### Cache and billing

A cached transcript is still a delivered transcript, so a row served from the cache is charged
like any other row. The cache saves wall-clock time and spares YouTube a repeated request for the
same video - it is not a discount.

# Actor input Schema

## `videoUrls` (type: `array`):

Any YouTube link format works: watch?v=, youtu.be, /shorts/, /embed/, /live/, or a bare 11-character video ID.

## `language` (type: `string`):

Language code to prefer, e.g. en, de, uk, es. Empty = the video's original language. If the requested language does not exist, the original track is used.

## `preferManualCaptions` (type: `boolean`):

true = use the uploader's captions when they exist and auto-generated speech recognition only as a fallback. false = the other way round.

## `includeSegments` (type: `boolean`):

true = every caption cue with start time and duration, next to the full plain text.

## `maxVideos` (type: `integer`):

Safety stop: the run never processes more than this many videos. Default 100. Links beyond the limit are returned as NOT_CHECKED_LIMIT rows with the reason, never dropped.

## `cacheMinutes` (type: `integer`):

A video already fetched in this window is served from this account's own cache: instant answer, and no second request to YouTube for the same video. 0 = always fetch live. Default 720 (12 hours).

## `proxyConfiguration` (type: `object`):

YouTube rate-limits data-centre addresses. If you see LOGIN_REQUIRED for videos that clearly have captions, switch this on and pick residential proxies.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "language": "",
  "preferManualCaptions": true,
  "includeSegments": true,
  "maxVideos": 100,
  "cacheMinutes": 720
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset with one row per video: transcript text, segments, srt, vtt, language, status.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("stas_k/youtube-transcript-api-fast").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"] }

# Run the Actor and wait for it to finish
run = client.actor("stas_k/youtube-transcript-api-fast").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ]
}' |
apify call stas_k/youtube-transcript-api-fast --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,stas_k/youtube-transcript-api-fast"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/GuanyXsDjWKCwRK45/builds/wPm8oELDYOB6Og5km/openapi.json
