# YouTube Transcript Scraper — Subtitles, Timestamps & Text (`alias_md5/youtube-transcript-scraper`) Actor

Extract clean, timestamped YouTube transcripts and subtitles in bulk from videos, Shorts, and live streams. Supports multilingual tracks, auto-generated captions, translation, and structured JSON/CSV/Excel export from $0.50 per 1,000 transcripts.

- **URL**: https://apify.com/alias_md5/youtube-transcript-scraper.md
- **Developed by:** [Alias Data Studio](https://apify.com/alias_md5) (community)
- **Categories:** Videos, AI, Social media
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 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/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 Scraper — Fast Subtitles, Timestamps & Full Text

Extract clean, timestamped **YouTube transcripts and subtitles** in bulk from regular videos, YouTube Shorts, and live stream replays — ready for **JSON, CSV, Excel, RAG pipelines, and AI agents**.

***

### Why Choose This Scraper

- **Clean, ready-to-use text**: Decodes broken HTML entities and messy caption line breaks automatically, delivering both readable `fullText` and structured timestamped `segments`.
- **Smart multilingual track selection**: Specify an ordered list of `preferredLanguages` (such as `["en", "zh-Hans", "zh"]`) — manual human-written subtitles are always preferred before falling back to auto-generated or original-language captions.
- **Built-in subtitle translation**: Request any `targetTranslationLanguage` (such as `es`, `ja`, or `zh-Hans`) to receive native captions when available or translated subtitles directly from YouTube.
- **Resilient bulk batching**: Paste watch links, `youtu.be` links, Shorts, live URLs, or bare 11-character video IDs. Duplicates are removed automatically, and private, deleted, or captionless videos are skipped cleanly without crashing the batch or charging you.
- **Transparent usage-based pricing**: Pay only for transcripts actually delivered — starting at **$1.00 / 1,000 transcripts** on Free plans and dropping to **$0.50 / 1,000 transcripts** on Gold and Enterprise plans.

***

### Common Use Cases

- **AI Agents & RAG Knowledge Bases**: Turn technical talks, keynote speeches, podcasts, and university lectures into clean, searchable text chunks with exact start timestamps.
- **Video Summarization & Research**: Feed clean `fullText` into LLMs to generate executive summaries, chapter breakdowns, and quote indexes with clickable timestamp offsets.
- **Content Intelligence & Market Tracking**: Monitor product launches, earnings calls, developer keynotes, and competitor channels at scale.
- **Multilingual Localization & SEO**: Pull existing subtitles across dozens of languages or translate transcripts for global research workflows.

***

### Input Configuration

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `videoUrls` | `string[]` | `["https://www.youtube.com/watch?v=aircAruvnKk"]` | Full YouTube URLs (`watch`, `shorts`, `live`, `youtu.be`, `embed`) or bare 11-character video IDs. Automatically extracted and deduplicated. |
| `preferredLanguages` | `string[]` | `["en"]` | Ordered list of preferred subtitle language codes (e.g. `["en", "zh-Hans", "zh"]`). Manual tracks are prioritized before auto-generated tracks. |
| `shouldFallbackToAutoGenerated` | `boolean` | `true` | Automatically fall back to auto-generated captions or the video's original caption language if preferred manual tracks are unavailable. |
| `targetTranslationLanguage` | `string` | *(optional)* | Target language code (e.g. `"es"`, `"ja"`, `"zh-Hans"`). Uses a native subtitle track if published, or translates via YouTube's built-in translation. |
| `shouldIncludeSegments` | `boolean` | `true` | Include timestamped `segments: [{ startSeconds, durationSeconds, text }]`. Set to `false` for compact full-text-only exports. |
| `requestMinIntervalMs` | `integer` | `150` | Minimum pacing delay in milliseconds between consecutive requests. |

#### Example Input

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://youtu.be/zjkBMFhNj_g",
    "https://www.youtube.com/shorts/TaopSi3Ucfc",
    "v-NGxyPjcrE"
  ],
  "preferredLanguages": ["en", "zh-Hans", "zh"],
  "shouldFallbackToAutoGenerated": true,
  "shouldIncludeSegments": true
}
```

***

### Output Format

Each successfully extracted video produces one structured record in the dataset:

```json
{
  "videoId": "aircAruvnKk",
  "videoUrl": "https://www.youtube.com/watch?v=aircAruvnKk",
  "title": "But what is a neural network? | Deep learning chapter 1",
  "channelName": "3Blue1Brown",
  "channelId": "UCYO_jab_esuFRV4b17AJtAw",
  "durationSeconds": 1120,
  "viewCount": 25455792,
  "languageCode": "en",
  "languageName": "English",
  "isAutoGenerated": false,
  "isTranslated": false,
  "availableLanguages": ["ar", "bn", "zh", "zh-CN", "zh-TW", "cs", "en", "fr", "de", "ja", "es"],
  "segmentCount": 286,
  "wordCount": 3357,
  "fullText": "This is a 3. It's sloppily written and rendered at an extremely low resolution of 28x28 pixels, but your brain has no trouble recognizing it as a 3...",
  "segments": [
    {
      "startSeconds": 4.22,
      "durationSeconds": 1.18,
      "text": "This is a 3."
    },
    {
      "startSeconds": 6.06,
      "durationSeconds": 4.653,
      "text": "It's sloppily written and rendered at an extremely low resolution of 28x28 pixels,"
    }
  ]
}
```

#### Partial-Batch Failure Handling

If a batch includes an invalid URL, a private/deleted video, or a video whose creator disabled subtitles, the run continues processing the rest of your list cleanly:

- Skipped videos push **0 dataset rows** and incur **no charge**.
- Every skipped target and its exact reason are listed under `failedTargets` in the `RUN_SUMMARY` key-value store record.

***

### Transparent Pricing

You pay only for transcripts successfully extracted and saved to your dataset. Paid Apify plans automatically receive lower volume rates:

| Event | Free | Bronze | Silver | Gold / Enterprise |
| --- | ---: | ---: | ---: | ---: |
| **Transcript Extracted (per 1,000 videos)** | `$1.00` | `$0.80` | `$0.65` | `$0.50` |

> **Honest availability note**: Videos with captions disabled by the uploader, private videos, and deleted videos cannot produce transcripts and are skipped at no cost. When requesting `targetTranslationLanguage`, native published subtitle tracks are delivered automatically whenever available; machine translation is used only when a native track in that language does not exist.

***

### Use With AI Agents (MCP)

This Actor works out of the box with the **Apify MCP Server**, letting Claude, Cursor, ChatGPT, and custom AI agents fetch clean YouTube transcripts, lecture notes, and timestamped quotes on demand.

# Actor input Schema

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

Paste full YouTube URLs (watch, Shorts, live, youtu.be) or 11-character video IDs. Duplicates are removed automatically and unavailable or captionless videos are skipped cleanly without stopping the batch.

## `preferredLanguages` (type: `array`):

Ordered list of preferred language codes (for example: en, zh-Hans, zh, es, ja). Manual captions are always preferred over auto-generated tracks for each requested language.

## `shouldFallbackToAutoGenerated` (type: `boolean`):

When enabled, automatically falls back to auto-generated captions or the video's original caption track if none of your preferred languages have manual subtitles.

## `targetTranslationLanguage` (type: `string`):

Optional target language code (for example: es, fr, de, ja, zh-Hans). Uses a native subtitle track when already published on the video, or translates automatically via YouTube's built-in subtitle translation.

## `shouldIncludeSegments` (type: `boolean`):

Include the full array of timestamped segments ({ startSeconds, durationSeconds, text }). Disable this option if you only need clean merged fullText and metadata for compact exports.

## `requestMinIntervalMs` (type: `integer`):

Minimum wait time in milliseconds between consecutive requests during large batch jobs.

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

Default managed routing for reliable batch runs (enabled automatically).

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk"
  ],
  "preferredLanguages": [
    "en"
  ],
  "shouldFallbackToAutoGenerated": true,
  "shouldIncludeSegments": true,
  "requestMinIntervalMs": 150,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `runSummary` (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=aircAruvnKk"
    ],
    "preferredLanguages": [
        "en"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("alias_md5/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=aircAruvnKk"],
    "preferredLanguages": ["en"],
    "proxyConfiguration": { "useApifyProxy": True },
}

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

```

## MCP server setup

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