# YouTube Transcript Scraper API: Subtitles, SRT & AI Markdown (`salmon_chaparral/youtube-transcript-scraper`) Actor

YouTube transcript scraper for manual or auto-generated captions, timestamped segments, SRT subtitles & RAG Markdown chunks from video URLs, Shorts & IDs — no YouTube API key or browser. Export JSON, CSV or SRT. $0 start, $2/1K transcripts ($0.002 each); failed videos never charged.

- **URL**: https://apify.com/salmon_chaparral/youtube-transcript-scraper.md
- **Developed by:** [Max Lee](https://apify.com/salmon_chaparral) (community)
- **Categories:** Videos, AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 transcripts extracted

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: Bulk Captions, SRT & AI Markdown

Extract clean YouTube transcripts, timestamped segments, SubRip (`.srt`) subtitles, and RAG-ready Markdown chunks from bulk video URLs or YouTube channel RSS feeds — no browser, proxy setup, or API key required.

- **$0 Start Pay-Per-Event Pricing:** **$0 Actor start fee** + **$0.002 per extracted transcript** (`$2.00 / 1,000 videos`). The Apify $5/mo Free tier covers **2,500 transcripts/month**. Videos with disabled captions or failed fetches are never charged.
- **Zero-Config First Run:** Click **Start** with default inputs to inspect a full Dataset item in under 5 seconds at 256 MB RAM.
- **4 Output Formats per Video:** Clean `fullText`, timestamped `segments`, ready-to-import `srt`, and RAG-ready `markdownChunks` with clickable YouTube `&t=` timestamp links.
- **Bulk Videos + Channel RSS:** Accepts watch URLs, `youtu.be` links, Shorts, embeds, live URLs, 11-character video IDs, and channel URLs / `UC...` IDs / RSS feeds (`feeds/videos.xml?channel_id=...`).

### Common Use Cases

- **LLM & RAG Knowledge Bases:** Chunk long-form talks, tutorials, and interviews into `markdownChunks` with clickable timestamp citations for Pinecone, Qdrant, or pgvector.
- **Automated Channel Monitoring:** Schedule daily or weekly runs on channel RSS feeds to summarize new uploads into Slack, Notion, or n8n workflows.
- **Bulk Subtitle & SEO Repurposing:** Download clean `.srt` captions and full-text transcripts for blog posts, newsletters, clips, and multilingual localization.

***

### Input Example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "channelUrls": [
    "https://www.youtube.com/feeds/videos.xml?channel_id=UCuAXFkgsw1L7xaCfnd5JJOw"
  ],
  "maxVideosPerChannel": 5,
  "language": "en",
  "preferManualCaptions": true,
  "chunkMaxChars": 1500
}
```

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `videoUrls` | `string[]` | `["https://www.youtube.com/watch?v=dQw4w9WgXcQ"]` | YouTube watch/shorts/live/embed/youtu.be URLs or 11-char video IDs. |
| `channelUrls` | `string[]` | `[]` | Channel IDs (`UC...`), `/channel/UC...`, `/@handle`, or `feeds/videos.xml?channel_id=...` URLs. |
| `maxVideosPerChannel` | `integer` | `15` | Latest videos per channel RSS feed (1–15). |
| `language` | `string` | `"en"` | Preferred BCP-47 caption language code (`en`, `es`, `de`, `ja`, etc.). Falls back cleanly if unavailable. |
| `preferManualCaptions` | `boolean` | `true` | Prefer human-written captions over auto-generated ASR when both exist. |
| `chunkMaxChars` | `integer` | `1500` | Target max character size per chunk in `markdownChunks` for RAG / LLM pipelines. |
| `concurrency` | `integer` | `5` | Concurrent pure-HTTP video workers (1–15). |
| `requestTimeoutMs` | `integer` | `15000` | Per-request HTTP timeout in milliseconds. |

***

### Output Example (Dataset Item)

```json
{
  "videoId": "dQw4w9WgXcQ",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "channel": "Rick Astley",
  "language": "en",
  "isAutoGenerated": false,
  "durationSec": 213,
  "fullText": "[♪♪♪] ♪ We're no strangers to love ♪ ...",
  "segments": [
    { "startSec": 1.36, "durationSec": 1.68, "endSec": 3.04, "text": "[♪♪♪]" },
    { "startSec": 18.64, "durationSec": 3.24, "endSec": 21.88, "text": "♪ We're no strangers to love ♪" }
  ],
  "srt": "1\n00:00:01,360 --> 00:00:03,040\n[♪♪♪]\n\n2\n00:00:18,640 --> 00:00:21,880\n♪ We're no strangers to love ♪\n",
  "markdownChunks": [
    {
      "index": 0,
      "startSec": 1.36,
      "endSec": 211.0,
      "timestampUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ&t=1s",
      "wordCount": 360,
      "markdown": "### [00:01](https://www.youtube.com/watch?v=dQw4w9WgXcQ&t=1s)\n\n[♪♪♪] ♪ We're no strangers to love ♪ ..."
    }
  ],
  "wordCount": 360
}
```

A compact run rollup (counts, skipped videos, duration, billing events) is also saved to the default Key-Value Store under `OUTPUT`.

***

### How It Works

1. Resolves video IDs from direct URLs, bare IDs, and YouTube channel Atom RSS feeds (`feeds/videos.xml`).
2. Fetches caption track metadata via YouTube Innertube player API with automatic watch-page HTML fallback.
3. Selects the best matching track (preferred language + manual captions over ASR, with automatic fallback).
4. Downloads structured `json3` captions with automatic timedtext XML fallback, normalizes entities/whitespace, and emits `fullText`, `segments`, `srt`, and `markdownChunks`.

# Changelog

This Actor's version history is a separate document: https://apify.com/salmon_chaparral/youtube-transcript-scraper/changelog.md

# Actor input Schema

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

List of YouTube video URLs (watch, youtu.be, shorts, embed, live) or 11-character video IDs (e.g. dQw4w9WgXcQ). Channel URLs and RSS feeds placed here are also expanded automatically.

## `channelUrls` (type: `array`):

Optional list of channel IDs (UC...), channel URLs (/channel/UC... or /@handle), or YouTube RSS feed URLs (https://www.youtube.com/feeds/videos.xml?channel_id=...). Latest videos are fetched via pure-HTTP RSS.

## `maxVideosPerChannel` (type: `integer`):

Maximum number of latest videos to pull from each channel RSS feed (YouTube RSS serves up to 15 latest videos).

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

Preferred ISO caption language code (e.g. en, es, fr, de, ja, pt-BR). Falls back to English or the first available caption track when unavailable.

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

When both human-authored and auto-generated (ASR) captions exist for the target language, pick the human-authored track first.

## `chunkMaxChars` (type: `integer`):

Target maximum character count per Markdown chunk in markdownChunks (ideal for LLM context windows and RAG vector indexing).

## `concurrency` (type: `integer`):

Number of videos to extract concurrently.

## `requestTimeoutMs` (type: `integer`):

HTTP timeout in milliseconds for each YouTube API or caption fetch.

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

Optional proxy settings (Apify Residential Proxy or custom proxy URLs) for high-volume extraction or if YouTube rate-limits datacenter IPs.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "maxVideosPerChannel": 15,
  "language": "en",
  "preferManualCaptions": true,
  "chunkMaxChars": 1500,
  "concurrency": 5,
  "requestTimeoutMs": 15000,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `items` (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"
    ],
    "language": "en",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

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

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

```

## MCP server setup

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