# YouTube Transcript Scraper — Subtitles, Captions & Metadata (`logiover/youtube-transcript-scraper`) Actor

Extract full YouTube video transcripts, timestamped subtitles, auto-captions, and rich video metadata by URL, search query, or channel. Supports 100+ languages and RAG-ready segment chunking without a YouTube API key.

- **URL**: https://apify.com/logiover/youtube-transcript-scraper.md
- **Developed by:** [Logiover](https://apify.com/logiover) (community)
- **Categories:** AI, Social media, Developer tools
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.30 / 1,000 results

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/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 & Metadata

> **Disclaimer:** This Actor is an independent data extraction tool and is not affiliated with, endorsed by, or sponsored by YouTube or Google LLC. All trademarks belong to their respective owners.

Extract full YouTube video transcripts, timestamped subtitle segments, auto-generated captions, and complete video metadata at scale without needing a YouTube Data API v3 key or OAuth credentials. Built as a production-grade **YouTube transcript scraper** and **YouTube transcript API alternative**, this Actor lets you **scrape youtube.com without API key** quota bottlenecks by passing direct video URLs, YouTube search queries, or channel handles, and **export YouTube Transcript to CSV, Excel, JSON**, Parquet, or fine-grained timestamped chunks — 100% **AI agent & MCP ready**.

Whether you are indexing thousands of technical lectures into a Retrieval-Augmented Generation (RAG) vector database, training multimodal or conversational AI models, monitoring brand mentions across creator uploads, localizing educational libraries across 100+ languages, or conducting large-scale media research, this Actor delivers clean, deduplicated, UTF-8 decoded caption text paired with rich video context (`title`, `channelName`, `channelId`, `channelUrl`, `viewCount`, `publishDate`, `durationSecs`, `category`, `keywords`, `description`, `availableLanguages`, and `thumbnailUrl`). Switch effortlessly between `"videos"` mode (one complete transcript + segment array per video) and `"segments"` mode (one timestamped row per caption cue with direct `&t=` deep links).

***

### At a Glance

| Capability | Specification |
| :--- | :--- |
| **Target Platform** | `youtube.com` / `youtu.be` (Watch videos, Shorts, Live archives, Embeds, Search, Channels) |
| **Input Modes** | Direct `videoUrls` (or 11-char IDs) · `searchQueries` (InnerTube search pagination) · `channelUrls` (`@handle` / `/channel/UC...`) |
| **Output Modes** | `"videos"` (1 full transcript + metadata record per video) · `"segments"` (1 timestamped row per caption cue for RAG) |
| **Language Coverage** | 100+ ISO 639-1 / BCP-47 subtitle languages (manual creator tracks prioritized over auto-generated ASR, with automatic fallback) |
| **Measured Throughput** | **12,500 timestamped caption segments in 35.5 seconds** (2026-11-17 live Apify benchmark, 0 duplicates) |
| **Field Completeness** | **96.7%–100.0%** across all 24 fields (`"videos"` mode) · **95.8%–100.0%** across all 27 fields (`"segments"` mode) |
| **API Key Required** | None — zero Google Cloud Console quota limits or OAuth setup |
| **Pricing Model** | Pay Per Event (`apify-default-dataset-item`): **$2.00 / 1,000 results** (FREE) down to **$1.30 / 1,000 results** (GOLD–DIAMOND) |
| **Export Formats** | JSON, JSONL, CSV, Excel (`.xlsx`), XML, RSS, HTML Table via Apify Dataset API |
| **AI & Automation Ready** | Official Apify MCP Server (`logiover/youtube-transcript-scraper`), LangChain, LlamaIndex, n8n, Make, Zapier |

***

### Key Features & Extraction Modes

#### 1. Three Flexible Discovery Sources (Combine in One Run)

- **Direct Video URLs & IDs (`videoUrls`):** Pass standard watch links (`https://www.youtube.com/watch?v=dQw4w9WgXcQ`), YouTube Shorts (`https://www.youtube.com/shorts/...`), shortened `youtu.be/...` links, `/embed/...` URLs, `/live/...` stream archives, or bare 11-character video IDs (`arj7oStGLkU`).
- **Keyword Search Discovery (`searchQueries`):** Supply an array of search phrases (for example, `["stanford computer science lecture", "distributed systems conference talk"]`). The Actor queries YouTube's search index with subtitle filtering and multi-page continuation tokens, discovering matching captioned videos and extracting their transcripts in parallel.
- **Channel Upload Extraction (`channelUrls`):** Pass creator handles (`@TED`, `https://www.youtube.com/@SpanningTree`), `/channel/UC...` URLs, or `/videos` tab links to paginate through a channel's uploaded catalog and harvest transcripts across an entire creator library.

#### 2. Dual Output Architecture (`"videos"` vs `"segments"`)

- **`"videos"` Mode (Default — Document-Level Records):** Emits **1 rich record per video** containing the concatenated `transcriptText`, the structured `segments` array (`[{ startSec, durationSec, text }]`), `segmentCount`, `wordCount`, `charCount`, full `availableLanguages` inventory, and complete channel/video metadata. Ideal for summarization, content repurposing, newsletter generation, SEO research, and spreadsheet exports.
- **`"segments"` Mode (Chunk-Level Records for RAG & Search):** Emits **1 row per timestamped caption cue**, complete with unique `id` (`"<videoId>:<segmentIndex>"`), `segmentUrl` (`https://www.youtube.com/watch?v=<videoId>&t=<sec>s` so LLM citations jump to the exact second in the video!), `startSec`, `endSec`, `durationSec`, human-readable `timestamp` (`MM:SS` or `HH:MM:SS`), and parent video metadata. Ideal for Pinecone, Qdrant, Weaviate, pgvector, Milvus, and fine-grained semantic search.

#### 3. Intelligent Multi-Language & Track Selection

- **Manual-First Priority:** When a video offers both a human-authored subtitle track and an auto-generated speech recognition (`asr`) track in your requested `language` (e.g., `en`), the Actor automatically selects the higher-accuracy manual track first and flags `isAutoGenerated: false`.
- **Regional Dialect & Fallback Resolution:** Requesting `es` matches `es`, `es-419`, or `es-ES`; requesting `pt` matches `pt` or `pt-BR`. If the requested language is unavailable on a video, the Actor falls back cleanly to English or the primary available caption track rather than returning blank text, while listing every track in `availableLanguages`.
- **Multi-Format TimedText Decoding:** Parses YouTube `srv3` XML (`<p t="..." d="...">`), classic transcript XML (`<text start="..." dur="...">`), and `json3` caption streams with full HTML entity decoding (`&#39;`, `&quot;`, `&amp;`, Unicode code points) and whitespace normalization.

***

### 12 High-Impact B2B, AI & Analytics Use Cases

1. **Enterprise RAG & Citation-Backed AI Assistants:** Ingest thousands of product tutorials, webinars, conference talks, and technical lectures in `"segments"` mode so your AI copilot answers user questions with clickable `&t=` timestamp citations.
2. **LLM Pre-Training & Domain Fine-Tuning Corpora:** Build clean, spoken-language domain datasets across medicine, finance, software engineering, law, or e-commerce with word counts, language tags, and `isAutoGenerated` quality provenance.
3. **Competitor Product & Webinar Intelligence:** Track competitor YouTube channels (`channelUrls`) and extract every product launch keynote, demo walkthrough, and customer case study transcript automatically on a schedule.
4. **Podcast & Long-Form Show Notes Automation:** Turn 1–3 hour video podcasts into structured chapters, blog articles, LinkedIn carousels, and executive summaries using `"videos"` mode.
5. **Brand Mention, Sponsorship & Ad-Read Auditing:** Search niche keywords via `searchQueries` and scan `transcriptText` + unmasked `description` links/emails to verify influencer sponsorship reads and affiliate disclosures.
6. **Financial & Earnings Commentary Research:** Extract transcripts from market commentary, CEO interviews, macroeconomic briefings, and crypto/fintech analyst streams for quantitative sentiment pipelines.
7. **Academic & EdTech Course Indexing:** Index university lecture series (MIT, Stanford, Harvard, NPTEL) into searchable study portals where students jump straight to the exact second a formula or theorem is explained.
8. **Multilingual Content Localization & Translation QA:** Audit `availableLanguages` across a video catalog to identify missing localized subtitle tracks (`de`, `es`, `fr`, `ja`, `ko`, `pt-BR`) and export baseline transcripts for translation workflows.
9. **SEO Topic Clustering & Content Gap Analysis:** Scrape top-ranking YouTube videos for target commercial keywords to analyze spoken subtopics, terminology density, and audience questions that written SERP pages miss.
10. **Creator Lead Generation & Partnership Outreach:** Combine spoken topic verification (`transcriptText`) with unmasked creator contact details in `description` and `channelUrl` to build high-intent creator outreach lists.
11. **Voice & Conversational UX Benchmarking:** Study natural phrasing, transitions, and explanation patterns across high-retention creators (`viewCount`, `durationSecs`, `wordCount` per minute).
12. **Compliance, Fact-Checking & Media Archival:** Preserve immutable, timestamped text records of public broadcasts, policy speeches, and corporate announcements in JSONL or CSV.

***

### Copy-Paste JSON Input Recipes

#### Recipe 1: Extract Full Transcripts from Specific Video URLs & IDs (`"videos"` Mode)

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/watch?v=arj7oStGLkU",
    "https://youtu.be/aircAruvnKk"
  ],
  "language": "en",
  "outputMode": "videos",
  "includeTimestamps": true,
  "onlyWithTranscript": true,
  "maxResults": 10,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

#### Recipe 2: Keyword Search -> Bulk Video Transcripts (No Video URLs Needed)

```json
{
  "searchQueries": [
    "B2B SaaS pricing strategy",
    "enterprise sales discovery call",
    "product led growth keynote"
  ],
  "language": "en",
  "outputMode": "videos",
  "includeTimestamps": true,
  "onlyWithTranscript": true,
  "maxResults": 100,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

#### Recipe 3: High-Volume RAG Vector Chunking (`"segments"` Mode — 10,000+ Chunks)

```json
{
  "searchQueries": [
    "stanford computer science lecture",
    "mit artificial intelligence lecture",
    "distributed systems conference talk",
    "database internals lecture"
  ],
  "language": "en",
  "outputMode": "segments",
  "includeTimestamps": true,
  "onlyWithTranscript": true,
  "maxResults": 10000,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

#### Recipe 4: Scrape All Recent Uploads from Creator Channels (`channelUrls`)

```json
{
  "channelUrls": [
    "https://www.youtube.com/@TED",
    "https://www.youtube.com/@SpanningTree"
  ],
  "language": "en",
  "outputMode": "videos",
  "includeTimestamps": true,
  "onlyWithTranscript": true,
  "maxResults": 80,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

#### Recipe 5: Spanish / Multilingual Subtitle Extraction (`language: "es"`)

```json
{
  "searchQueries": [
    "inteligencia artificial conferencia",
    "arquitectura de software"
  ],
  "language": "es",
  "outputMode": "videos",
  "includeTimestamps": true,
  "onlyWithTranscript": true,
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

#### Recipe 6: Plain-Text Clean Transcripts Without Segment Timestamps (LLM Context Window)

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=K1a2Bk8NrYQ",
    "https://www.youtube.com/watch?v=arj7oStGLkU"
  ],
  "language": "en",
  "outputMode": "videos",
  "includeTimestamps": false,
  "onlyWithTranscript": true,
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

#### Recipe 7: Channel + Keyword Hybrid Competitive Monitoring

```json
{
  "channelUrls": [
    "@ycombinator"
  ],
  "searchQueries": [
    "Y Combinator AI startup school"
  ],
  "language": "en",
  "outputMode": "videos",
  "includeTimestamps": true,
  "onlyWithTranscript": true,
  "maxResults": 150,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

#### Recipe 8: Metadata + Optional Captions Audit (`onlyWithTranscript: false`)

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/watch?v=K1a2Bk8NrYQ"
  ],
  "language": "de",
  "outputMode": "videos",
  "includeTimestamps": true,
  "onlyWithTranscript": false,
  "maxResults": 25,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

***

### Full Input Reference

| Parameter | Type | Default | Prefill | Description |
| :--- | :--- | :--- | :--- | :--- |
| `videoUrls` | `array<string>` | `[]` | 3 sample URLs | Direct YouTube watch URLs, Shorts URLs, `youtu.be` links, `/embed/` links, `/live/` links, or raw 11-character video IDs. |
| `searchQueries` | `array<string>` | `[]` | 2 sample queries | Keywords searched on YouTube. Automatically paginates search continuations and extracts transcripts in parallel. |
| `channelUrls` | `array<string>` | `[]` | `[]` | YouTube channel URLs (`https://www.youtube.com/@TED`, `/channel/UC...`) or `@handles` to crawl uploaded videos. |
| `language` | `string` | `"en"` | `"en"` | Preferred ISO 639-1 / BCP-47 caption code (`en`, `es`, `de`, `fr`, `pt`, `ja`, `ko`, `tr`, `hi`, `zh-Hans`, etc.). Prefers manual captions over auto-generated ASR, then falls back cleanly if unavailable. |
| `outputMode` | `string` | `"videos"` | `"videos"` | `"videos"` outputs 1 complete transcript + metadata record per video; `"segments"` outputs 1 timestamped row per caption cue. |
| `includeTimestamps` | `boolean` | `true` | `true` | In `"videos"` mode, includes `startSec` and `durationSec` on every object inside `segments`. |
| `onlyWithTranscript` | `boolean` | `true` | `true` | Skips videos with zero caption tracks so every dataset item contains non-empty transcript text. |
| `maxResults` | `integer` (`1`–`100000`) | `200` | `30` | Maximum number of output rows (`videos` in `"videos"` mode, or caption `segments` in `"segments"` mode). |
| `proxyConfiguration` | `object` | `{ "useApifyProxy": true }` | `{ "useApifyProxy": true }` | Apify Proxy configuration for reliable YouTube InnerTube and timedtext requests. |

***

### Complete Data Dictionary & Measured Fill Rates

Fill rates below were measured directly on live Apify platform runs on **2026-11-17** (`EeMgc4efuRWJySCy3` in `"videos"` mode across 30 videos, and `5wBjCLfx4lWIQKcoU` in `"segments"` mode across **12,500** rows).

#### Mode A: `"videos"` Output Schema (24 Fields — 1 Row per Video)

| Field | Type | Measured Fill Rate | Description |
| :--- | :--- | :--- | :--- |
| `id` | `string` | **100.0%** | Unique record identifier (11-character YouTube `videoId`). |
| `videoId` | `string` | **100.0%** | Canonical 11-character YouTube video ID (e.g., `"dQw4w9WgXcQ"`). |
| `videoUrl` | `string` | **100.0%** | Canonical watch URL (`https://www.youtube.com/watch?v=<videoId>`). |
| `title` | `string` | **100.0%** | Full video title. |
| `channelName` | `string` | **100.0%** | Creator / channel display name. |
| `channelId` | `string` | **100.0%** | Canonical YouTube `UC...` channel identifier. |
| `channelUrl` | `string` | **100.0%** | Direct channel profile URL (`https://www.youtube.com/@...` or `/channel/UC...`). |
| `language` | `string` | **100.0%** | Selected caption track language code (e.g., `"en"`). |
| `languageName` | `string` | **100.0%** | Human-readable track name (e.g., `"English"`, `"English (auto-generated)"`). |
| `isAutoGenerated` | `boolean` | **100.0%** | `false` for creator-uploaded manual subtitles; `true` for YouTube ASR auto-captions. |
| `availableLanguages` | `array<object>` | **100.0%** | Full list of subtitle tracks available on the video (`[{ code, name, isAutoGenerated }]`). |
| `transcriptText` | `string` | **100.0%** | Complete, clean, space-joined transcript text across the entire video. |
| `segments` | `array<object>` | **100.0%** | Ordered array of caption cues (`[{ startSec, durationSec, text }]`). |
| `segmentCount` | `number` | **100.0%** | Total number of caption segments in `segments`. |
| `wordCount` | `number` | **100.0%** | Total word count of `transcriptText`. |
| `charCount` | `number` | **100.0%** | Total character length of `transcriptText`. |
| `viewCount` | `number` | **100.0%** | Total public video view count at extraction time. |
| `publishDate` | `string` | **100.0%** | Video publication timestamp (ISO-8601 with timezone offset or YouTube date string). |
| `durationSecs` | `number` | **100.0%** | Total video runtime in seconds. |
| `category` | `string` | **100.0%** | YouTube content category (e.g., `"Education"`, `"Science & Technology"`, `"Music"`). |
| `keywords` | `array<string> \| null` | **96.7%** | Creator-defined video tag keywords (`null` only when creator set zero tags). |
| `description` | `string \| null` | **100.0%** | Full unmasked video description (including public URLs, timestamps, and contact emails). |
| `thumbnailUrl` | `string` | **100.0%** | Highest-resolution video thumbnail URL. |
| `scrapedAt` | `string` | **100.0%** | ISO-8601 UTC timestamp when the record was extracted. |

#### Mode B: `"segments"` Output Schema (27 Fields — 1 Row per Caption Segment)

In `"segments"` mode (`12,500` rows tested on **2026-11-17**), `transcriptText`, `segments`, `segmentCount`, and `keywords` are replaced by per-chunk timing and citation fields:

| Field | Type | Measured Fill Rate | Description |
| :--- | :--- | :--- | :--- |
| `id` | `string` | **100.0%** | Deterministic unique chunk ID (`"<videoId>:<segmentIndex>"`, e.g., `"K1a2Bk8NrYQ:0"`). |
| `segmentUrl` | `string` | **100.0%** | Deep-linked URL jumping straight to the cue timestamp (`https://www.youtube.com/watch?v=K1a2Bk8NrYQ&t=0s`). |
| `segmentIndex` | `number` | **100.0%** | Zero-based sequential index of the cue within the video. |
| `startSec` | `number` | **100.0%** | Cue start offset in seconds (millisecond precision, e.g., `0.24`). |
| `endSec` | `number` | **100.0%** | Cue end offset in seconds (`startSec + durationSec`, e.g., `2.84`). |
| `durationSec` | `number` | **100.0%** | Cue duration in seconds (e.g., `2.6`). |
| `timestamp` | `string` | **100.0%** | Formatted playback clock (`"00:00"`, `"14:32"`, or `"01:05:19"`). |
| `text` | `string` | **100.0%** | Decoded spoken caption text for this timestamped segment. |
| *(+ 19 parent metadata fields)* | `mixed` | **95.8%–100.0%** | Includes `videoId`, `videoUrl`, `wordCount`, `charCount`, `language`, `languageName`, `isAutoGenerated`, `availableLanguages`, `title`, `channelName`, `channelId`, `channelUrl`, `viewCount`, `publishDate`, `durationSecs`, `category`, `description` (`95.8%`), `thumbnailUrl`, `scrapedAt`. |

***

### Real Live Output Samples (Unmasked)

#### Sample 1: `"videos"` Mode Record (Live Run `EeMgc4efuRWJySCy3`)

```json
{
  "id": "dQw4w9WgXcQ",
  "videoId": "dQw4w9WgXcQ",
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "channelName": "Rick Astley",
  "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
  "channelUrl": "https://www.youtube.com/@RickAstleyYT",
  "language": "en",
  "languageName": "English",
  "isAutoGenerated": false,
  "availableLanguages": [
    { "code": "en", "name": "English", "isAutoGenerated": false },
    { "code": "en", "name": "English (auto-generated)", "isAutoGenerated": true },
    { "code": "de-DE", "name": "German (Germany)", "isAutoGenerated": false },
    { "code": "ja", "name": "Japanese", "isAutoGenerated": false },
    { "code": "pt-BR", "name": "Portuguese (Brazil)", "isAutoGenerated": false },
    { "code": "es-419", "name": "Spanish (Latin America)", "isAutoGenerated": false }
  ],
  "transcriptText": "[♪♪♪] ♪ We're no strangers to love ♪ ♪ You know the rules and so do I ♪ ♪ A full commitment's what I'm thinking of ♪ ♪ You wouldn't get this from any other guy ♪ ...",
  "segments": [
    { "startSec": 1.36, "durationSec": 1.68, "text": "[♪♪♪]" },
    { "startSec": 18.64, "durationSec": 3.24, "text": "♪ We're no strangers to love ♪" },
    { "startSec": 22.64, "durationSec": 4.32, "text": "♪ You know the rules and so do I ♪" }
  ],
  "segmentCount": 61,
  "wordCount": 425,
  "charCount": 2184,
  "viewCount": 1641928410,
  "publishDate": "2009-10-24T23:57:33-07:00",
  "durationSecs": 213,
  "category": "Music",
  "keywords": ["rick astley", "Never Gonna Give You Up", "nggyu"],
  "description": "The official video for “Never Gonna Give You Up” by Rick Astley...",
  "thumbnailUrl": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
  "scrapedAt": "2026-11-17T10:59:08.112Z"
}
```

#### Sample 2: `"segments"` Mode Record for RAG Indexing (Live Run `5wBjCLfx4lWIQKcoU`)

```json
{
  "id": "K1a2Bk8NrYQ:0",
  "videoId": "K1a2Bk8NrYQ",
  "videoUrl": "https://www.youtube.com/watch?v=K1a2Bk8NrYQ",
  "segmentUrl": "https://www.youtube.com/watch?v=K1a2Bk8NrYQ&t=0s",
  "segmentIndex": 0,
  "startSec": 0.24,
  "endSec": 2.84,
  "durationSec": 2.6,
  "timestamp": "00:00",
  "text": "When deciding how to store large amounts of data,",
  "wordCount": 9,
  "charCount": 49,
  "language": "en",
  "languageName": "English",
  "isAutoGenerated": false,
  "availableLanguages": [
    { "code": "en", "name": "English", "isAutoGenerated": false },
    { "code": "en", "name": "English (auto-generated)", "isAutoGenerated": true }
  ],
  "title": "Understanding B-Trees: The Data Structure Behind Modern Databases",
  "channelName": "Spanning Tree",
  "channelId": "UCDzVUXiTr3hClI-zzCWbYzg",
  "channelUrl": "https://www.youtube.com/@SpanningTree",
  "viewCount": 1232960,
  "publishDate": "2024-04-29T05:29:13-07:00",
  "durationSecs": 759,
  "category": "Education",
  "description": "B-trees are a popular data structure for storing large amounts of data, frequently seen in databases and file systems... Email me at brian@spanningtree.me to suggest a future topic.",
  "thumbnailUrl": "https://i.ytimg.com/vi/K1a2Bk8NrYQ/sddefault.jpg",
  "scrapedAt": "2026-11-17T11:01:45.993Z"
}
```

***

### Measured Performance & Scale Proof (2026-11-17)

Every benchmark below was executed live on the Apify cloud infrastructure on **2026-11-17** using standard 1,024 MB Actor containers:

| Benchmark Profile | Apify Run ID | Output Mode | Deduplicated Rows | Duration | Peak RAM | Empty Columns | Status |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| **Default Prefill QC Run** | `EeMgc4efuRWJySCy3` | `"videos"` | **30 videos** | **48.0s** *(tuned `<25s` in v1.0.2)* | 111 MB | `0` (`96.7–100%` fill) | `SUCCEEDED` |
| **High-Volume Scale Benchmark** | `5wBjCLfx4lWIQKcoU` | `"segments"` | **12,500 segments** | **35.5s** (~352 rows/sec) | 129 MB | `0` (`95.8–100%` fill) | `SUCCEEDED` |
| **Max-Cost Budget Guard Proof** | `HIJ5QxlAog35B2GhL` | `"videos"` | **28 videos** | Graceful budget stop | 84 MB | `0` | `SUCCEEDED` |

***

### Pricing — What You Pay (Pay Per Event)

This Actor uses transparent **Pay Per Event (`PAY_PER_EVENT`)** pricing on `apify-default-dataset-item`. You pay strictly per dataset item delivered — **zero monthly rental subscription** and automatic volume discounts tied to your Apify Store plan tier:

| Apify Store Plan Tier | Price per 1,000 Results | Price per Single Result | 10,000 Results Total |
| :--- | :--- | :--- | :--- |
| **FREE** | **$2.00 / 1k** | `$0.002000` | `$20.00` |
| **BRONZE** | **$1.77 / 1k** | `$0.001767` | `$17.67` |
| **SILVER** | **$1.53 / 1k** | `$0.001533` | `$15.33` |
| **GOLD** | **$1.30 / 1k** | `$0.001300` | `$13.00` |
| **PLATINUM** | **$1.30 / 1k** | `$0.001300` | `$13.00` |
| **DIAMOND** | **$1.30 / 1k** | `$0.001300` | `$13.00` |

#### Setting a Hard "Maximum Cost per Run" Budget Cap

You have 100% deterministic spend control on every run:

1. In Apify Console, expand **Run options -> Maximum cost per run** and enter any USD ceiling (for example, `$0.50` or `$5.00`), or pass `?maxTotalChargeUsd=0.50` via the Apify REST API.
2. Our built-in runtime budget guard monitors your remaining event allowance in real time, slices the final batch to fit cleanly inside your cap, writes `SUMMARY` to the Key-Value Store, and exits `SUCCEEDED` (never `ABORTED`!) with every paid item preserved in your dataset.
3. Note on `outputMode`: each dataset row counts as 1 `result` event — use `"videos"` mode when you want 1 event per full video transcript (including the nested `segments` array!), or `"segments"` mode when you want pre-flattened individual vector-ready rows.

***

### AI Agent & Official Apify MCP Server Integration

Connect this Actor directly to **Claude Desktop**, **Cursor**, **Windsurf**, **VS Code Copilot**, or custom MCP clients via the official Apify MCP Server endpoint:

```text
https://mcp.apify.com?tools=logiover/youtube-transcript-scraper
```

#### `claude_desktop_config.json` / `.cursor/mcp.json`

```json
{
  "mcpServers": {
    "youtube-transcript-scraper": {
      "url": "https://mcp.apify.com?tools=logiover/youtube-transcript-scraper",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_API_TOKEN"
      }
    }
  }
}
```

Once connected, your AI agent can autonomously call `logiover/youtube-transcript-scraper` whenever you prompt: *"Pull the full English transcripts of the top 15 distributed systems talks on YouTube and summarize the consensus trade-offs."*

***

### API & Workflow Integration Examples

#### Node.js (`apify-client`)

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });

const run = await client.actor('logiover/youtube-transcript-scraper').call({
    videoUrls: ['https://www.youtube.com/watch?v=K1a2Bk8NrYQ'],
    searchQueries: ['database internals lecture'],
    language: 'en',
    outputMode: 'videos',
    maxResults: 25,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Extracted ${items.length} transcripts. First video:`, items[0]?.title, items[0]?.wordCount);
```

#### Python (`apify-client` + LangChain / RAG Ready)

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])

run = client.actor("logiover/youtube-transcript-scraper").call(
    run_input={
        "searchQueries": ["stanford computer science lecture"],
        "language": "en",
        "outputMode": "segments",
        "maxResults": 1000,
    }
)

items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
print(f"Loaded {len(items)} timestamped chunks. Sample link: {items[0]['segmentUrl']}")
```

#### cURL (Synchronous JSON Export + Max Budget Cap)

```bash
curl -X POST "https://api.apify.com/v2/acts/logiover~youtube-transcript-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_API_TOKEN&maxTotalChargeUsd=0.20" \
  -H "Content-Type: application/json" \
  -d '{
    "videoUrls": ["https://www.youtube.com/watch?v=arj7oStGLkU"],
    "language": "en",
    "outputMode": "videos",
    "maxResults": 5
  }'
```

#### n8n / Make / Zapier No-Code Workflows

- **n8n:** Add the official **Apify** node -> **Run an Actor** -> select `logiover/youtube-transcript-scraper`, map `videoUrls` from a YouTube RSS Trigger or Slack webhook, then pass `transcriptText` directly to an **OpenAI / Anthropic** node or **Pinecone Vector Store** node.
- **Make (Integromat):** Use **Apify -> Run an Actor** (`Run synchronously = Yes`) followed by **Apify -> Get Dataset Items** to write transcripts straight into Google Sheets, Notion, Airtable, or HubSpot.
- **Zapier:** Trigger **New Video in Channel (YouTube)** -> Action **Apify: Run Actor (`logiover/youtube-transcript-scraper`)** -> Action **Send Summary to Slack / Notion**.

***

### Troubleshooting & Support

- **0 results returned for a single `videoUrls` entry:** Some music videos, silent clips, or freshly uploaded livestreams have subtitles disabled by the creator. Set `"onlyWithTranscript": false` if you still want video metadata emitted when captions do not exist, or verify that the video has a `CC` button on YouTube.
- **Choosing `"videos"` vs `"segments"` for cost efficiency:** Remember that `"videos"` mode STILL includes the full timestamped `segments` array inside every video record! If you want 500 full videos for `$1.00` (FREE tier) or `$0.65` (GOLD–DIAMOND tier), run `"outputMode": "videos"` and unpack `item.segments` in your own script at zero extra event cost. Use `"outputMode": "segments"` when your downstream no-code tool or vector loader expects pre-flattened rows directly from the Apify dataset URL.
- **Private, members-only, or age-gated videos:** This Actor extracts publicly accessible YouTube videos without user login cookies. Private, deleted, or members-only videos cannot be accessed publicly and are safely skipped.
- **Issues & Feature Requests:** Found an edge case or want an additional output field? Open a ticket on the [Actor Issues tab](https://apify.com/logiover/youtube-transcript-scraper/issues) for fast engineering turnaround. If this Actor saves you engineering hours, leaving a quick rating on the [Actor Reviews tab](https://apify.com/logiover/youtube-transcript-scraper/reviews) helps keep it actively maintained!

***

### Frequently Asked Questions (FAQ)

#### Do I need a YouTube Data API v3 key or Google OAuth credentials to use this Actor?

No. You do not need a Google Cloud project, API key, OAuth consent screen, or quota approval. Notice also that the official YouTube Data API `captions.download` endpoint blocks downloading transcripts for third-party videos you do not own — whereas this Actor extracts public subtitle tracks from any public captioned video on YouTube.

#### What is the difference between `"videos"` mode and `"segments"` mode?

In `"videos"` mode (the default), each dataset row represents **one complete YouTube video**, containing both the full space-joined `transcriptText` and the nested `segments` array (`[{ startSec, durationSec, text }]`). In `"segments"` mode, each dataset row represents **one individual timestamped caption cue** with its own `id` (`<videoId>:<index>`), `segmentUrl` (`&t=<sec>s`), `startSec`, `endSec`, and parent metadata — ready for zero-code RAG ingestion.

#### Which mode is more cost-effective for bulk scraping?

Because Pay-Per-Event charges per dataset row, `"videos"` mode is dramatically cheaper when scraping full videos at bulk scale: 1,000 full-length videos in `"videos"` mode equals 1,000 events (`$1.30–$2.00`), and every single video record STILL contains the complete `segments` timestamp array inside it! Choose `"segments"` mode when you want Apify to flatten cues into individual rows for direct no-code or vector database imports.

#### Can this YouTube transcript scraper extract auto-generated captions as well as manual subtitles?

Yes. For every video, the Actor inspects all caption tracks, prioritizes human-authored manual subtitles in your target `language` (`isAutoGenerated: false`), and seamlessly falls back to YouTube's automatic speech recognition (`asr`) captions (`isAutoGenerated: true`) when manual captions aren't present.

#### What happens if my requested `language` is not available on a video?

The Actor resolves exact language matches first (e.g., `es`), then regional variants (`es-419`, `es-ES`), then English (`en`), and finally the first available track on the video so `transcriptText` is populated whenever any captions exist. You can always check the `language` field on each output record to see which track was used, and inspect `availableLanguages` to see every subtitle track offered on the video.

#### Does it support YouTube Shorts, `youtu.be` links, embed links, and livestream replays?

Yes. `videoUrls` automatically parses standard `youtube.com/watch?v=...` URLs, `youtube.com/shorts/...` links, `youtu.be/...` share links, `youtube.com/embed/...` iframe URLs, `youtube.com/live/...` replays, and bare 11-character video IDs.

#### How can I scrape transcripts by topic without collecting video URLs first?

Pass one or more search strings in `searchQueries` (for example, `["enterprise AI agents", "Postgres performance tuning"]`). When `onlyWithTranscript` is `true` (default), search discovery automatically applies YouTube's closed-caption filter (`CC`) and paginates continuation tokens until `maxResults` is satisfied.

#### How can I extract every video transcript from a specific YouTube channel?

Pass `@handles` (e.g., `"@TED"` or `"https://www.youtube.com/@SpanningTree"`) or `/channel/UC...` URLs in `channelUrls`. The Actor crawls the channel's `/videos` tab across continuation pages and extracts transcripts and metadata for each uploaded video in parallel.

#### Are timestamps accurate to fractions of a second?

Yes. Timestamps are parsed directly from YouTube's underlying millisecond timedtext cues (`startSec` and `durationSec` rounded to millisecond precision, e.g., `18.64` seconds), and `"segments"` mode also generates a formatted `timestamp` (`"00:18"`) plus a clickable `segmentUrl` (`&t=18s`).

#### Can I export YouTube transcripts to CSV, Excel, JSON, or JSONL?

Yes. Every run stores results in an Apify Dataset that can be downloaded in one click or fetched via REST API in JSON, JSONL, CSV, Excel (`.xlsx`), HTML, XML, or RSS. For CSV/Excel spreadsheet users, `"videos"` mode provides clean columns (`title`, `channelName`, `viewCount`, `publishDate`, `wordCount`, `transcriptText`, `videoUrl`).

#### Are creator emails and external URLs in video descriptions masked or redacted?

Never. Every public URL, sponsor link, chapter list, social handle, and business contact email published in the video's `description` is returned completely unmasked.

#### How fast does the Actor run on large workloads?

In our verified **2026-11-17** Apify cloud benchmark (`5wBjCLfx4lWIQKcoU`), the Actor extracted **12,500 deduplicated caption segment rows in 35.5 seconds** using only 129 MB of RAM. Typical 30-video runs complete in roughly 15–30 seconds.

#### How does the "Maximum cost per run" cap work?

If you set a dollar limit (such as `$0.05` or `$1.00`) in **Maximum cost per run**, the Actor's built-in charging guard tracks remaining budget before every dataset push, trims the final batch to stay strictly within your limit, writes a `SUMMARY` record to the Key-Value Store, and exits with `SUCCEEDED` status so your downstream automation still receives every collected item.

#### Does the Actor deduplicate videos when search queries and channel URLs overlap?

Yes. Both candidate video discovery (`videoId`) and dataset emission (`id`) maintain strict in-memory deduplication sets, guaranteeing **zero duplicate rows** even when multiple `searchQueries`, `channelUrls`, and `videoUrls` return overlapping videos.

#### Can I call this Actor from an AI agent using the Model Context Protocol (MCP)?

Yes. Point any MCP-compatible client (Claude Desktop, Cursor, Windsurf, OpenAI Agents SDK, custom MCP hosts) to `https://mcp.apify.com?tools=logiover/youtube-transcript-scraper` with your Apify API token to give your agent on-demand YouTube transcript search and extraction.

#### What does the Key-Value Store `SUMMARY` record contain?

At the end of every run (including max-cost stops and zero-match searches), the Actor saves a structured JSON `SUMMARY` object to the run's default Key-Value Store containing `outcome`, `outputMode`, `language`, `rowsPushed`, `discoveredVideos`, `processedVideos`, `videosWithTranscripts`, `pagesFetched`, `durationMs`, and `completedAt`.

# Changelog

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

# Actor input Schema

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

YouTube video URLs (watch, Shorts, youtu.be, embed, live) or 11-character video IDs to extract transcripts and metadata from.

## `searchQueries` (type: `array`):

YouTube search keywords. Discovers matching captioned videos via YouTube search and extracts transcripts and metadata in parallel.

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

YouTube channel URLs (e.g. https://www.youtube.com/@TED or https://www.youtube.com/channel/UCAuUUnT6oDeKwE6v1NGQxug) or @handles to extract uploaded video transcripts from.

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

Preferred ISO 639-1 subtitle language code (e.g. 'en', 'es', 'de', 'fr', 'pt', 'ja', 'ko', 'tr'). Automatically falls back to auto-generated captions or the first available track if the exact language is unavailable.

## `outputMode` (type: `string`):

Choose 'videos' for 1 complete transcript + metadata record per video, or 'segments' for 1 timestamped row per caption chunk (ideal for LLM/RAG vector indexing).

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

Include startSec and durationSec timing fields on transcript segments and timestamped text formatting.

## `onlyWithTranscript` (type: `boolean`):

When enabled, skips videos that have no caption tracks available so every output item contains non-empty transcript text.

## `maxResults` (type: `integer`):

Maximum number of dataset items to output (videos in 'videos' mode, or caption segments in 'segments' mode).

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

Proxy settings for YouTube requests.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/watch?v=arj7oStGLkU",
    "https://www.youtube.com/watch?v=aircAruvnKk"
  ],
  "searchQueries": [
    "TED talk artificial intelligence",
    "software engineering conference talk"
  ],
  "language": "en",
  "outputMode": "videos",
  "includeTimestamps": true,
  "onlyWithTranscript": true,
  "maxResults": 30,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `dataset` (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",
        "https://www.youtube.com/watch?v=arj7oStGLkU",
        "https://www.youtube.com/watch?v=aircAruvnKk"
    ],
    "searchQueries": [
        "TED talk artificial intelligence",
        "software engineering conference talk"
    ],
    "language": "en",
    "outputMode": "videos",
    "maxResults": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("logiover/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",
        "https://www.youtube.com/watch?v=arj7oStGLkU",
        "https://www.youtube.com/watch?v=aircAruvnKk",
    ],
    "searchQueries": [
        "TED talk artificial intelligence",
        "software engineering conference talk",
    ],
    "language": "en",
    "outputMode": "videos",
    "maxResults": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("logiover/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",
    "https://www.youtube.com/watch?v=arj7oStGLkU",
    "https://www.youtube.com/watch?v=aircAruvnKk"
  ],
  "searchQueries": [
    "TED talk artificial intelligence",
    "software engineering conference talk"
  ],
  "language": "en",
  "outputMode": "videos",
  "maxResults": 30
}' |
apify call logiover/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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