# YouTube Transcript Extractor – Text, SRT, VTT & RAG Chunks (`filexy634/youtube-transcript-extractor`) Actor

Get the transcript of any YouTube video as clean text, timed segments, SRT or VTT, plus video metadata. Pick your languages, and get RAG-ready chunks with timestamps and deep links for AI pipelines. No API key or login. You pay only for transcripts returned.

- **URL**: https://apify.com/filexy634/youtube-transcript-extractor.md
- **Developed by:** [Felix Masomera](https://apify.com/filexy634) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 transcript-returneds

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 Extractor – Text, SRT, VTT & RAG Chunks

Get the transcript of any YouTube video as clean text, timed segments, SRT or VTT, plus video metadata. Built for AI pipelines: optional **RAG-ready chunks**, each with start and end time and a deep link to that exact moment in the video.

No YouTube API key, no login, no browser.

### What you get per video

- **Transcript:** plain text, word and character counts, and optional timed segments.
- **Subtitles:** optional SRT and WebVTT strings.
- **RAG chunks:** set a chunk size and get text pieces with `start`, `end` and a `youtube.com/watch?v=ID&t=42s` link.
- **Language control:** pass preferred languages in order. Manual captions are preferred over auto-generated ones unless you say otherwise. The result tells you which language and whether it is auto-generated, and lists every track the video offers.
- **Metadata:** title, channel, channel ID, publish date, length, views, description, keywords.

### Input

| Field | Description |
|---|---|
| `videoUrls` | Watch, youtu.be, shorts, embed or live links, or bare video IDs |
| `languages` | Preferred language codes in order (default `en`) |
| `onlyPreferredLanguages` | Error instead of falling back to another language |
| `preferAutoGenerated` | Prefer the auto-generated track |
| `includeSegments`, `includeSrt`, `includeVtt` | Extra output formats |
| `chunkSizeChars` | Chunk size for RAG, 0 to disable |
| `proxyConfiguration` | Residential proxies recommended (see below) |

### Output

```json
{
  "videoId": "dQw4w9WgXcQ",
  "status": "ok",
  "title": "…",
  "channel": "…",
  "language": "en",
  "isAutoGenerated": false,
  "text": "Hello world …",
  "wordCount": 412,
  "chunks": [{ "start": 0, "end": 38.5, "text": "…", "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&t=0s" }],
  "retrievedVia": "ANDROID_VR"
}
```

Videos that fail (private, removed, no captions, blocked) appear with `status: "error"` and a clear reason, and are **not charged**.

### Pricing

Charged per transcript returned.

### Proxies

YouTube blocks data-center IP addresses, so run this Actor with residential proxies (the default input does). You can also supply your own proxy URLs.

### Limitations

- Videos with no captions return `no_captions`. This Actor reads existing captions; it does not transcribe audio.
- Age-restricted and private videos cannot be fetched.
- Some videos are protected by YouTube's proof-of-origin token rollout and may fail even with good proxies. These return an error and are not charged.
- Only single videos for now. Channel and playlist expansion is not included.
- YouTube changes its private endpoints from time to time, which can briefly break extraction until the Actor is updated.
- Transcripts are copyrighted by their creators. You are responsible for complying with YouTube's terms of service and applicable copyright law when using the data.

# Actor input Schema

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

YouTube videos, one per line. Accepts watch, youtu.be, shorts, embed and live links, or bare 11-character video IDs.

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

Language codes in order of preference, e.g. en, de, es. A manually created track is preferred over an auto-generated one in the same language.

## `onlyPreferredLanguages` (type: `boolean`):

If on, videos without any of the preferred languages return an error. If off, the first available track is used instead.

## `preferAutoGenerated` (type: `boolean`):

Use the auto-generated track even when a manual one exists in the same language.

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

Add the transcript as an array of {start, duration, text} segments.

## `includeSrt` (type: `boolean`):

Add the transcript as an SRT subtitle string.

## `includeVtt` (type: `boolean`):

Add the transcript as a WebVTT subtitle string.

## `chunkSizeChars` (type: `integer`):

If above 0, also returns the transcript split into chunks of about this many characters, each with start time, end time and a deep link to that moment in the video. Ready for embeddings and RAG. 0 disables chunking.

## `maxConcurrency` (type: `integer`):

How many videos are processed in parallel. Lower it if you see many blocked requests.

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

YouTube blocks data-center IPs, so residential proxies are strongly recommended. You can also supply your own proxy URLs.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "languages": [
    "en"
  ],
  "onlyPreferredLanguages": false,
  "preferAutoGenerated": false,
  "includeSegments": true,
  "includeSrt": false,
  "includeVtt": false,
  "chunkSizeChars": 0,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `transcripts` (type: `string`):

Dataset of transcripts and video metadata.

# 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"
    ],
    "languages": [
        "en"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("filexy634/youtube-transcript-extractor").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"],
    "languages": ["en"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("filexy634/youtube-transcript-extractor").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"
  ],
  "languages": [
    "en"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call filexy634/youtube-transcript-extractor --silent --output-dataset

```

## MCP server setup

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

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/mUGttJ7JFXG4kfC7C/builds/8Ql8wa332RE1sgce8/openapi.json
