# YouTube Transcript Scraper - Subtitles and Captions (`openclawmara/youtube-transcript-scraper`) Actor

Extract transcripts and subtitles from YouTube videos. Get auto-generated or manual captions in any language. Bulk extraction from video URLs, channels, or playlists. Output as plain text, timestamped segments, or SRT. Perfect for content repurposing, SEO, and video analysis.

- **URL**: https://apify.com/openclawmara/youtube-transcript-scraper.md
- **Developed by:** [OpenClaw Mara](https://apify.com/openclawmara) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 15 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 transcript scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## 🎬 YouTube Transcript Scraper — Subtitles, Captions & Video Text at Scale

**Price:** `$0.005` per scraped transcript · No API key needed · No YouTube Data API quota

Extract transcripts, subtitles, and captions from any public YouTube video. Get auto-generated or manually created captions in any available language, with or without timestamps, and output as **structured JSON**, **plain text**, or **SRT subtitle format** — ready for LLM pipelines, content repurposing, SEO research, and accessibility work.

No API key, no OAuth, no Google Data API quotas. Just paste URLs (or video IDs) and get back clean transcript data in seconds.

### 🚀 What does this Actor do?

This Actor talks to the same internal transcript endpoint that the YouTube web player uses, so it's fast, quota-free, and doesn't run a headless browser. It handles:

- 🌍 **Any available language** — Request a specific language; falls back to available captions if your preferred one isn't present
- ⏱️ **Timestamps on/off** — Toggle between timestamped segments (for seek / citation) or concatenated plain text (for RAG)
- 🧾 **3 output formats** — `structured` (JSON segments), `plain_text` (flat string), or `srt` (standard subtitle format)
- 📦 **Bulk mode** — Pass many video URLs or IDs in one run and stream results into a single dataset
- 🚫 **No API key, no browser** — Lightweight, fast, deterministic

Perfect for content repurposing, RAG pipelines, SEO keyword extraction, accessibility compliance, podcast-style summaries, and video analytics.

### 💡 Use Cases (with ready-to-paste inputs)

#### 1. Feed a RAG / LLM pipeline with YouTube knowledge

Grab transcripts from a channel's videos and push them into a vector DB for an "ask my channel" chatbot. Plain text output = clean tokens.

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=VIDEO_ID_1",
    "https://www.youtube.com/watch?v=VIDEO_ID_2"
  ],
  "language": "en",
  "includeTimestamps": false,
  "outputFormat": "plain_text"
}
```

#### 2. Repurpose video content into blog posts / newsletters

Pull the transcript, hand it to an LLM with "rewrite this as a 500-word blog post" — one YouTube video becomes one article. At `$0.005` per transcript, a weekly 5-video → 5-post pipeline is ~$0.10/month.

```json
{
  "urls": ["https://www.youtube.com/watch?v=YOUR_VIDEO"],
  "language": "en",
  "includeTimestamps": false,
  "outputFormat": "plain_text"
}
```

#### 3. Generate SRT subtitle files for accessibility or translation

Export standards-compliant `.srt` files from any existing video — load them into Premiere, DaVinci Resolve, CapCut, or a translation workflow.

```json
{
  "urls": ["https://www.youtube.com/watch?v=YOUR_VIDEO"],
  "language": "en",
  "outputFormat": "srt"
}
```

#### 4. Timestamped research notes with deep-link citations

Keep `includeTimestamps: true` so each segment has a start offset — build clickable "jump-to-quote" links (`?t=123s`) for research write-ups, podcast show notes, or court-style transcripts.

```json
{
  "urls": ["https://www.youtube.com/watch?v=YOUR_VIDEO"],
  "language": "en",
  "includeTimestamps": true,
  "outputFormat": "structured"
}
```

### ⚙️ Input

| Field | Type | Description |
|-------|------|-------------|
| `urls` | array | YouTube video URLs (standard `watch?v=` or `youtu.be/` format) |
| `videoIds` | array | Alternative to URLs — raw 11-char video IDs |
| `language` | string | Preferred caption language as ISO 639-1 code (`en`, `ru`, `es`, `de`…). Falls back automatically |
| `includeTimestamps` | boolean | Keep per-segment timing info (default: `true`) |
| `outputFormat` | `structured` · `plain_text` · `srt` | Shape of the transcript field (default: `structured`) |

### 📊 Output Example

#### Structured JSON (`outputFormat: "structured"`)

```json
{
  "videoId": "dQw4w9WgXcQ",
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "language": "en",
  "segmentCount": 42,
  "segments": [
    { "text": "Welcome back to the channel", "start": 0.0, "duration": 2.5 },
    { "text": "today we're talking about...", "start": 2.5, "duration": 3.1 }
  ]
}
```

#### Plain text (`outputFormat: "plain_text"`)

```json
{
  "videoId": "dQw4w9WgXcQ",
  "language": "en",
  "plainText": "Welcome back to the channel today we're talking about..."
}
```

#### SRT (`outputFormat: "srt"`)

Standard subtitle blocks (`index → HH:MM:SS,ms --> HH:MM:SS,ms → text`) ready to load into any subtitle-aware player or editor.

### 💰 Pricing & Performance

- **Cost:** `$0.005` per scraped transcript (pay-per-result, no monthly fee)
- **Typical runtime:** 1-3 seconds per video, parallelized in bulk mode
- **Success rate (last 30 days):** ~60% — failures are usually private/age-restricted videos or videos without captions
- **Best batch size:** 20-100 videos per run

Budgets:

- 10 videos/day RAG feeder → **~$1.50/month**
- 1,000-video one-off dataset → **$5 flat**
- 100-video weekly digest → **~$2/month**

### 🔌 Integrations

- **Zapier / Make / n8n** — Schedule a run, auto-send transcripts into Notion pages, Google Docs, or a Slack channel
- **Webhooks** — Post-run callbacks into your backend or Lambda / Cloud Function
- **Python / Node SDK** — `apify-client` pull directly into your code
- **LangChain / LlamaIndex** — Use the Apify Loader to feed transcripts straight into a RAG chain
- **OpenAI / Anthropic / local LLMs** — Plain-text output is token-efficient and model-agnostic
- **CSV / JSONL / Excel export** — Download from the Apify console for spreadsheet workflows

### ❓ FAQ

**Do I need a YouTube or Google API key?**
No. No auth, no OAuth, no Data API quotas.

**What if the video has no captions?**
The run marks that item as failed and keeps going with the rest of the batch. You only pay for successful transcripts.

**Can it do translations?**
Out of the box it extracts captions in the languages available on the video itself. Pass `language: "es"` to prefer Spanish when both are available. For translation, chain this Actor's plain-text output into an LLM step.

**Private / age-restricted videos?**
Not supported — those need authenticated sessions. Public videos only.

**Does it handle `youtu.be/` short URLs?**
Yes — both `youtube.com/watch?v=...` and `youtu.be/...` are parsed automatically.

### 🔑 Keywords

YouTube transcript scraper, YouTube subtitle extractor, YouTube captions API alternative, SRT downloader, YouTube RAG, video transcript, video to blog post, YouTube SEO, video analytics, subtitle extraction, caption scraper, video accessibility, podcast transcription, YouTube data, content repurposing, LLM training data, video search, transcript API, video text extraction.

# Actor input Schema

## `urls` (type: `array`):

List of YouTube video URLs to extract transcripts from

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

YouTube video IDs (11 characters). Alternative to URLs.

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

Preferred transcript language (ISO 639-1 code). Falls back to available language if not found.

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

Include start time and duration for each transcript segment

## `outputFormat` (type: `string`):

Format of the transcript output

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "language": "en",
  "includeTimestamps": true,
  "outputFormat": "structured"
}
```

# 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 = {
    "urls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ]
};

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

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

```

## MCP server setup

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