# YouTube Transcript & Chapters RAG API — No Login ($1.20/1K) (`studio001/youtube-transcript-chapters-pro-api`) Actor

No-login YouTube transcript & chapter API via 4-tier Innertube + Whisper fallback ($1.20/1K Gold, 256MB RAM). Callable via native MCP (/mcp) or real-time Standby REST API. Outputs RAG Markdown, SRT, VTT & token stats. $0 on unavailable videos.

- **URL**: https://apify.com/studio001/youtube-transcript-chapters-pro-api.md
- **Developed by:** [YEONG JUN YOO](https://apify.com/studio001) (community)
- **Categories:** Videos, AI, MCP servers
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 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, Chapters & LLM-Ready Caption Pro API

**Ultra-fast, zero-browser YouTube transcript, chapter alignment, and RAG Markdown extractor.** Engineered on a 4-tier extraction cascade (`Innertube iOS` → `Innertube Android` → `youtube-transcript-api` → `yt-dlp`) plus optional Whisper speech-to-text fallback, running at **256–512 MB RAM** and **281.3 ms per video**—at **60–80% lower PPE cost** and with **$0 charge on unavailable, invalid, or captionless videos**.

[![RAM Footprint](https://img.shields.io/badge/RAM-256--512%20MB-brightgreen)](#architecture-anti-bot-politeness--troubleshooting)
[![Measured Speed](https://img.shields.io/badge/Latency-281.3%20ms%2Fvideo-blue)](#why-this-actor-outperforms-legacy-scrapers)
[![Live Benchmark](https://img.shields.io/badge/Live%20Success-100%25%20\(10%2F10%20Videos\)-success)](#why-this-actor-outperforms-legacy-scrapers)
[![Pricing](https://img.shields.io/badge/PPE-%242.00%2F1K%20\(Free\)%20%E2%86%92%20%241.20%2F1K%20\(Gold\)-orange)](#transparent-ppe-pricing--5-free-tier-cost-estimator)
[![MCP Ready](https://img.shields.io/badge/MCP-mcp.apify.com%20Ready-purple)](#ai-agents-mcp--skills-ready)

***

### Executive Value Proposition

Building AI research assistants, RAG vector indexes, podcast/course summarizers, or multilingual subtitle workflows around YouTube requires far more than raw XML caption dumps. Legacy transcript scrapers either fail silently on cloud IPs, drop video chapters, or bill `$5.00–$10.00 / 1,000` videos even when inputs are broken.

**YouTube Transcript & Chapters Pro API (`studio001/youtube-transcript-chapters-pro-api`)** is built from the ground up for production LLM & data engineering pipelines:

- **60–80% Lower Cost**: Pay `$0.00005` per extracted transcript (`$2.00 / 1,000` Free/Bronze), `$0.0016` Silver (`$1.60 / 1,000`), or `$0.0012` Gold (`$1.20 / 1,000`) plus a `$0.00005` run start.
- **4-Tier Zero-Browser Cascade**: Combines YouTube Innertube `iOS` and `Android` client APIs with `youtube-transcript-api` and `yt-dlp`, plus a polite 1-shot Cloud Datacenter proxy retry if unproxied Cloud IPs hit HTTP `429` or consent walls (never retrying `/sorry/` CAPTCHAs).
- **Chapter-Aligned RAG Markdown (`chapterMarkdown`)**: Fetches official YouTube Studio chapters via `youtubei/v1/next` (`chapterRenderer` / `macroMarkersListItemRenderer`) and falls back to timestamped description parsing, grouping spoken captions cleanly under `## [MM:SS] Chapter Title` headings.
- **LLM Token Telemetry & Multi-Format Export**: Automatically calculates `wordCount`, `estimatedTokens`, `isAutoGenerated`, and generates `plainText`, `chapterMarkdown`, `srt`, `vtt`, and granular `segments[]` in a single run.
- **Zero-Charge Error Guarantee**: Invalid URLs (`invalid_url`), private/deleted/region-locked videos (`unavailable`), and captionless videos (`no_captions`) push structured JSON items at **$0 transcript charge** without crashing the batch.

***

### Why This Actor Outperforms Legacy Scrapers

Public Apify Store data shows popular YouTube transcript actors cost **`$5.00 to $10.00` per 1,000 videos**—for example, `starvibe/youtube-video-transcript` charges `$0.005`/result and `pintostudio/youtube-transcript-scraper` charges `$0.01`/result (while logging `15,717` failed runs over 30 days)—and neither outputs chapter-aligned RAG Markdown with token estimates.

| Capability / Metric | **Studio 001: YouTube Transcript & Chapters Pro API** | `starvibe/youtube-video-transcript` | `pintostudio/youtube-transcript-scraper` |
| --- | --- | --- | --- |
| **Extraction Pipeline** | **4-Tier (`Innertube iOS/Android` + `yt-api` + `yt-dlp` + Whisper)** | Single-tier scraper | Legacy web/player scraper |
| **Container RAM** | **256–512 MB** | 512–1,024 MB | 512–2,048 MB |
| **Observed Reliability** | **100.0% (10/10 live benchmark, 281.3 ms/video)** | Standard API | **15,717 failed runs (30d Store stat)** |
| **Price / 1,000 Videos** | **$2.00 (Free/Bronze) · $1.60 (Silver) · $1.20 (Gold)** | `$5.00 / 1,000` (`$0.005`/result) | `$10.00 / 1,000` (`$0.01`/result) |
| **Run Start Fee** | `$0.00005` one-time | Platform compute / start | Higher CU / per-result |
| **Zero-Charge on Errors** | **Yes (`$0` for invalid, private, region-locked, no-captions)** | Partial / varies | Often bills on error or retries |
| **Chapter Alignment (`chapterMarkdown`)** | **Yes (Studio `next` + description fallback)** | No | No |
| **Formats Supported** | **`plainText`, `chapterMarkdown`, `srt`, `vtt`, `segments[]`** | Plain/segments only | Plain/segments only |
| **Captionless Audio Fallback** | **Opt-in Whisper (`groqApiKey` or local `faster-whisper`)** | No | No |
| **AI / MCP Token Readiness** | **`estimatedTokens` + `chapterMarkdown` + `mcp.apify.com`** | Raw text | Raw text |

***

### High-Impact Use Cases

#### 1. AI Agents, RAG Knowledge Bases & Course Copilots

Chunking 1-hour lectures blindly by character count destroys topical boundaries. By setting `outputFormats: ["chapterMarkdown"]` and `includeSegments: false`, this Actor outputs clean Markdown sectioned by YouTube chapter headings (`## [00:00] Introduction`, `## [04:15] Gradient Descent`) plus `estimatedTokens`, ready to embed directly into Pinecone, Qdrant, pgvector, LlamaIndex, or LangChain.

#### 2. Scheduled Creator & Competitor Intelligence (Cron Monitoring)

Pair with **[YouTube Channel Search & Creator Discovery Pro API](https://apify.com/studio001/youtube-channel-search-pro-api)** on an hourly or daily cron schedule via Apify Schedules, n8n, or Make.com. Track newly published competitor tutorials, product launches, and podcast episodes—extracting exact quotes, timestamps (`srt`/`vtt`), and topic transitions automatically.

#### 3. Multilingual Subtitle Localization & Content Repurposing Pipelines

Marketing and media teams feed `watch?v=`, `youtu.be/`, `shorts/`, and `live/` links in batches (`languages: ["en", "ko", "ja"]`, `preferManualCaptions: true`), exporting `srt` and `vtt` files directly for video editors or passing `plainText` to LLMs for newsletter threads, blog posts, and LinkedIn carousels.

***

### Quick-Start Input JSON

#### Minimal Quick-Start (RAG Markdown + Plain Text)

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://youtu.be/dQw4w9WgXcQ",
    "J5-Nk4FvDw0"
  ],
  "languages": ["en", "ko", "ja"],
  "outputFormats": ["plainText", "chapterMarkdown"]
}
```

#### Full Batch Configuration (All Formats + Opt-In Whisper Fallback + Budget Cap)

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://www.youtube.com/watch?v=arj7oStGLkU",
    "https://www.youtube.com/shorts/-B2MKjp-BNc",
    "https://www.youtube.com/live/zjkBMFhNj_g"
  ],
  "languages": ["en", "ko", "ja", "es"],
  "preferManualCaptions": true,
  "includeChapters": true,
  "includeSegments": true,
  "outputFormats": ["plainText", "chapterMarkdown", "srt", "vtt"],
  "enableWhisperFallback": true,
  "proxyConfiguration": { "useApifyProxy": false },
  "maxTotalChargeUsd": 0.5
}
```

***

### Input Parameter Reference

All inputs are organized in the Apify Console into **4 collapsible sections**. The Actor supports `watch?v=`, `youtu.be/`, `shorts/`, `embed/`, `live/`, `m.youtube.com`, `attribution_link`, raw 11-character IDs, comma/newline-separated string inputs, and common competitor aliases (`videoUrls`, `videoUrl`, `youtube_url`, `url`, `targetLanguage`, `language`).

| Parameter | Type | Default / Prefill | Section | Description |
| --- | --- | --- | --- | --- |
| `urls` | `array<string>` (or string) | `["https://www.youtube.com/watch?v=aircAruvnKk"]` | 1. Target Videos | List or comma/newline string of YouTube URLs or 11-char IDs. Aliases: `videoUrls`, `youtube_url`, `url`. |
| `videoUrl` | `string` | `—` | 1. Target Videos | Single video URL or ID fallback when `urls` is omitted. |
| `languages` | `array<string>` (or string) | `["en", "ko", "ja", "es", "fr", "de"]` | 2. Languages & Formats | Priority-ordered ISO 639-1 language codes; falls back to any available track if none match. Aliases: `targetLanguage`, `language`. |
| `preferManualCaptions` | `boolean` | `true` | 2. Languages & Formats | Prefers creator-uploaded subtitles over ASR auto-captions within matching languages. |
| `includeChapters` | `boolean` | `true` | 2. Languages & Formats | Extracts Studio (`youtubei/v1/next`) or description chapters and aligns spoken text per chapter. |
| `includeSegments` | `boolean` | `true` | 2. Languages & Formats | Includes granular `segments[]` array (`startSec`, `durationSec`, `endSec`, `text`). |
| `outputFormats` | `array<string>` | `["plainText", "chapterMarkdown"]` | 2. Languages & Formats | Formats to include on `status: "ok"` items: `plainText`, `chapterMarkdown`, `srt`, `vtt`. |
| `enableWhisperFallback` | `boolean` | `false` | 3. Whisper Fallback | When `true`, transcribes playable captionless videos via Groq Whisper or local `faster-whisper`. |
| `groqApiKey` | `string` (secret) | `—` | 3. Whisper Fallback | Optional Groq API key (`whisper-large-v3-turbo`) used first when `enableWhisperFallback` is `true`. |
| `proxyConfiguration` | `object` | `{"useApifyProxy": false}` | 4. Proxy & Guardrails | Optional Apify Proxy configuration. Cloud runners automatically do 1 polite DC retry on non-CAPTCHA 429 blocks. |
| `maxTotalChargeUsd` | `number` (`>= 0`) | `—` | 4. Proxy & Guardrails | Hard USD PPE cap for the run; stops billing/pushing once reached and skips Whisper fallback if unaffordable. |

***

### Output Example & Field Dictionary

#### Full Dataset Item Example (`status: "ok"`)

```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",
  "durationSeconds": 1153,
  "viewCount": 18420500,
  "language": "en",
  "isAutoGenerated": false,
  "chapterCount": 5,
  "chapters": [
    {
      "title": "Introduction",
      "startSec": 0.0,
      "endSec": 110.0,
      "text": "This is a 3. It's sloppily written and rendered at an extremely low resolution..."
    }
  ],
  "wordCount": 2740,
  "estimatedTokens": 3680,
  "extractionMethod": "innertube_ios",
  "status": "ok",
  "plainText": "This is a 3. It's sloppily written and rendered at an extremely low resolution...",
  "chapterMarkdown": "# But what is a neural network? | Deep learning chapter 1\n**Channel:** 3Blue1Brown | **URL:** https://www.youtube.com/watch?v=aircAruvnKk\n\n## [00:00] Introduction\nThis is a 3...",
  "srt": "1\n00:00:00,000 --> 00:00:03,200\nThis is a 3.",
  "vtt": "WEBVTT\n\n00:00:00.000 --> 00:00:03.200\nThis is a 3.",
  "segments": [
    {
      "startSec": 0.0,
      "durationSec": 3.2,
      "endSec": 3.2,
      "text": "This is a 3."
    }
  ]
}
```

#### Zero-Charge Unavailable / Invalid Item Example (`$0` Transcript Fee)

```json
{
  "videoId": "INVALID_ID0",
  "url": "https://www.youtube.com/watch?v=INVALID_ID0",
  "title": null,
  "channelName": null,
  "durationSeconds": 0,
  "language": null,
  "isAutoGenerated": null,
  "chapterCount": 0,
  "wordCount": 0,
  "estimatedTokens": 0,
  "extractionMethod": null,
  "status": "unavailable",
  "error": "This video is unavailable"
}
```

#### Key-Value Store Telemetry (`OUTPUT_METRICS`)

```json
{
  "counts": { "apify-actor-start": 1, "transcript-extracted": 15 },
  "bronze_total_usd": 0.031,
  "blended_total_usd": 0.02815,
  "wire_bytes_in": 16197450,
  "wire_bytes_out": 14820,
  "videosTotal": 16,
  "videosSucceeded": 15,
  "videosUnavailableZeroCharge": 1,
  "videosWhisperFallback": 0,
  "requestCount": 47
}
```

#### Comprehensive Output Field Dictionary

| Field | Type | Description |
| --- | --- | --- |
| `videoId` | `string \| null` | Validated 11-character YouTube video ID (`null` when `status == "invalid_url"`). |
| `url` | `string` | Canonical `https://www.youtube.com/watch?v=<videoId>` URL (or raw input if invalid). |
| `title` | `string \| null` | Video title extracted from Innertube `videoDetails` or `yt-dlp`. |
| `channelName` | `string \| null` | Creator or channel display name (`author` / `uploader`). |
| `channelId` | `string \| null` | YouTube channel ID (`UC...`) when returned by player metadata. |
| `durationSeconds` | `integer` | Total video duration in seconds (`0` if unavailable). |
| `viewCount` | `integer` | Total video views at extraction time (present on `status: "ok"` items). |
| `language` | `string \| null` | Selected BCP-47/ISO caption language code (e.g., `"en"`, `"ko"`). |
| `isAutoGenerated` | `boolean \| null` | `true` for YouTube ASR auto-captions or Whisper fallback; `false` for manual captions. |
| `chapterCount` | `integer` | Number of extracted chapters (`0` if unchaptered or `includeChapters: false`). |
| `chapters` | `array<object>` | Array of `{title, startSec, endSec, text}` aligned chapters (when `includeChapters: true`). |
| `wordCount` | `integer` | Total space-delimited word count of `plainText`. |
| `estimatedTokens` | `integer` | Estimated LLM token count (`ceil(len(plainText) / 4)`) for RAG context budgeting. |
| `extractionMethod` | `string \| null` | Tier that succeeded: `innertube_ios`, `innertube_android`, `youtube_transcript_api`, `yt_dlp`, `whisper_groq`, or `whisper_local`. |
| `status` | `string` | `ok`, `invalid_url`, `unavailable`, `no_captions`, or `whisper_unavailable`. |
| `plainText` | `string` | Clean whitespace-normalized transcript string (included if `"plainText"` is in `outputFormats`). |
| `chapterMarkdown` | `string` | Markdown with `# Title`, metadata line, and `## [MM:SS] Chapter` sections (if `"chapterMarkdown"` requested). |
| `srt` | `string` | SubRip subtitle file body with `HH:MM:SS,mmm` timestamps (if `"srt"` requested). |
| `vtt` | `string` | WebVTT subtitle file body starting with `WEBVTT` (if `"vtt"` requested). |
| `segments` | `array<object>` | Granular cues `[{startSec, durationSec, endSec, text}]` (when `includeSegments: true`). |
| `error` | `string` | Human-readable failure or unavailability reason (present only when `status != "ok"`). |

***

### Transparent PPE Pricing & $5 Free Tier Cost Estimator

You pay only for **actor initialization** (`apify-actor-start`) and **successfully extracted transcripts** (`transcript-extracted`, where `status == "ok"`). Optional `whisper-minute` charges apply **only** if `enableWhisperFallback: true` actually transcribes a captionless video via Whisper. **Invalid URLs, private videos, region blocks, and captionless videos incur `$0` transcript charge.**

#### Live Pay-Per-Event (PPE) Schedule

| Event Name | Trigger Condition | FREE | BRONZE | SILVER | GOLD |
| --- | --- | :---: | :---: | :---: | :---: |
| `apify-actor-start` | One-time run initialization fee | `$0.00005` | `$0.00005` | `$0.00005` | `$0.00005` |
| `transcript-extracted` | Per video with `status == "ok"` | `$0.002` (`$2.00/1K`) | `$0.002` (`$2.00/1K`) | `$0.0016` (`$1.60/1K`) | `$0.0012` (`$1.20/1K`) |
| `whisper-minute` | Optional per audio minute (Whisper fallback only) | `$0.008` | `$0.008` | `$0.007` | `$0.006` |

#### Plan Budget & Capacity Estimator (Assuming 100 Videos / Run)

| Apify Plan Tier | Monthly Credit | Standard Caption Capacity (`transcript-extracted`) | Effective Cost / 1K Transcripts (incl. start) | Note on Whisper Fallback |
| --- | :---: | :---: | :---: | --- |
| **Free Tier** | **$5.00** | **~2,495 videos** | **$2.01 / 1K** | Optional (`$0.008/min` only if captions missing) |
| **Starter ($19/mo)** | **$19.00** | **~9,495 videos** | **$2.01 / 1K** (Bronze rate) | Disabled by default (`enableWhisperFallback: false`) |
| **Scale ($199/mo)** | **$199.00** | **~99,495 (Bronze) – ~165,800 (Gold)** | **$1.21 – $2.01 / 1K** | Hard-capped safely via `maxTotalChargeUsd` |

***

### AI Agents, MCP & Skills Ready

#### 1. Model Context Protocol (MCP) — Claude Desktop, Cursor & VS Code

Expose this Actor directly as a tool in Claude Desktop, Cursor, or VS Code using `mcp.apify.com` scoped to `studio001/youtube-transcript-chapters-pro-api`:

```json
{
  "mcpServers": {
    "youtube-transcript-pro": {
      "url": "https://mcp.apify.com/?actors=studio001/youtube-transcript-chapters-pro-api",
      "headers": {
        "Authorization": "Bearer <APIFY_API_TOKEN>"
      }
    }
  }
}
```

Example MCP prompt in Claude or Cursor:

> *"Use `studio001/youtube-transcript-chapters-pro-api` to extract `chapterMarkdown` (with `includeSegments: false`) from `https://www.youtube.com/watch?v=zjkBMFhNj_g` and summarize the key takeaways per chapter."*

#### 2. For AI Agents & LLMs — Copy-Paste Skill Block

```markdown
#### Skill: YouTube Transcript & Chapter RAG Extraction
- **Actor ID**: `studio001/youtube-transcript-chapters-pro-api`
- **When to use**: Extracting clean transcripts, chapters, token counts, or SRT/VTT subtitles from any YouTube watch, Shorts, Live, Embed, or youtu.be URL or 11-char ID.
- **Token-optimized RAG payload**: Pass `{"urls": ["<url>"], "outputFormats": ["chapterMarkdown"], "includeSegments": false, "includeChapters": true}` so the context window is not flooded with segment arrays.
- **Zero-charge handling**: Check `item.status === "ok"`. If `status` is `"unavailable"`, `"no_captions"`, or `"invalid_url"`, no transcript fee was charged; read `item.error`.
- **Key output fields**: `videoId`, `title`, `channelName`, `durationSeconds`, `language`, `isAutoGenerated`, `chapterCount`, `estimatedTokens`, `chapterMarkdown`, `plainText`, `chapters[]`.
```

#### 3. n8n, Make.com & Zapier Cron Workflows

Ready-to-import workflow templates (Notion video summarizers, Slack channel digests, and Pinecone RAG ingestion crons) live in **[yeongjunyoo/studio001-apify-clients](https://github.com/yeongjunyoo/studio001-apify-clients)**.

- **n8n Cron Recipe**:
  1. Trigger from **YouTube Channel Search Pro** (or an RSS / Google Sheets video queue) on a schedule (`0 */6 * * *`).
  2. Call **Apify -> Run Actor (`studio001/youtube-transcript-chapters-pro-api`)** with:
     ```json
     {
       "urls": ["{{ $json.videoUrl }}"],
       "languages": ["en", "ko"],
       "includeChapters": true,
       "includeSegments": false,
       "outputFormats": ["chapterMarkdown", "plainText"],
       "maxTotalChargeUsd": 0.5
     }
     ```
  3. Filter `status === "ok"`, inspect `estimatedTokens`, and pass `chapterMarkdown` straight into your OpenAI / Anthropic / Vector Store node.
- **Make.com / Zapier**: Use the synchronous REST endpoint below to return the dataset array inside a single HTTP module without polling.

#### 4. Python (`apify-client`) & cURL REST API Quickstart

##### Python (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_API_TOKEN>")

run = client.actor("studio001/youtube-transcript-chapters-pro-api").call(
    run_input={
        "urls": [
            "https://www.youtube.com/watch?v=aircAruvnKk",
            "https://youtu.be/arj7oStGLkU",
        ],
        "languages": ["en", "ko"],
        "includeChapters": True,
        "includeSegments": False,
        "outputFormats": ["chapterMarkdown", "plainText"],
    }
)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    if item["status"] == "ok":
        print(f"{item['title']} | {item['chapterCount']} chapters | ~{item['estimatedTokens']} tokens")
        print(item["chapterMarkdown"][:400])
```

##### cURL (Synchronous Run Returning Dataset Items)

```bash
curl -X POST "https://api.apify.com/v2/acts/studio001~youtube-transcript-chapters-pro-api/run-sync-get-dataset-items?token=<APIFY_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": ["https://www.youtube.com/watch?v=aircAruvnKk"],
    "languages": ["en", "ko"],
    "includeChapters": true,
    "outputFormats": ["chapterMarkdown", "plainText"]
  }'
```

***

### Architecture, Anti-Bot Politeness & Troubleshooting

#### 4-Tier Cascade + Optional Tier-5 Whisper Architecture

1. **Tier 1 & Tier 2 — Innertube Player (`IOS` → `ANDROID`)**: Posts directly to `youtube.com/youtubei/v1/player` with mobile client signatures, selects the best matching manual or ASR track via `select_best_caption_track()`, and parses `json3` or `srv3`/`srv1` XML captions cleanly.
2. **Tier 3 — `youtube-transcript-api` Fallback**: Invoked in a worker thread if mobile Innertube clients fail or return no caption tracks.
3. **Tier 4 — `yt-dlp` Subtitle & Metadata Fallback**: Extracts subtitle track URLs (`json3`/`srv3`/`vtt`) and rich video metadata (`channelId`, `viewCount`, `shortDescription`) without downloading video streams.
4. **Chapter Extraction & Alignment (`chapters.py`)**: Queries `youtubei/v1/next` (`chapterRenderer` & `macroMarkersListItemRenderer`) and falls back to `DESC_TS_RE` description timestamp extraction, slicing transcript segments into `[startSec, endSec)` intervals per chapter.
5. **Anti-Bot Politeness**:
   - **Never retries CAPTCHAs**: Any `/sorry/` redirect or `g-recaptcha` response immediately skips Tier 3/4/5 and proxy retries.
   - **1-Shot Cloud DC Retry**: Only when running unproxied on Apify Cloud and encountering a non-CAPTCHA `429` / consent IP block does the worker perform a single bounded retry via an Apify Datacenter proxy session.

#### Troubleshooting & Error Handling Table

| Status / Symptom | Cause | Billing Impact | Resolution |
| --- | --- | --- | --- |
| `status: "invalid_url"` | Input string did not contain a valid YouTube host or 11-character ID | **$0 transcript charge** | Verify URL format (`watch?v=`, `youtu.be/`, `shorts/`, `live/`, `embed/`, or 11-char ID). |
| `status: "unavailable"` | Private, deleted, members-only, copyright-removed, or region-locked video | **$0 transcript charge** | Confirm video plays publicly; set `proxyConfiguration` country if region-locked. |
| `status: "no_captions"` | Playable video has zero manual or auto-generated caption tracks | **$0 transcript charge** | Set `enableWhisperFallback: true` (and optionally pass `groqApiKey`) to transcribe audio. |
| `status: "whisper_unavailable"` | `enableWhisperFallback: true` failed (e.g., no `groqApiKey` and no local `faster-whisper`, or audio blocked) | **$0 transcript / Whisper charge** | Supply a valid `groqApiKey` or check `item.error` details. |
| `chapterCount: 0` | Video has neither YouTube Studio chapters nor `MM:SS` timestamps in its description | Normal (`plainText` still extracted) | Use `plainText` or `segments[]` directly for downstream chunking. |
| Batch truncated early | `maxTotalChargeUsd` spending limit reached | Stopped cleanly at budget cap | Increase `maxTotalChargeUsd` or split large playlists into multiple runs. |

***

### Frequently Asked Questions (FAQ)

**Q: Are invalid URLs, private videos, or captionless videos billed?**
No. Only items with `status == "ok"` trigger the `transcript-extracted` event. Every failed or empty video still pushes a clean diagnostic JSON object to the dataset (`status: "invalid_url"`, `"unavailable"`, `"no_captions"`, or `"whisper_unavailable"`) at **`$0` transcript cost**.

**Q: How can I keep payloads small for RAG and MCP tool calls?**
Set `includeSegments: false` and `outputFormats: ["chapterMarkdown"]` (or `["plainText"]`). This omits the large `segments[]` array and returns only clean chapter-structured Markdown and token estimates (`estimatedTokens`).

**Q: What happens when `enableWhisperFallback` is `true` without a `groqApiKey`?**
If `faster-whisper` is available in the container, it transcribes locally with `externalCostUsd: 0.0` (billed only via `whisper-minute`). If neither `groqApiKey` nor local `faster-whisper` is available—or audio download fails—it safely emits `status: "whisper_unavailable"` at `$0` charge.

**Q: Does language matching fail if a video only has Spanish or Japanese captions while I requested English?**
No. `languages` acts as a priority list (`["en", "ko", "ja"]`). If none of your preferred languages exist, `select_best_caption_track()` automatically falls back to the best available track on the video instead of returning empty.

**Q: Do I need paid Residential proxies for YouTube transcripts?**
No. Direct Innertube (`iOS`/`Android`) works out of the box with `{"useApifyProxy": false}` (`$0` proxy overhead), and Cloud runs automatically perform a single polite Datacenter retry only if an unproxied IP hits HTTP 429 or consent walls.

**Q: Can I pass a single comma-separated string instead of a JSON array?**
Yes. Both `urls` and `languages` accept comma- or newline-separated strings as well as JSON arrays, alongside drop-in aliases (`videoUrls`, `videoUrl`, `youtube_url`, `url`, `targetLanguage`, `language`).

***

### Use as a Real-Time API or Native MCP Server (Standby)

Run instant synchronous transcript extractions without batch cold starts:

- **Native MCP Endpoint (`LIMITED_PERMISSIONS`, `256 MB`):** `https://studio001--youtube-transcript-chapters-pro-api.apify.actor/mcp` (`tools/list` exposes `extract_youtube_transcript`)
- **Instant REST Endpoint:** `POST https://studio001--youtube-transcript-chapters-pro-api.apify.actor/api/run`

```bash
curl -X POST "https://studio001--youtube-transcript-chapters-pro-api.apify.actor/api/run" \
  -H "Authorization: Bearer YOUR_APIFY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "includeChapters": true, "outputFormats": ["plainText"]}'
```

***

### More High-Reliability APIs by Studio 001

Explore the full Studio 001 zero-browser API suite on Apify Store—all engineered for **low RAM**, **Pay-Per-Event transparency**, **$0 charge on errors**, and **MCP integration**:

| Actor | Category | Key Capability | Apify Store URL |
| --- | --- | --- | --- |
| **Google Hotels Multi-OTA Monitor** | Travel / AI / MCP | Direct `AtySUc` RPC hotel prices & Booking/Expedia/Agoda offers | [apify.com/studio001/google-hotels-multi-ota-monitor](https://apify.com/studio001/google-hotels-multi-ota-monitor) |
| **Instagram Reels AI Transcript & Hook Extractor** | Social / AI / MCP | Audio-first DASH + Groq/local Whisper + 3.5s opening hook analytics | [apify.com/studio001/instagram-reels-ai-transcript-hook-extractor](https://apify.com/studio001/instagram-reels-ai-transcript-hook-extractor) |
| **B2B Domain Email Finder & SMTP/MX Verifier** | Leads / DevTools / MCP | DoH MX/SPF/DMARC + pattern finder + Port-25/relay SMTP verify | [apify.com/studio001/b2b-email-finder-smtp-mx-verifier](https://apify.com/studio001/b2b-email-finder-smtp-mx-verifier) |
| **Google Ads Transparency Direct-RPC** | Marketing / AI / MCP | Direct RPC ad creative & advertiser intelligence at 256 MB RAM | [apify.com/studio001/google-ads-transparency-direct-rpc](https://apify.com/studio001/google-ads-transparency-direct-rpc) |
| **Naver Blog & Cafe Pro Scraper** | Korea / RAG / MCP | Fast Naver search, blog post bodies & cafe feeds for Korean market intel | [apify.com/studio001/naver-blog-cafe-pro-scraper](https://apify.com/studio001/naver-blog-cafe-pro-scraper) |
| **OliveYoung Global & KR Beauty API** | E-Commerce / Beauty | K-Beauty rankings, SKUs, prices, reviews & stock intelligence | [apify.com/studio001/oliveyoung-global-kr-beauty-api](https://apify.com/studio001/oliveyoung-global-kr-beauty-api) |
| **Coupang Search & Product Detail Pro API** | E-Commerce / Retail | Rocket Delivery search, pricing, ratings & seller detail extraction | [apify.com/studio001/coupang-search-detail-pro-api](https://apify.com/studio001/coupang-search-detail-pro-api) |
| **ATS Direct Multi-Board Jobs Feed** | Jobs / Leads / MCP | Direct Greenhouse, Lever & Ashby job-board JSON feeds | [apify.com/studio001/ats-jobs-direct-api](https://apify.com/studio001/ats-jobs-direct-api) |
| **YouTube Channel Search & Creator Discovery Pro API** | Videos / Creator / MCP | Channel search, subscriber/view filters & creator discovery feeds | [apify.com/studio001/youtube-channel-search-pro-api](https://apify.com/studio001/youtube-channel-search-pro-api) |
| **Similarweb Traffic & Channel Intel API** | Marketing / B2B / MCP | Monthly visits, bounce rate, channel split, geo & competitors (`UNBLOCKER`) | [apify.com/studio001/similarweb-traffic-channel-intel-api](https://apify.com/studio001/similarweb-traffic-channel-intel-api) |
| **AI Search & AEO Brand Monitor** | AI / SEO / MCP | Google AI Overviews, Perplexity, ChatGPT & Gemini brand citations & share of voice | [apify.com/studio001/ai-search-aeo-brand-monitor](https://apify.com/studio001/ai-search-aeo-brand-monitor) |

#### Suggested Pipeline Chains

1. **Automated Creator Discovery → Full Knowledge Graph**: Discover niche creators and recent uploads using [**YouTube Channel Search & Creator Discovery Pro API**](https://apify.com/studio001/youtube-channel-search-pro-api) → feed discovered `videoUrl` lists into **YouTube Transcript & Chapters Pro API** to ingest chapter-aligned RAG chunks into your vector database.
2. **Cross-Platform Short-Form Hook Intelligence**: Pair YouTube Shorts transcripts (`youtube.com/shorts/...`) with [**Instagram Reels AI Transcript & Hook Extractor**](https://apify.com/studio001/instagram-reels-ai-transcript-hook-extractor) to benchmark creator hooks and speaking rates across YouTube Shorts and Instagram Reels side by side.
3. **Sponsor & Brand Ad Creative Attribution**: Extract brand mentions from YouTube sponsorships via `chapterMarkdown` → look up those sponsor domains in [**Google Ads Transparency Direct-RPC**](https://apify.com/studio001/google-ads-transparency-direct-rpc) and find sponsor partnership contacts via [**B2B Domain Email Finder & SMTP/MX Verifier**](https://apify.com/studio001/b2b-email-finder-smtp-mx-verifier).

***

### Task Examples

Launch pre-configured zero-setup workflows directly from Apify Store:

- **[YouTube Transcript & Chapters to RAG Markdown Extractor](https://apify.com/studio001/youtube-transcript-chapters-pro-api/examples/youtube-transcript-to-rag-markdown)** — Extract timestamped YouTube transcripts and chapterMarkdown for LLM RAG pipelines at $1.20/1K Gold. Zero browser, $0 on missing captions.
- **[YouTube SRT & VTT Subtitles Bulk Downloader API](https://apify.com/studio001/youtube-transcript-chapters-pro-api/examples/youtube-subtitles-srt-vtt-downloader)** — Bulk download YouTube SRT and WebVTT subtitle tracks in EN, ES, KO, JA & more with human-caption priority via Innertube API.
- **[YouTube Video Chapters & Key Timestamps Scraper](https://apify.com/studio001/youtube-transcript-chapters-pro-api/examples/youtube-video-chapters-timestamps-scraper)** — Scrape structured YouTube video chapters, start/end timestamps, and chapter-aligned transcripts for podcasts, lectures, and tutorials.
- **[Multilingual YouTube Captions Extractor (EN / KO / JA)](https://apify.com/studio001/youtube-transcript-chapters-pro-api/examples/youtube-multilingual-captions-korean-japanese)** — Extract Korean, Japanese, and English YouTube transcripts with ordered language fallback via 4-tier Innertube API ($1.20/1K Gold).
- **[YouTube Shorts Transcript & Hook Text Extractor API](https://apify.com/studio001/youtube-transcript-chapters-pro-api/examples/youtube-shorts-transcript-extractor-api)** — Transcribe and extract captions from YouTube Shorts URLs cleanly via Innertube API at 256MB RAM ($1.20/1K Gold). Fast JSON & MCP ready.

***

### Custom Data Pipelines & Enterprise SLA

Need dedicated rate limits, custom dataset schemas, private webhook/S3/Snowflake delivery, high-volume volume discounts, or bespoke multi-Actor pipelines?

- **Direct Engineering Contact:** <studio001.kr@gmail.com>
- **Supported Delivery:** Managed Apify Standby MCP integrations, dedicated residential/unblocker routing, custom cron monitoring, and SLA-backed ETL connectors.

# Actor input Schema

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

List of YouTube watch URLs, youtu.be links, Shorts, Embed, Live URLs, or 11-character video IDs. Also accepts comma/newline strings and aliases (videoUrls, videoUrl, youtube_url, url).

## `videoUrl` (type: `string`):

Optional single YouTube video URL or 11-character ID for drop-in single-item compatibility when urls is omitted.

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

ISO 639-1 language codes in priority order (e.g., \["en", "ko", "ja"]). Falls back to any available caption track if none match.

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

When true, selects creator-uploaded manual subtitles over ASR auto-generated captions for the same language.

## `includeChapters` (type: `boolean`):

Extracts YouTube Studio chapters (youtubei/v1/next) and video description timestamps, aligning transcript text under each chapter.

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

When true, includes the granular \[{startSec, durationSec, endSec, text}] segments array in each dataset item.

## `outputFormats` (type: `array`):

Formats to generate in each item: plainText, chapterMarkdown, srt, vtt.

## `enableWhisperFallback` (type: `boolean`):

Opt-in transcription fallback using Groq Whisper Large-v3-Turbo (when groqApiKey is supplied) or local faster-whisper when a playable video has no captions.

## `groqApiKey` (type: `string`):

Optional Groq API key for fast Whisper Large-v3-Turbo fallback on captionless videos.

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

Optional Apify Proxy configuration. Leave empty for $0 direct Innertube first, with automatic 1-shot Datacenter -> Residential proxy fallback on Apify Cloud if YouTube triggers bot-checks.

## `maxTotalChargeUsd` (type: `number`):

Optional hard PPE spending cap for this run in USD. Stops charging and pushing further transcripts once reached.

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://youtu.be/dQw4w9WgXcQ",
    "J5-Nk4FvDw0"
  ],
  "videoUrl": "https://www.youtube.com/watch?v=aircAruvnKk",
  "languages": [
    "en",
    "ko",
    "ja",
    "es",
    "fr",
    "de"
  ],
  "preferManualCaptions": true,
  "includeChapters": true,
  "includeSegments": true,
  "outputFormats": [
    "plainText",
    "chapterMarkdown",
    "srt",
    "vtt"
  ],
  "enableWhisperFallback": false,
  "proxyConfiguration": {},
  "maxTotalChargeUsd": 1
}
```

# Actor output Schema

## `results` (type: `string`):

Extracted transcripts, timestamped segments, chapters, and LLM-ready Markdown.

## `metrics` (type: `string`):

Execution telemetry, wire bytes, proxy usage, and per-run unit economics JSON.

# 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=aircAruvnKk"
    ],
    "languages": [
        "en",
        "ko",
        "ja",
        "es",
        "fr",
        "de"
    ],
    "preferManualCaptions": true,
    "includeChapters": true,
    "includeSegments": true,
    "outputFormats": [
        "plainText",
        "chapterMarkdown"
    ],
    "enableWhisperFallback": false,
    "proxyConfiguration": {}
};

// Run the Actor and wait for it to finish
const run = await client.actor("studio001/youtube-transcript-chapters-pro-api").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=aircAruvnKk"],
    "languages": [
        "en",
        "ko",
        "ja",
        "es",
        "fr",
        "de",
    ],
    "preferManualCaptions": True,
    "includeChapters": True,
    "includeSegments": True,
    "outputFormats": [
        "plainText",
        "chapterMarkdown",
    ],
    "enableWhisperFallback": False,
    "proxyConfiguration": {},
}

# Run the Actor and wait for it to finish
run = client.actor("studio001/youtube-transcript-chapters-pro-api").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=aircAruvnKk"
  ],
  "languages": [
    "en",
    "ko",
    "ja",
    "es",
    "fr",
    "de"
  ],
  "preferManualCaptions": true,
  "includeChapters": true,
  "includeSegments": true,
  "outputFormats": [
    "plainText",
    "chapterMarkdown"
  ],
  "enableWhisperFallback": false,
  "proxyConfiguration": {}
}' |
apify call studio001/youtube-transcript-chapters-pro-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,studio001/youtube-transcript-chapters-pro-api"
        }
    }
}
```

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/XcK9Nu05wi17BFCQO/builds/n7MhQXhAGrgngencX/openapi.json
