# YouTube Transcript Scraper — Text, Metadata & Chapters (`t2solutions/youtube-transcript-scraper`) Actor

Fetch YouTube transcripts, timestamped segments, video metadata and chapters as clean JSON for RAG, LLMs, spreadsheets and AI agents. Built for fast, reliable bulk runs at scale.

- **URL**: https://apify.com/t2solutions/youtube-transcript-scraper.md
- **Developed by:** [T2 Solutions](https://apify.com/t2solutions) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 96.8% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$5.00 / 1,000 video transcript results

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 — Text, Metadata & Chapters

Fetch **YouTube transcripts** (plain text plus timestamped segments), rich video metadata, and
optional chapter markers as clean JSON — one row per video, ready for RAG pipelines, LLM
prompts, spreadsheets, databases, or AI agents.

Get YouTube transcripts and subtitles without the official YouTube API: this YouTube transcript
scraper extracts captions, closed captions and auto-generated subtitles as plain text, plus
timestamped cues, chapters and video metadata (title, author, channel, views, thumbnail and
description). Just pass a watch URL, a `youtu.be` link, a `/shorts/`, `/embed/` or `/live/`
link, or a bare video ID — no proxy setup and no YouTube account required. Results come back in
seconds.

### Why use this actor

A no-code YouTube transcript scraper and API: turn any video URL or ID into structured JSON in
one run. Here's what sets it apart:

- 🎯 **The transcript YouTube actually serves** — reads the creator's manual captions when
  available and falls back to auto-generated captions otherwise.
- 🧩 **Rich metadata in the same row** — title, author, channel ID, duration, view count,
  keywords, description, and thumbnail URL alongside the transcript, timestamped segments, and
  chapters. The Console **Overview** tab highlights the key columns; switch to the
  built-in **All fields** tab for full metadata.
- 🧾 **Transparent run summary** — every run writes a `RUN_SUMMARY` record (`complete`,
  `partial`, `timed_out`, or `zero_match`) so you always know which videos succeeded and why any
  video was skipped or had no captions.
- 🗂️ **Optional chapters** — enable `includeChapters` to extract creator-defined chapter titles
  and timestamps.
- 🧮 **Batch input** — process up to 1,000 videos in a single run with shared language, pacing,
  concurrency and deadline settings.
- ⚡ **Parallel workers** — `concurrency` (1–8, default 4) processes independent videos at the
  same time. Each worker keeps its own pacing gap, so the batch finishes about 4x faster while
  the aggregate request rate stays capped and each connection keeps a safe per-IP rate.
- 🛡️ **Fail-safe deadline** - stops cleanly before the platform timeout, keeping every
  transcript already delivered. A single stalled video is capped at 20 seconds and reported
  as `video_timeout`, so it cannot consume the rest of the run.
- 🤖 **Agent-ready** — deterministic JSON output, `LIMITED_PERMISSIONS` security posture, and
  ready-to-use MCP / REST examples below.

### Input

To get a YouTube transcript, pass one or more video URLs or IDs. Everything else has sensible
defaults:

| Field | Type | Default | Description |
|---|---|---|---|
| `videos` | array of strings (required) | — | Watch URLs, `youtu.be` links, `/shorts/`, `/embed/`, `/live/` links, or bare 11-character video IDs (1–1,000 unique videos). Duplicates are collapsed in input order; an entry that is not a YouTube link is skipped without a network call and returned as its own free `invalid_input` row in the output, and the run still succeeds. |
| `preferredLanguage` | string (dropdown) | `"en"` | Choose from 125 common YouTube/ISO languages and regional variants (each option shows its code, e.g. **English (en)**, **Vietnamese (vi)**), or pick **Other** to enter a custom code below. Manual captions are preferred over auto-generated (`asr`) captions for the same language; regional (`en-US`) and base-language (`en`) matches are tried before falling back. |
| `preferredLanguageCustom` | string | unset | Used only when `preferredLanguage` is `other` (e.g. `en-US`, `zh-Hans`, `pt-PT`). |
| `fallbackToAnyLanguage` | boolean | `true` | If the preferred language is unavailable on a video, return the first available manual track (or first available track) instead of skipping the video as `no_requested_language`. |
| `includeTimestamps` | boolean | `true` | Include the timestamped `segments` array (`[{start, duration, end, text}]`) alongside `transcriptText`. |
| `includeChapters` | boolean | `false` | Also fetch creator-defined video chapters (`[{title, startSeconds, timeText}]`). Off by default. |
| `maxVideos` | integer | `100` | Maximum unique videos processed in one run (1–1,000). Extra videos beyond this cap are counted in `videosSkippedOverCap`. |
| `concurrency` | integer | `4` | Videos processed in parallel (1-8, clamped at run time). The effective value is capped by the available network capacity so the per-IP request rate never rises. An out-of-range or invalid value is clamped/defaulted and recorded in the run notes. `1` reproduces the sequential behavior. |
| `pacingSeconds` | number | `1.5` | Delay between videos **for each worker** in seconds (0.5–30). Aggregate launch rate is `concurrency / pacingSeconds`; each connection keeps the same per-IP rate. |
| `maxDurationMinutes` | number | `25` | Fail-safe wall-clock limit for the whole run (1–59 minutes). When reached, delivered rows are kept and remaining videos are marked `not_run`. |

**Batch sizing tip:** budget roughly `maxVideos × (1.6 + pacingSeconds) / concurrency` seconds,
plus headroom for a few slow videos (each one is capped at 20 seconds). At the defaults
(25 minutes, 1.5 s pacing, 4 workers), 1,000 videos fit comfortably; a single stalled video
occupies one worker, not the batch.

**Example input:**

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://www.youtube.com/watch?v=dtp6b76pMak"
  ],
  "preferredLanguage": "en",
  "fallbackToAnyLanguage": true,
  "includeTimestamps": true,
  "includeChapters": false,
  "maxVideos": 100,
  "concurrency": 4,
  "pacingSeconds": 1.5,
  "maxDurationMinutes": 25
}
```

#### Supported video URL formats

All of these resolve to `aircAruvnKk`:

- `aircAruvnKk`
- `https://www.youtube.com/watch?v=aircAruvnKk` (extra query parameters are ignored)
- `https://youtu.be/aircAruvnKk`
- `https://www.youtube.com/shorts/aircAruvnKk`
- `https://www.youtube.com/embed/aircAruvnKk`
- `https://www.youtube.com/live/aircAruvnKk`

Playlist URLs, channel URLs, and non-YouTube links are rejected before any request is made, but
they do not fail the run: each one comes back as an `invalid_input` status row.

### Output

The dataset contains **one row per submitted entry**: a delivered transcript row, or a status row
for a video that could not be delivered, or an `invalid_input` row for an entry that is not a
YouTube link. Run status and per-video counters are stored
in separate key-value records so summary data never pollutes your dataset items:

- **`OUTPUT`** — `{"rows": N, "chargedRows": C, "noTranscriptRows": M, "state": "…", "partialReason": …}`:
  quick run status handle.
- **`RUN_SUMMARY`** — full run report (counts, skip reasons, `chaptersUnavailable`, and per-video
  `jobResults`).

#### Transcript row (Dataset)

Each delivered dataset item carries the full 20-field video and transcript payload plus
`status: "ok"`. In the Apify Console, the **Overview** view displays the 9 primary columns
(`status`, `url`, `title`, `author`, `language`, `isAutoGenerated`, `transcriptText`, `segments`,
`chapters`); switch to the built-in **All fields** view to inspect every column.

| Column | Nullable | Description |
|---|---|---|
| `videoId` | no | Canonical 11-character YouTube video ID. |
| `url` | no | Canonical `https://www.youtube.com/watch?v=…` URL. |
| `title` | yes | Video title. |
| `author` | yes | Channel display name. |
| `channelId` | yes | YouTube channel ID (`UC…`). |
| `lengthSeconds` | yes | Video duration in seconds. |
| `viewCount` | yes | View count at fetch time. |
| `isLiveContent` | no | Whether YouTube marks the video as live content. |
| `keywords` | no | Array of video keywords (`[]` when none). |
| `shortDescription` | no | Video description text (`""` when empty). |
| `thumbnailUrl` | no | Highest-resolution thumbnail URL available. |
| `language` | no | Language code of the returned caption track (e.g. `en`, `vi`). |
| `languageName` | no | Display name of the caption track, e.g. `English`, `English (auto-generated)`. |
| `isAutoGenerated` | no | `true` when the track is auto-generated (`asr`), `false` for manual captions. |
| `availableLanguages` | no | All caption language codes available on the video. |
| `segmentCount` | no | Number of caption segments parsed. |
| `transcriptText` | no | Full plain-text transcript (all segment texts joined with single spaces). |
| `segments` | no | Timestamped cues `[{start, duration, end, text}]` in seconds (`[]` when `includeTimestamps: false`). |
| `chapters` | no | Creator chapters `[{title, startSeconds, timeText}]` (`[]` unless `includeChapters: true` and chapters exist on the video). |
| `fetchedAt` | no | ISO-8601 UTC timestamp when the transcript was fetched. |
| `status` | no | `ok` for a delivered transcript. |

#### Status row (Dataset)

A video that could not be delivered still gets a row, so no requested video is a silent hole.
The row always carries `videoId`, `url` and `status`. When the player response proved the video
playable (`no_captions`, `no_requested_language`), the public video metadata is kept too —
`title`, `author`, `channelId`, `lengthSeconds`, `viewCount`, `isLiveContent`, `keywords`,
`shortDescription`, `thumbnailUrl`, `availableLanguages`, `fetchedAt`. Transport and gate
failures may only have the three base fields. Join on `videoId` with `RUN_SUMMARY.jobResults`:

```json
{
  "videoId": "dtp6b76pMak", "url": "https://www.youtube.com/watch?v=dtp6b76pMak",
  "status": "no_captions", "title": "Example video", "author": "Example channel",
  "channelId": "UC0000000000000000000000", "lengthSeconds": 612,
  "viewCount": 123456, "isLiveContent": false, "keywords": ["example"],
  "shortDescription": "…", "thumbnailUrl": "https://i.ytimg.com/vi/…/maxresdefault.jpg",
  "availableLanguages": [], "fetchedAt": "2026-11-21T00:00:00Z"
}
```

| `status` | Meaning | Charged |
|---|---|---|
| `no_captions` | The video has no caption tracks. | **yes** |
| `unavailable` | Private, deleted, or unplayable. | **yes** |
| `no_requested_language` | No requested language and `fallbackToAnyLanguage` is `false`. | **yes** |
| `age_restricted` | Age-gated and no signed-in, age-confirmed session was available. | **yes** |
| `login_required` | YouTube sign-in/bot gate that the configured session could not unlock. | no |
| `egress_unavailable` | Temporary network/route exhaustion. | no |
| `rate_limited` / `network_error` | YouTube throttling or a transport failure. | no |
| `deadline` / `video_timeout` | The run or the per-video window ran out. | no |
| `not_run` | Never started because the run stopped (deadline, a sign-in/bot gate, or a spend cap). | no |
| `invalid_input` | The submitted entry was not a YouTube link (the rejected value is echoed in `url`). | no |
| `unknown` | An unexpected per-video failure; the reason is in the run log. | no |

Only the four **content outcomes** are charged: the video itself (or the requested language)
produced no transcript, so the row is a result. Infrastructure outcomes stay free. `push_failed`
is the one failure with no status row: the dataset write itself failed, so no second write is
attempted. A status-row write that fails is counted in `RUN_SUMMARY.noTranscriptRowsPushFailed`
and is never charged.

#### `RUN_SUMMARY` record (Key-Value Store)

| Field | Meaning |
|---|---|
| `state` | `complete` (all requested videos delivered) · `partial` (some videos failed/skipped or chapter fetch had an error) · `timed_out` (hit `maxDurationMinutes`) · `zero_match` (videos were valid but none had captions) |
| `partialReason` | `null` when complete/zero_match, or the primary reason for a partial/timed-out run (`videos_missing`, `input_invalid`, `video_cap`, `deadline`, `video_timeout`, `rate_limited`, `network_error`, `login_required`, `age_restricted`, `unavailable`, `no_requested_language`, `no_captions`, `chapters_unavailable`, `push_failed`), or a route/session-availability reason when the run could not open a network route. |
| `rowsRequested` | Unique valid videos selected (up to `maxVideos`). |
| `rowsFetched` | Transcript rows delivered to the dataset. |
| `rowsPushFailed` | Fetched rows that failed to write to the dataset (never billed). |
| `chargedRows` | Rows charged: transcript rows plus billable content-outcome status rows. |
| `noTranscriptRows` | Status rows written for videos without a transcript, including rejected `invalid_input` entries. |
| `noTranscriptRowsPushFailed` | Status rows that could not be written (never billed). |
| `jobsTotal` / `jobsOk` / `jobsFailed` | Total processed videos vs delivered (`jobsOk`) vs non-delivered (`jobsFailed`). |
| `videosNoCaptions` | Videos that have no caption tracks on YouTube. |
| `videosUnavailable` | Private, deleted, or unplayable videos. |
| `videosNoRequestedLanguage` | Videos without the requested language when `fallbackToAnyLanguage` is `false`. |
| `videosLoginRequired` | Videos gated by a YouTube sign-in/bot check that could not be unlocked with the configured session. |
| `videosAgeRestricted` | Age-restricted videos that no configured signed-in session could unlock. YouTube serves them only to a signed-in viewer whose account has confirmed its age; without such a session they are written as an `age_restricted` status row (no transcript row) and billed as a content outcome, instead of being reported as a generic failure. With a session, the actor reads them through the signed-in client — a delivered row if the video has captions, `no_captions` if it has none. |
| `videosEgressUnavailable` | Videos that could not be fetched due to temporary network/route exhaustion. |
| `videosNotRun` | Videos not started because `maxDurationMinutes` was reached or the run's spend cap stopped launches. |
| `videosSkippedDuplicate` | Duplicate video IDs collapsed from the input. |
| `videosSkippedInvalid` | Invalid URLs or malformed IDs rejected before any network request and returned as `invalid_input` status rows. |
| `videosSkippedOverCap` | Unique videos beyond `maxVideos`. |
| `chaptersUnavailable` | `[{videoId, reason}]` when `includeChapters: true` but chapter markers could not be retrieved; `null` otherwise. |
| `jobResults` | Per-video outcome list: `[{videoId, status, rows}]`, where `rows` is the number of transcript rows delivered for that video (`1` for a delivered transcript, `0` otherwise). |
| `runStartedAt` / `runFinishedAt` | ISO-8601 UTC timestamps for the run. |

**Example `RUN_SUMMARY`** (when requested videos have no captions):

```json
{
  "recordType": "RUN_SUMMARY",
  "state": "zero_match",
  "partialReason": null,
  "rowsRequested": 2,
  "rowsFetched": 0,
  "rowsPushFailed": 0,
  "chargedRows": 2,
  "noTranscriptRows": 2,
  "noTranscriptRowsPushFailed": 0,
  "jobsTotal": 2,
  "jobsOk": 0,
  "jobsFailed": 2,
  "videosNoCaptions": 2,
  "videosUnavailable": 0,
  "videosNoRequestedLanguage": 0,
  "videosNotRun": 0,
  "chaptersUnavailable": null,
  "jobResults": [
    {"videoId": "aircAruvnKk", "status": "no_captions", "rows": 0},
    {"videoId": "dtp6b76pMak", "status": "no_captions", "rows": 0}
  ]
}
```

### Use with AI agents (MCP)

- **Apify MCP server** — add `https://mcp.apify.com` to your MCP client (Claude Desktop, Cursor,
  custom agents) with your Apify API token to call this actor as a native tool.

- **REST API** — start a run and read the clean dataset items or summary records directly:

  ```bash
  curl -X POST "https://api.apify.com/v2/acts/t2solutions~youtube-transcript-fetch/runs?token=YOUR_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{"videos":["https://www.youtube.com/watch?v=aircAruvnKk"],"includeChapters":true}'

  # Transcript rows (dataset):
  # GET /v2/acts/t2solutions~youtube-transcript-fetch/runs/{runId}/dataset/items?token=YOUR_TOKEN

  # Quick status {"rows": N, "chargedRows": C, "noTranscriptRows": M, "state": "...", "partialReason": ...}:
  # GET /v2/acts/t2solutions~youtube-transcript-fetch/runs/{runId}/key-value-store/records/OUTPUT

  # Full per-video breakdown:
  # GET /v2/acts/t2solutions~youtube-transcript-fetch/runs/{runId}/key-value-store/records/RUN_SUMMARY
  ```

- **Safe permissions** — runs under Apify `LIMITED_PERMISSIONS`, accessing only its own run
  storage.

- **No silent failures** — one dataset row per requested video (transcript or status), plus
  `OUTPUT.state` and `RUN_SUMMARY.jobResults` for agents to distinguish `complete`, `zero_match`,
  `timed_out`, and `partial` runs without guessing.

### Pricing

Pay-per-event pricing: you pay for processed videos — a delivered transcript, or a content
outcome the video itself caused (no captions, unavailable, requested language missing, age gate).

- **`result` event:** **$0.005 per charged row** ($5.00 per 1,000 charged rows)
- **`apify-actor-start` event (optional):** **$0.00005** per run
- **Charged:** delivered transcripts, plus status rows with `no_captions`, `unavailable`,
  `no_requested_language`, or `age_restricted`.
- **Free:** infrastructure outcomes (`egress_unavailable`, `login_required`, `rate_limited`,
  `network_error`, `deadline`, `video_timeout`, `unknown`, `not_run`), skipped duplicates,
  rejected `invalid_input` rows, failed dataset pushes, and the `RUN_SUMMARY` / `OUTPUT` records.

| Charged rows | Estimated cost |
|---:|---:|
| 10 | ~$0.05 |
| 100 | ~$0.50 |
| 1,000 | ~$5.00 |

A charged row is one processed video: a delivered transcript or a content outcome
the video itself caused. A run that only hits infrastructure failures writes no
charged rows and fires zero `result` events.

### FAQ

**How do I get a YouTube transcript without the YouTube API?**
Just pass a video URL or ID and run the actor. It reads the caption track YouTube itself serves —
manual captions when available, auto-generated subtitles otherwise — and returns the transcript
as plain text plus timestamped segments, chapters and video metadata. No API key, proxy or
YouTube account setup is required.

**What happens when a video has no captions?**
A status row is emitted with `status: "no_captions"` plus the video metadata already returned by
YouTube (`title`, `author`, `channelId`, `lengthSeconds`, `viewCount`, `keywords`,
`shortDescription`, `thumbnailUrl`, …). It is a charged content outcome (one `result` event), and
the video is counted in `videosNoCaptions` and recorded in `RUN_SUMMARY.jobResults`.

**What happens with an age-restricted video?**
YouTube only serves age-restricted videos to a signed-in viewer whose account has confirmed its
age. The actor tries these through a signed-in session when one is available — **best-effort, not
guaranteed**. When it works you get a normal transcript row (or `no_captions` if the video is
playable but has no caption track). When the session can't unlock it, the actor emits a status
row with `"status": "age_restricted"`, counts it in `videosAgeRestricted`, and charges one
content-outcome result.

**How does language selection work?**
The actor looks for an exact match for `preferredLanguage` (preferring manual captions over
auto-generated tracks), then regional variants (e.g. `en-US`, `en-GB`), then the base language.
If `fallbackToAnyLanguage` is `true` (default), it falls back to the first available track when
the preferred language is absent.

**Can I get chapters for any video?**
Chapters are returned when `includeChapters: true` **and** the creator added chapter timestamps
to the video. Videos without creator chapters return `chapters: []`.

**Are segment timestamps word-level?**
`segments` are caption cues (`{start, duration, end, text}` in seconds) as served by YouTube's
caption track, while `transcriptText` joins all cues into a single space-separated string ready
for embeddings or LLM context windows.

### Report issues & request features

Found a bug, a video type we don't handle yet, or a feature you'd love? Open an issue at
[Actor > Issues](https://console.apify.com/actors/NbkFxO6OhZvYw68Sf/info/issues?build=latest), email
<t2solutions.tech@gmail.com>, or message [@t2techsolutions](https://x.com/t2techsolutions) on X.
I actively monitor all three and respond — your reports directly shape what gets built next.

### Legal note

This actor reads publicly available YouTube caption tracks and video metadata. You are
responsible for complying with YouTube's Terms of Service and respecting the rights of content
owners.

### Related actors

- **[Google Ads Transparency Scraper](https://apify.com/t2solutions/google-ads-transparency-scraper)** — scrape ad creatives, landing pages and run dates from the Google Ads Transparency Center across ~46 markets.
- **[TikTok Creative Center Ads Fetch](https://apify.com/t2solutions/tiktok-creative-center-ads-fetch)** — top TikTok ads by market and period.
- **[Google Flights Price Fetcher](https://apify.com/t2solutions/google-flights-price-fetcher)** — Google Flights fares and route search.
- **[Google Hotels Scraper](https://apify.com/t2solutions/google-hotels-scraper)** — Google Hotels search results.
- **[YouTube Audio Downloader](https://apify.com/utils/youtube-link)** — extract YouTube audio (Shorts, Music) as M4A/AAC or WebM/Opus, no login or API key.
- **[YouTube Video Downloader](https://apify.com/utils/youtube-video-downloader)** — download YouTube videos as MP4 up to 4K, with per-video quality and timeframe cuts.

# Actor input Schema

## `videos` (type: `array`):

YouTube videos to fetch: watch URLs, youtu.be links, /shorts/, /embed/ or /live/ links, or bare 11-character video IDs (1-1,000 unique videos). One dataset row is delivered per submitted entry: a transcript row when the transcript is delivered, a status row ({videoId, url, status}) when it is not, or a free invalid_input row ({url, inputIndex, status, reason}) when the entry is not a YouTube link. Duplicates are collapsed in input order. Billed: delivered transcripts and content-outcome statuses (no_captions, unavailable, no_requested_language, age_restricted); free: infrastructure failures and invalid_input. A batch of bad links never fails the run.

## `preferredLanguage` (type: `string`):

Choose the transcript language from the dropdown. Each option shows its YouTube language code in parentheses (Czech is cs, not the country code CZ); pick Other to enter a code that is not listed. Manual captions beat auto-generated (ASR) for the same language; a regional match (en-US/en-GB) and then the base language (en for en-US) are tried before the any-language fallback.

## `preferredLanguageCustom` (type: `string`):

Used only when Preferred transcript language is Other. Enter an ISO/YouTube code such as en-US, zh-Hans or pt-PT. Ignored for the listed languages.

## `fallbackToAnyLanguage` (type: `boolean`):

When the preferred language is unavailable, take the first manual track (or the first track) instead of recording no_requested_language. Must be a real boolean. Default: true.

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

Include the segments array (\[{start, duration, end, text}]) alongside the plain transcriptText. segmentCount is always reported. Must be a real boolean. Default: true.

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

Extract creator-added chapter markers ({title, startSeconds, timeText}; timeText is nullable when YouTube omits it). Chapters exist only when the creator added them; a video without chapters yields chapters: \[]. If chapter markers cannot be retrieved, chapters stays \[] and the reason is recorded in RUN_SUMMARY.chaptersUnavailable. Default: false.

## `maxVideos` (type: `integer`):

Maximum number of unique videos processed in one run (1..1000). Videos beyond this cap are counted in RUN_SUMMARY.videosSkippedOverCap and the state becomes partial with partialReason video_cap. At the defaults (25-minute deadline, 4 workers, 1.5 s pacing) 1,000 videos fit comfortably; with 1 worker, 1,000 needs a longer deadline. Default: 100.

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

How many videos are processed in parallel (1..8, clamped at run time). Each worker keeps its own pacing gap, so the batch finishes about concurrency times faster while every network lane still sees the same per-IP request rate. The effective value is capped by the number of healthy network lanes available to the run. Set 1 for the old sequential behavior when isolating a problem. An out-of-range value is clamped and recorded in the run notes. Default: 4.

## `pacingSeconds` (type: `number`):

Delay between videos for each worker in seconds (0.5..30, clamped at run time). The gap is per worker: the aggregate launch rate is concurrency / pacingSeconds, while each exit IP keeps the same per-IP rate. Default: 1.5.

## `maxDurationMinutes` (type: `number`):

Hard wall for the whole run, 1..59 minutes (clamped). On expiry running stops, transcripts already delivered are kept, and RUN_SUMMARY records state timed_out with partialReason deadline. A single stalled video is capped at 20 seconds (reported as video_timeout), so it cannot consume the run. Budget roughly maxVideos x (1.6 + pacingSeconds) / concurrency seconds plus slow-video headroom; the defaults comfortably fit 1,000 videos. Default: 25.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://www.youtube.com/watch?v=dtp6b76pMak"
  ],
  "preferredLanguage": "en",
  "fallbackToAnyLanguage": true,
  "includeTimestamps": true,
  "includeChapters": false,
  "maxVideos": 100,
  "concurrency": 4,
  "pacingSeconds": 1.5,
  "maxDurationMinutes": 25
}
```

# Actor output Schema

## `transcripts` (type: `string`):

Dataset rows with full video metadata (title, author, channel, duration, views, keywords, description, thumbnail, language, segments, chapters) and status: "ok" for a delivered transcript. A video that could not be delivered keeps a status row instead ({videoId, url, status}, plus the player metadata when the video was playable with no usable captions), so no requested video is a silent hole. An entry that is not a YouTube link is returned as an invalid_input row ({url, inputIndex, status, reason}) and never fails the run. The Overview view shows the transcript essentials plus status and source URL; the built-in All fields view shows everything. Status rows with a content outcome are billed; infrastructure outcomes and invalid_input rows are free; no summary record is mixed in.

## `result` (type: `string`):

OUTPUT record with the delivered-row count, the billed-row count (OUTPUT.chargedRows = transcript rows plus billable content-outcome status rows), the status-row count and the run outcome (OUTPUT.rows, OUTPUT.chargedRows, OUTPUT.noTranscriptRows, OUTPUT.state, OUTPUT.partialReason).

## `summary` (type: `string`):

RUN_SUMMARY record: the full honesty summary (state, row/video counters, skip counters, partialReason, chaptersUnavailable, jobResults).

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

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

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

```

## MCP server setup

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