# YouTube Transcript & Subtitles Scraper — Fast AI/RAG Ready (`leopoldsaint/youtube-transcript-scraper`) Actor

Fast no-browser YouTube transcript and subtitles extractor. Get clean full text, timestamped segments, SRT/VTT captions, auto-translation, and video metadata from video URLs, playlists, channels, or search queries.

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

## Pricing

from $1.80 / 1,000 transcript extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

### What does YouTube Transcript & Subtitles Scraper do?

**YouTube Transcript & Subtitles Scraper** extracts clean plain-text transcripts, timestamped caption segments, optional **SRT / WebVTT** files, and complete video metadata from [YouTube](https://www.youtube.com) without launching a slow browser. Pass individual video URLs/IDs, entire **playlists**, **channel URLs / `@handles`**, or **search queries** and get LLM-, RAG-, and analytics-ready JSON in seconds.

Running on the Apify platform gives you REST API access, scheduled runs, webhooks, MCP server compatibility for AI agents, automatic proxy fallback, and one-click JSON/CSV/Excel exports.

### Why use YouTube Transcript & Subtitles Scraper?

- **AI, RAG & LLM knowledge bases:** Ingest entire YouTube channels, podcasts, tutorials, and courses into vector databases or agent pipelines with clean text and exact timestamps.
- **Content repurposing & SEO:** Turn long-form videos into blog articles, newsletters, show notes, social threads, or localized subtitles (`translateTo`).
- **Market & competitor research:** Search YouTube topics at scale and analyze what creators, reviewers, and buyers actually say inside videos.
- **Zero-waste flat pricing:** Videos without captions are automatically skipped (when `skipUnavailable: true`) so you only pay for real transcripts delivered.

### How to use YouTube Transcript & Subtitles Scraper

1. Open the **Input** tab and paste one or more YouTube video URLs, 11-character video IDs, playlist URLs, or channel URLs / `@handles` into **Video, Playlist, or Channel URLs / IDs** (or enter topics in **Search Queries**).
2. Choose your **Preferred Languages** (e.g., `["en"]`) and optionally set **Translate Captions To** (e.g., `"es"`, `"de"`).
3. Toggle **Include Timestamped Segments**, **Include SRT**, or **Include WebVTT** based on your downstream workflow.
4. Click **Start** and download your dataset in JSON, CSV, Excel, or pull it via the Apify API / MCP.

### Input

Configure the run in the **Input** tab or pass JSON via API:

```json
{
    "videoUrls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "https://www.youtube.com/watch?v=jNQXAC9IVRw"
    ],
    "languages": ["en"],
    "preferManualCaptions": true,
    "includeSegments": true,
    "includeSrt": false,
    "maxTotalVideos": 25,
    "skipUnavailable": true
}
```

- `videoUrls`: Direct video URLs, 11-character IDs, Shorts URLs, playlist URLs, or channel `@handles`/URLs.
- `searchQueries`: Optional YouTube search queries expanded automatically up to `maxVideosPerSource` each.
- `languages`: Ordered ISO language preferences; automatically prefers human-written captions over auto-generated ASR when `preferManualCaptions` is enabled.
- `translateTo`: Optional ISO language code for on-the-fly YouTube caption translation.

### Output

Each dataset item represents one video transcript with metadata. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

```json
{
    "videoId": "jNQXAC9IVRw",
    "videoUrl": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "title": "Me at the zoo",
    "channelName": "jawed",
    "channelId": "UC4QobU6STFB0P71PMvOGN5A",
    "durationSeconds": 19,
    "viewCount": 370000000,
    "languageCode": "en",
    "languageName": "English",
    "isAutoGenerated": false,
    "hasTranscript": true,
    "wordCount": 38,
    "estimatedReadingMinutes": 0.2,
    "segmentCount": 6,
    "transcriptText": "All right, so here we are in front of the elephants...",
    "segments": [
        {
            "startMs": 1200,
            "durationMs": 2900,
            "startSeconds": 1.2,
            "startTimestamp": "00:01",
            "text": "All right, so here we are in front of the elephants"
        }
    ]
}
```

### Data table

| Field | Type | Description |
| --- | --- | --- |
| `videoId` | string | 11-character YouTube video ID |
| `videoUrl` | string | Canonical watch URL |
| `title` | string | Video title |
| `channelName` | string | Creator channel name |
| `durationSeconds` | number | Video duration in seconds |
| `viewCount` | number | View count at scrape time |
| `languageCode` | string | Extracted caption language code |
| `isAutoGenerated` | boolean | `true` for YouTube ASR auto-captions, `false` for manual |
| `transcriptText` | string | Full clean joined transcript text |
| `wordCount` | number | Word count of the extracted transcript |
| `segments` | array | Timestamped caption lines (`startMs`, `durationMs`, `startTimestamp`, `text`) |
| `srt` / `vtt` | string | Optional `.srt` and `.vtt` subtitle strings |
| `availableLanguages` | array | All caption tracks exposed by the video |

### How much does it cost to scrape YouTube transcripts?

This Actor uses transparent **Pay-Per-Event (PPE)** pricing with **platform usage included** (no hidden compute surcharges or stacked per-feature fees):

| Apify Plan Tier | Price per 1,000 transcripts | Actor start |
| --- | ---: | ---: |
| Free | $3.00 | $0.00005 |
| Bronze | $2.60 | $0.00005 |
| Silver | $2.20 | $0.00005 |
| Gold+ | $1.80 | $0.00005 |

Extracting 100 video transcripts costs **$0.30** on the Free tier (or **$0.18** on Gold+). On Apify's $5 monthly Free tier credit, you can extract over **1,600 transcripts per month**.

### API, n8n, Make & AI Agent (MCP) integration

#### JavaScript / TypeScript (`apify-client`)

```typescript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('leopoldsaint/youtube-transcript-scraper').call({
    videoUrls: ['https://www.youtube.com/watch?v=jNQXAC9IVRw'],
    languages: ['en'],
    includeSegments: true,
    includeSrt: true,
    maxTotalVideos: 10,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0]?.transcriptText);
```

#### Python (`apify-client` for RAG / LangChain)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("leopoldsaint/youtube-transcript-scraper").call(run_input={
    "videoUrls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"],
    "languages": ["en"],
    "includeSegments": False,
    "maxTotalVideos": 10,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["title"], item["wordCount"], item["transcriptText"][:200])
```

#### n8n, Make & Zapier (1-request HTTP API)

```text
POST https://api.apify.com/v2/acts/leopoldsaint~youtube-transcript-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN
Content-Type: application/json
```

#### AI Agents & MCP Server (Claude, Cursor, OpenAI)

Add `leopoldsaint/youtube-transcript-scraper` via Apify's hosted MCP server (`https://mcp.apify.com`) to let Claude, Cursor, or custom AI agents summarize videos, playlists, or entire channels automatically.

### Tips and advanced options

- Keep `skipUnavailable: true` when scraping playlists or search results so captionless videos are never charged.
- Disable `includeSegments` when you only need `transcriptText` for RAG embeddings to keep dataset JSON compact.
- Pair this Actor with our [YouTube Video & Channel Scraper](https://apify.com/leopoldsaint/youtube-video-channel-scraper), [YouTube Comments & Replies Scraper](https://apify.com/leopoldsaint/youtube-comments-scraper), and [YouTube Channel Email Scraper](https://apify.com/leopoldsaint/youtube-channel-email-scraper) for complete creator and content intelligence.

### FAQ, disclaimers, and support

- **Does this require YouTube API keys or login cookies?** No. It uses public caption endpoints with automatic fallback and Apify Proxy support when needed.
- **Legality & compliance:** Only scrape publicly accessible YouTube data and comply with applicable laws, copyright, and platform terms of service.
- **Need help or a custom feature?** Open an issue on the **Issues** tab and we will respond promptly.

# Actor input Schema

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

YouTube video URLs, 11-character video IDs, playlist URLs, or channel URLs/@handles to extract transcripts from.

## `searchQueries` (type: `array`):

Optional YouTube search queries to discover videos and extract their transcripts automatically.

## `maxVideosPerSource` (type: `integer`):

Maximum number of videos to expand from each playlist, channel, or search query.

## `maxTotalVideos` (type: `integer`):

Hard cap on total transcripts extracted across the entire run.

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

ISO language codes in order of preference (e.g. \['en', 'es']). Falls back to the first available caption track if none match.

## `translateTo` (type: `string`):

Optional ISO language code (e.g. 'en', 'es', 'de', 'fr') to request YouTube auto-translation of captions.

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

When both manual and auto-generated captions exist in the preferred language, pick manual captions first.

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

Include per-line timestamped segments (startMs, durationMs, startTimestamp, text) alongside full plain text.

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

Include a ready-to-use .srt formatted subtitle string on each output record.

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

Include a ready-to-use .vtt formatted subtitle string on each output record.

## `skipUnavailable` (type: `boolean`):

If true, videos that have no captions available are skipped and never charged.

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

Optional Apify Proxy fallback used automatically if direct cloud requests are challenged by YouTube.

## `demoMode` (type: `boolean`):

Emit deterministic sample transcript rows without live network requests.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "searchQueries": [],
  "maxVideosPerSource": 10,
  "maxTotalVideos": 25,
  "languages": [
    "en"
  ],
  "translateTo": "",
  "preferManualCaptions": true,
  "includeSegments": true,
  "includeSrt": false,
  "includeVtt": false,
  "skipUnavailable": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "demoMode": false
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "https://www.youtube.com/watch?v=jNQXAC9IVRw"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("leopoldsaint/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 = { "videoUrls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("leopoldsaint/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 '{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ]
}' |
apify call leopoldsaint/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,leopoldsaint/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/5iowmu97HfXNDELOA/builds/hj9sKFrOeTtg6mJCX/openapi.json
