# YouTube Transcript & Subtitle Scraper (Fast Multi-Client) (`keenedigitalstudio/youtube-transcript-scraper`) Actor

Extract timestamped YouTube transcripts, plain text, SRT/VTT subtitles, chapters, and video metadata via multi-client Innertube API + yt-dlp fallback. $1.50/1,000 transcripts ($0.0015/item) with $0 start fee — 70-85% cheaper than existing scrapers. Built by Keene Digital Studio.

- **URL**: https://apify.com/keenedigitalstudio/youtube-transcript-scraper.md
- **Developed by:** [Keene Digital Studio](https://apify.com/keenedigitalstudio) (community)
- **Categories:** Videos, Social media, AI
- **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

## YouTube Transcript & Subtitle Scraper (Fast Multi-Client Engine)

**Publisher:** Keene Digital Studio\
**Pricing:** **$1.50 per 1,000 transcripts** (`$0.0015` per video transcript) · **$0.00 Actor start fee**\
**Speed:** ~150ms–300ms per video via direct multi-client YouTube Innertube API + automatic `yt-dlp` fallback.

***

### Why Switch to This Actor? (Transparent Pricing & Reliability Comparison)

Existing YouTube transcript scrapers on the Apify Store charge up to **$10.00 per 1,000 videos** while suffering from high datacenter IP failure rates (`15.7%` failed runs on `pintostudio/youtube-transcript-scraper`) or months of unmaintained staleness (`starvibe/youtube-video-transcript`).

Our engine uses a **4-stage multi-client extraction pipeline** (`IOS` Innertube API → `ANDROID` Innertube API → `ANDROID_VR` Innertube API → Watch Page + `yt-dlp` extractor fallback) that extracts both manual and auto-generated (`ASR`) captions in **<250ms** without requiring expensive residential proxies.

| Feature / Metric | **Keene Digital Studio**<br>`youtube-transcript-scraper` | **Incumbent #1**<br>`pintostudio/youtube-transcript-scraper` | **Incumbent #2**<br>`starvibe/youtube-video-transcript` |
| :--- | :---: | :---: | :---: |
| **Price per 1,000 Transcripts** | **$1.50 / 1k** (`$0.0015`/item) | $10.00 / 1k (`$0.01`/item) | $5.00 / 1k (`$0.005`/item) |
| **Actor Start Fee** | **$0.00** | $0.00 | $0.00 |
| **Your Savings** | **Baseline** | **85% Cheaper** | **70% Cheaper** |
| **30-Day Success Rate** | **>=98%+ Verified** | 84.3% (15.7% hard failure rate) | Stale (7+ months without update) |
| **Multi-Client Fallback** | **4-Stage (iOS + Android + VR + yt-dlp)** | Single client (breaks on bot check) | Legacy web parser |
| **Output Formats Included** | **JSON Segments + Plain Text + SRT + VTT** | JSON segments only | Plain text / basic segments |
| **Rich Video Metadata & Chapters** | **Included Free** (`title`, `channel`, `views`, `chapters`) | Limited | Limited |

***

### Key Features

- **4-Stage Multi-Client Extraction:** Automatically cycles through YouTube's native mobile Innertube clients (`IOS`, `ANDROID`, `ANDROID_VR`), watch-page initial player response, and `yt-dlp` subtitle extraction so your runs succeed reliably.
- **Smart Language Selection:** Pass an ordered array of preferred language codes (e.g. `["en", "es", "de"]`). Automatically falls back to English variants (`en`, `en-US`, `en-GB`) and then the first available manual or auto-generated caption track.
- **All Subtitle Formats in One Call:**
  - `segments`: Timestamped JSON array (`[{start, duration, end, text}, ...]`)
  - `fullText`: Clean, LLM-ready plain text transcript with HTML entities decoded
  - `srt`: Complete SubRip (`.srt`) formatted subtitle file string
  - `vtt`: Complete WebVTT (`.vtt`) formatted subtitle file string
- **Rich Video Metadata:** Returns `videoId`, `url`, `title`, `channelName`, `channelId`, `viewCount`, `durationSeconds`, `uploadDate`, `chapters` (`[{title, start_time, end_time}]`), `language`, `isAutoGenerated`, and `extractedVia`.
- **Flexible Input:** Accepts full watch URLs (`https://www.youtube.com/watch?v=...`), short links (`https://youtu.be/...`), YouTube Shorts (`https://www.youtube.com/shorts/...`), embed links, or raw 11-character video IDs.

***

### Input Example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=rfscVS0vtbw",
    "https://youtu.be/aircAruvnKk"
  ],
  "languages": ["en", "en-US"],
  "includeTimestamps": true,
  "includeSrt": true,
  "includeVtt": true,
  "preferAutoGenerated": false,
  "maxConcurrency": 5
}
```

***

### Output Example

```json
[
  {
    "videoId": "aircAruvnKk",
    "url": "https://www.youtube.com/watch?v=aircAruvnKk",
    "title": "But what is a neural network? | Deep learning chapter 1",
    "channelName": "3Blue1Brown",
    "channelId": "UCYO_jab_esuFRV4b17AJtAw",
    "viewCount": 19854120,
    "durationSeconds": 1120,
    "uploadDate": null,
    "chapters": [
      { "title": "Introduction", "start_time": 0, "end_time": 67 },
      { "title": "Neurons", "start_time": 67, "end_time": 215 }
    ],
    "language": "en",
    "isAutoGenerated": false,
    "extractedVia": "innertube_ios",
    "segmentCount": 369,
    "fullText": "This is a 3. It's sloppily written and rendered at an extremely low resolution of 28x28 pixels...",
    "segments": [
      {
        "start": 1.24,
        "duration": 4.12,
        "end": 5.36,
        "text": "This is a 3."
      }
    ],
    "srt": "1\n00:00:01,240 --> 00:00:05,360\nThis is a 3.\n...",
    "vtt": "WEBVTT\n\n00:00:01.240 --> 00:00:05.360\nThis is a 3.\n...",
    "elapsedMs": 149
  }
]
```

***

### Local CLI Usage

```bash
python3 -m src.main --input '{"videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"]}'
```

Built and maintained by **Keene Digital Studio**.

# Actor input Schema

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

List of YouTube video URLs (watch, youtu.be, shorts, embed) to extract transcripts from.

## `videoIds` (type: `array`):

Optional list of 11-character YouTube video IDs (can be used instead of or alongside videoUrls).

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

Ordered list of preferred BCP-47 language codes (e.g. \['en', 'en-US', 'es']). Automatically falls back to English and then first available track.

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

Include array of {start, duration, end, text} segments in the output.

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

Include formatted SubRip (.srt) subtitle content in the output.

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

Include formatted WebVTT (.vtt) subtitle content in the output.

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

If true, prefers YouTube ASR auto-generated captions over manual subtitles when both exist for a language.

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

Maximum number of parallel video extractions.

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

Optional Apify Proxy or custom proxy URLs. Not required for normal runs; enable only if running high-volume batches from rate-limited shared IPs.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "videoIds": [],
  "languages": [
    "en",
    "en-US"
  ],
  "includeTimestamps": true,
  "includeSrt": true,
  "includeVtt": true,
  "preferAutoGenerated": false,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Dataset containing all extracted YouTube transcripts and video metadata.

## `overview` (type: `string`):

Tabular overview of extracted YouTube transcripts.

# 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"
    ],
    "videoIds": [],
    "languages": [
        "en",
        "en-US"
    ],
    "maxConcurrency": 5,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("keenedigitalstudio/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"],
    "videoIds": [],
    "languages": [
        "en",
        "en-US",
    ],
    "maxConcurrency": 5,
    "proxyConfiguration": { "useApifyProxy": False },
}

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

```

## MCP server setup

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