# YouTube Transcript & Subtitle Scraper (SRT, VTT) (`vaulted/youtube-transcript-scraper`) Actor

Get clean, AI-ready transcripts from any YouTube video. Full text, timestamped segments, and optional chunking for RAG and LLM pipelines.

- **URL**: https://apify.com/vaulted/youtube-transcript-scraper.md
- **Developed by:** [Vault](https://apify.com/vaulted) (community)
- **Categories:** AI, Videos, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

### What does YouTube Transcript Scraper do?

**This Actor turns any YouTube video into clean, ready-to-use text.** Paste video URLs and get back the full transcript, timestamped caption segments, and — if you want — the text pre-split into chunks sized for an LLM context window or a vector database.

It handles every common URL shape (`youtube.com/watch`, `youtu.be`, `/shorts/`, `/embed/`), resolves the video title and channel name automatically, and decodes the HTML entities that make raw caption data unusable.

Results export as JSON, CSV, Excel or HTML, and are available through the Apify API.

### Why use this scraper?

- **Feed video to an LLM** — summarize, extract, classify or answer questions over video content that models can't watch.
- **Build a RAG pipeline** — the built-in chunking produces sentence-aligned segments ready for embedding, no post-processing needed.
- **Repurpose content** — turn a webinar or podcast into a blog post, newsletter, or social thread.
- **Research and analysis** — search across hundreds of videos by what was actually *said*.
- **Accessibility and SEO** — publish readable transcripts alongside your videos.
- **Subtitle and translation workflows** — timestamped segments map straight to caption formats.

### How to use it

1. Add one or more **YouTube videos** — full URLs or bare 11-character IDs both work.
2. Optionally set a **preferred language** (`en`, `es`, `de`…). Leave empty for the video's default.
3. Turn on **Include timestamped segments** if you need per-cue start times.
4. Set a **Chunk size** (try `2000`) if you're feeding an AI model. Leave `0` to skip.
5. Click **Start**, then export from the **Storage** tab.

### Input

| Field | Type | Description |
|---|---|---|
| `videos` | array | Video URLs or IDs. Required. |
| `language` | string | Two-letter preferred transcript language. |
| `includeSegments` | boolean | Include every caption cue with start time and duration. |
| `chunkSize` | integer | Split transcript into ~N-character chunks on sentence boundaries. `0` disables. |
| `proxyConfiguration` | object | Optional proxy. Recommended for large batches — see below. |

```json
{
    "videos": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "https://youtu.be/9bZkp7q19f0"
    ],
    "includeSegments": false,
    "chunkSize": 2000
}
```

### Output

```json
{
    "videoId": "dQw4w9WgXcQ",
    "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
    "author": "Rick Astley",
    "thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
    "language": "en",
    "durationSeconds": 211,
    "wordCount": 487,
    "characterCount": 2089,
    "transcript": "We're no strangers to love. You know the rules and so do I...",
    "segments": [{ "text": "We're no strangers to love", "startSeconds": 18, "durationSeconds": 3 }],
    "chunks": ["...", "..."],
    "scrapedAt": "2026-08-25T00:47:12.004Z"
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

#### Data fields

| Field | Description |
|---|---|
| `videoId` / `url` | Canonical ID and watch link. |
| `title` / `author` / `thumbnail` | Video title, channel name and thumbnail image. |
| `language` | Language of the transcript actually returned. |
| `durationSeconds` | Length covered by the captions. |
| `wordCount` / `characterCount` | Useful for estimating LLM token cost before you send it. |
| `transcript` | Full text, entities decoded, whitespace normalized. |
| `segments` | Per-cue text with `startSeconds` and `durationSeconds`. Only when enabled. |
| `chunks` | Sentence-aligned chunks near your requested size. Only when `chunkSize` > 0. |

### How much does it cost?

Billed **per video transcribed**, so cost tracks exactly what you get. Videos without captions cost you nothing — they're reported separately, not billed as results.

### Tips

- **Chunk size 2000** is a good default for most embedding models. Chunks break on sentence boundaries, never mid-word.
- Check `wordCount` before piping into an LLM — it's a fast proxy for token cost.
- Use `segments` to deep-link back into the video: `https://youtu.be/VIDEO_ID?t=START_SECONDS`.
- **Fetching many videos?** Enable proxy in the input. YouTube rate-limits datacenter IP ranges, and a proxy avoids partial results on large batches.

### FAQ, disclaimers, and support

**Some videos returned nothing.** Not every video has captions. Videos with captions disabled, private videos, and some region-locked videos have no transcript to fetch. These are listed in the `FAILED_VIDEOS` record in the run's key-value store, with the reason for each.

**Auto-generated captions?** Yes — if YouTube generated them, this Actor returns them. Accuracy depends on YouTube's speech recognition, not on this Actor.

**Can it do a whole channel or playlist?** Not yet. Supply individual video URLs. Open an issue if you want channel support and I'll look at adding it.

**Is this legal?** Captions are publicly served alongside the video. You are responsible for respecting YouTube's Terms of Service and the copyright of the underlying content in how you use transcripts.

Found a bug or want a feature? Open an issue on the **Issues** tab.

# Actor input Schema

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

Video URLs or bare video IDs. Accepts youtube.com/watch, youtu.be and /shorts/ links.

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

Two-letter code such as en, es, de. Leave empty for the video's default transcript.

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

Return every caption cue with its start time and duration, alongside the full text.

## `chunkSize` (type: `integer`):

Split the transcript into chunks of roughly this size for RAG or LLM context windows. Set 0 to disable.

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

YouTube rate-limits datacenter IPs. Use a proxy if you are fetching many videos.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "includeSegments": false,
  "chunkSize": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

# 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=dQw4w9WgXcQ"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("vaulted/youtube-transcript-scraper").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=dQw4w9WgXcQ"] }

# Run the Actor and wait for it to finish
run = client.actor("vaulted/youtube-transcript-scraper").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=dQw4w9WgXcQ"
  ]
}' |
apify call vaulted/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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

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/jY0MRlAmb1tgQN31t/builds/F77Rr0Yiyb6Fxjfe4/openapi.json
