# YouTube Transcript Downloader - Captions to Text (`invincible_brookbed/youtube-transcript-fetcher`) Actor

Download YouTube transcripts as clean text and timed segments from URLs or video IDs. No official API key or quota. Ideal for AI summarization, RAG, SEO and research. Pay only for successful transcripts. MCP-ready.

- **URL**: https://apify.com/invincible_brookbed/youtube-transcript-fetcher.md
- **Developed by:** [Виталий Белогуров](https://apify.com/invincible_brookbed) (community)
- **Categories:** Videos, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 transcripts

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 — Download Captions to Clean Text

**YouTube transcript downloader for AI, RAG and SEO.** Paste video URLs or IDs and get clean caption text plus timed segments — no official API key, no quota, no browser. You're only charged for transcripts actually delivered (~**$10 per 1,000**).

### Why users pick this Actor

- Clear pay-per-event pricing — you only pay for successful results (~$0.01 each)
- Structured JSON ready for CRM, sheets, Zapier/Make/n8n
- Works with AI agents via [Apify MCP](https://mcp.apify.com/)
- Honest limitations documented — no fake data

YouTube Transcript Fetcher reads the caption tracks YouTube itself publishes for each video (the same data behind the "Show transcript" button) through the public Innertube player and timedtext endpoints. Because it doesn't launch a browser, it's fast and cheap — ideal for processing hundreds of videos for RAG pipelines, summarisation or content repurposing.

### What does it do?

- Accepts **watch, youtu.be, shorts, embed and live URLs** or bare 11-character video IDs.
- Picks the best caption track for your **preferred languages**, preferring uploader-provided captions over auto-generated ones.
- Returns the **full transcript as clean text** (HTML tags and entities removed, whitespace normalised) and optional **timed segments** (`start`, `dur`, `text`).
- Reports title, channel, caption language, whether captions are **auto-generated**, and every language available for the video.
- Returns a clear **error record** when a video has no captions, is unavailable or the requested language is missing — and never charges for it.

### Why use this Actor?

| | Official YouTube Data API | Browser-based scrapers | **YouTube Transcript Fetcher** |
|---|---|---|---|
| API key & quota | Required; captions need OAuth as video owner | None | **None** |
| Works for videos you don't own | No | Yes | **Yes (when public captions exist)** |
| Speed and cost | Quota-limited | Slow, heavy compute | **HTTP only, fast and cheap** |
| Output | Raw caption files | Raw page data | **Clean text + timed segments** |
| Language selection | Manual | Manual | **Priority list with fallbacks** |
| Charged on failure | n/a | Compute spent | **No** |

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `videos` | array | — (required) | Video URLs or 11-character IDs. Duplicates are skipped. |
| `languages` | array | `["en"]` | Language codes in priority order. `en` also matches `en-US`, `en-GB`. |
| `includeTimestamps` | boolean | `true` | Include `segments[]`. Disable for smaller records. |
| `proxyConfiguration` | object | Residential | **Residential Apify Proxy on by default** (YouTube blocks many datacenter IPs). No captcha needed. |

```json
{
    "videos": ["https://www.youtube.com/watch?v=jNQXAC9IVRw", "dQw4w9WgXcQ"],
    "languages": ["en", "de"],
    "includeTimestamps": true,
    "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

### Output

```json
{
    "videoId": "jNQXAC9IVRw",
    "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "title": "Me at the zoo",
    "channel": "jawed",
    "language": "en",
    "languageName": "English",
    "isAutoGenerated": false,
    "availableLanguages": ["en"],
    "lengthSeconds": 19,
    "wordCount": 39,
    "transcript": "All right, so here we are in front of the elephants…",
    "segments": [
        { "start": 1.2, "dur": 2.16, "text": "All right, so here we are" },
        { "start": 3.36, "dur": 2.4, "text": "in front of the elephants" }
    ],
    "scrapedAt": "2026-10-11T09:30:12.481Z"
}
```

When captions can't be delivered, the record has `transcript: null` plus `error` and `errorCode` (`NO_CAPTIONS`, `LANGUAGE_NOT_AVAILABLE`, `UNAVAILABLE`, `BLOCKED`, `EMPTY_CAPTION_DATA`, `NETWORK`, `INVALID_INPUT`). End-of-run statistics (fetched, failed by reason, total words, charged events) are stored under `STATS`.

### Pricing

**Pay-per-event** pricing:

| Event | Price | When it is charged |
|---|---|---|
| `transcript` | **$0.01** (about $10 per 1,000 transcripts) | One transcript successfully fetched and saved |

Videos without captions, blocked requests and invalid inputs are **never charged**. Platform compute is included in the event price (residential proxy traffic is billed separately by Apify if you enable it). Set a maximum cost per run in the Console to cap spending.

### Use cases

- **RAG and AI knowledge bases:** feed lecture, podcast and interview transcripts to LLMs.
- **Summaries and show notes:** produce summaries, chapters and blog posts from video.
- **Content research and SEO:** mine what competitors say, search spoken keywords, repurpose content.
- **Academic and media monitoring:** analyse talks and news at scale.
- **Accessibility and translation workflows:** start from timed segments to build subtitle files.

### FAQ

**Does it work for videos without captions?**
No. It retrieves existing caption tracks (uploader-provided or YouTube's auto-generated). It doesn't transcribe audio. Those videos return a `NO_CAPTIONS` error and cost nothing.

**Why do I need a proxy?**
Runs from datacenter IPs are frequently challenged by YouTube ("confirm you're not a bot"). Residential proxies make results far more reliable. Without one, expect `BLOCKED` errors on some runs.

**Are auto-generated captions included?**
Yes, when no uploader-provided track exists for the language. Check `isAutoGenerated` — accuracy and punctuation vary.

**Can it translate captions?**
Not currently. It returns the language tracks that exist; `availableLanguages` shows what's offered.

**Private, age-restricted or members-only videos?**
Not supported; they return an `UNAVAILABLE` or `BLOCKED` error.

**Is this allowed?**
Transcripts are public data, but videos and captions remain the creators' content. Respect copyright, YouTube's Terms of Service and applicable laws when reusing transcripts.

### MCP — use it from AI agents

Ready for the Model Context Protocol so Claude, Cursor and other agents can fetch transcripts as a tool:

`https://mcp.apify.com/?tools=fetch-actor-details,invincible_brookbed/youtube-transcript-fetcher`

Try: *"Get the transcript of this video and summarise the key points."*

### Limitations

- Relies on YouTube's undocumented public endpoints, which can change without notice.
- No speech-to-text: videos without captions can't be transcribed.
- Datacenter IPs may be blocked; residential proxies are recommended.
- Auto-generated captions can contain recognition errors and lack punctuation.

# Actor input Schema

## `videos` (type: `array`):

YouTube video URLs (watch, youtu.be, shorts, embed, live) or bare 11-character video IDs.

## `languages` (type: `array`):

Language codes in priority order (e.g. en, de, es). The first language that has a caption track wins; manually uploaded captions beat auto-generated ones. A region code like en-US also matches en.

## `includeTimestamps` (type: `boolean`):

When enabled, each record contains segments\[] with start, dur and text. Disable for smaller records if you only need the full text.

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

Uses Apify Residential Proxy by default — YouTube often blocks datacenter IPs. Captcha solving is not required. You can turn proxy off for quick local tests.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "dQw4w9WgXcQ"
  ],
  "languages": [
    "en"
  ],
  "includeTimestamps": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Dataset with transcripts, timed segments and per-video errors.

## `stats` (type: `string`):

End-of-run statistics (transcripts fetched, failures by reason, charged events).

# 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 = {
    "videos": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw",
        "dQw4w9WgXcQ"
    ],
    "languages": [
        "en"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("invincible_brookbed/youtube-transcript-fetcher").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 = {
    "videos": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw",
        "dQw4w9WgXcQ",
    ],
    "languages": ["en"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("invincible_brookbed/youtube-transcript-fetcher").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 '{
  "videos": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "dQw4w9WgXcQ"
  ],
  "languages": [
    "en"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call invincible_brookbed/youtube-transcript-fetcher --silent --output-dataset

```

## MCP server setup

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

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/2ZEC7wQAZfFZWJRxy/builds/QmP0NibSf8kuOsskg/openapi.json
