# YouTube Transcript Scraper: Channels & Playlists (`dgn-lab/youtube-transcript-scraper`) Actor

Extract YouTube transcripts and subtitles from videos, channels and playlists. Get full text, timestamps and TXT/SRT/VTT downloads. Choose languages, request YouTube caption translation and export JSON or CSV. Existing manual and auto-generated captions only; no audio transcription.

- **URL**: https://apify.com/dgn-lab/youtube-transcript-scraper.md
- **Developed by:** [Sinan Dogan](https://apify.com/dgn-lab) (community)
- **Categories:** Videos, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 successful transcripts

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

### What does YouTube Transcript API do?

Get **YouTube transcripts and subtitles from videos, creator channels and playlists** in one structured dataset. Return full text, timestamped segments and downloadable **TXT, SRT and WebVTT** files for search, research, content workflows and AI applications.

It retrieves manual and automatically generated captions already available on [YouTube](https://www.youtube.com). It does not download audio or run speech recognition. A video without accessible captions produces an explicit error.

### Why use this YouTube transcript API?

Feed timestamped text into search indexes, content analysis, accessibility workflows and retrieval pipelines. Process several videos in one request, export subtitle files, select languages in priority order, request YouTube's caption translation and choose manual or generated caption tracks. Duplicate video IDs are processed once, including when supplied as different URL formats.

Apify provides scheduling, datasets and API access. Apify residential proxy is enabled by default and included in the transcript price. Custom proxy configuration is also supported. Every attempt asks the configured proxy provider for a new URL; actual IP rotation depends on that provider. Proxies do not guarantee successful access.

Captions are fetched fresh on every run, without serving a persistent transcript cache. Requested export formats are retained. Eligible transient failures use the configured retry budget; per-video errors remain visible in the dataset.

### How to extract YouTube transcripts

1. Enter video IDs, YouTube video URLs, channel URLs such as `https://www.youtube.com/@creator`, or playlist URLs such as `https://www.youtube.com/playlist?list=PLAYLIST_ID`.
2. Choose preferred language codes, for example `en` then `fr`.
3. Keep the included residential proxy enabled, start a small batch and inspect the dataset's `status` and `errorCode` columns. You can also supply your own proxy configuration.
4. Download captions through each row's `files` links.

See the Input tab for the full configuration. Videos are capped by `maxVideos`; network concurrency and retries are bounded. Invalid videos and unavailable tracks do not prevent other videos from completing. A run fails if no transcript could be retrieved; partial batches keep all successful results and per-video errors.

### Input example

```json
{
    "videos": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"],
    "languages": ["en", "fr"],
    "transcriptType": "any",
    "exportFormats": ["txt", "srt", "vtt"],
    "maxVideos": 10,
    "maxConcurrency": 2,
    "maxRetries": 2,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": ["RESIDENTIAL"]
    }
}
```

#### Channels, creators and playlists

Use the existing `videos` input for a mixture of individual videos, channels and playlists. Channel roots (`/@handle`, `/channel/ID`, `/c/name`, `/user/name`) select the **Videos** tab. Pass an explicit `/shorts` or `/streams` tab to include that tab instead. The root does not automatically combine uploads, Shorts and live streams. Playlist URLs must use `/playlist?list=...`; a watch URL containing both `v` and `list` continues to select only that video.

Collection discovery lists video IDs without downloading media. Discovered videos are processed by the same caption extractor used for individual links. Duplicate IDs across all inputs are extracted once. Collections are examined in input order, using YouTube's returned order; `maxVideos` is a global upper limit on queued videos and input errors. Each collection examines at most the remaining number of entries, so duplicates, unavailable entries and empty collections may yield fewer videos than the limit. The first collection can fill the global limit before later sources are examined.

Collection access errors return a `DiscoveryFailed` dataset row when space remains and are always listed in `SUMMARY.discoveryErrors`. Already discovered videos are retained if a later listing page fails. Private or removed entries may fail caption extraction; no sign-in or access-restriction bypass is implemented. An empty collection produces no transcript rows. Channel and playlist network requests add cost beyond individual-video extraction.

```json
{
    "videos": [
        "https://www.youtube.com/@creator/videos",
        "https://www.youtube.com/playlist?list=PLAYLIST_ID"
    ],
    "maxVideos": 100
}
```

`translateTo` optionally requests a target language such as `fr`. Translation requires an existing translatable caption track. It does not create captions for videos without subtitles. `requestTimeoutSecs` limits each HTTP request, not the duration of a whole video extraction.

### What data does the Actor return?

| Field | Type | Meaning |
|---|---|---|
| videoId / videoUrl | string | Normalized video identity |
| status | string | `success` or `error` |
| text | string | Full transcript |
| segments | array | Caption text, start and duration in seconds |
| language / languageCode | string | Returned caption language |
| isGenerated | boolean | Whether captions were generated automatically |
| translatedTo | string or null | Requested translation target |
| files | object | Download links for selected formats |
| errorCode / errorMessage | string or null | Safe per-video error details |

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel. Subtitle files are separate key-value store records. `SUMMARY` contains success and failure counts; `STATE` records processing progress and is also saved when aborted. State is diagnostic and does not implement automatic resume.

Abbreviated output example (illustrative, not a transcript from a real video):

```json
[
    {
        "videoId": "AbCdEfGhI12",
        "status": "success",
        "languageCode": "en",
        "text": "Example caption text.",
        "segments": [
            {"text": "Example caption text.", "start": 0.0, "duration": 2.5}
        ]
    },
    {
        "videoId": "BcDeFgHiJ23",
        "status": "error",
        "text": null,
        "segments": [],
        "errorCode": "TranscriptsDisabled"
    }
]
```

### API access

Use the API tab for the actual Actor ID and generated client examples. The standard asynchronous Apify flow is:

1. `POST /v2/actors/{actorId}/runs` with the input JSON body and an `Authorization: Bearer` header.
2. Poll `GET /v2/actor-runs/{runId}` until a terminal status, with a fixed time limit.
3. Retrieve `GET /v2/datasets/{defaultDatasetId}/items`.

Set a run budget using the platform's `maxTotalChargeUsd` option and an execution timeout. Never put your Apify token in the Actor input. Do not automatically retry a run-start POST after an ambiguous network failure.

### Pricing and resource usage

**$3 per 1,000 successful transcripts** ($0.003 each), plus **$0.00005 per Actor start** at the supported memory sizes. One successful video is one transcript event, regardless of length, segment count or export formats. Duplicate videos within a run are processed once.

The price includes the run's compute, residential proxy, collection discovery and selected TXT/SRT/VTT exports. Failed videos and discovery-error rows do not trigger a transcript charge. The start fee still applies when a run returns no transcripts. No separate platform-usage surcharge is enabled for this Actor.

Use `maxVideos` to bound the batch and Apify's **maximum charge per run** to limit event spending. The Actor stops when the remaining spending limit cannot cover another transcript. Skipped videos then produce no result row; check `SUMMARY.chargeLimitReached`. Choose enough memory for large batches (256 MB default, up to 1 GB). Retaining or downloading stored results later may consume your account's storage or transfer allowance.

### FAQ and support

#### Does this transcribe audio when subtitles do not exist?

No. This version retrieves caption tracks already available on YouTube. Automatically generated captions come from YouTube, not a speech-recognition model run by this Actor.

#### Does this support Shorts and live-video URLs?

Yes, when accessible caption tracks exist. This is not real-time transcription of a currently running broadcast.

#### Why does YouTube block a request?

The upstream project documents cloud IP blocking. Try a suitable configured proxy and low concurrency. Videos may also be unavailable, age restricted, have disabled captions or lack your requested language. Error messages distinguish these cases where upstream provides a specific exception.

#### Does this extract private videos or bypass sign-in?

No. Authenticated and age-restricted extraction is not implemented. Supply video URLs you are authorized to process and handle any personal data in the captions appropriately. Use the Issues tab to report a reproducible video, selected language and error code without including credentials.

# Actor input Schema

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

Video IDs or video, channel and playlist URLs. Channel roots use their Videos tab; explicit /shorts and /streams tabs are supported. Watch URLs with a list parameter still select only that video. Duplicate video IDs are processed once.

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

Language codes in priority order. Only these languages are selected.

## `transcriptType` (type: `string`):

Choose manual, generated or either caption type.

## `translateTo` (type: `string`):

Optional YouTube translation language code, for example fr. Requires a translatable caption track.

## `preserveFormatting` (type: `boolean`):

Keep supported HTML formatting from captions.

## `exportFormats` (type: `array`):

Create a downloadable file for each selected format and successful video.

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

Global maximum queued videos and input errors. Discovery inspects at most the remaining number of entries per collection; duplicates or unavailable entries can produce fewer results. This is an upper limit, not a target success count.

## `maxConcurrency` (type: `integer`):

Maximum simultaneous video extractions. Lower this if YouTube blocks requests.

## `maxRetries` (type: `integer`):

Additional attempts on transient failures and IP blocks. A new proxy URL is requested each attempt when configured.

## `requestTimeoutSecs` (type: `integer`):

Timeout for each individual upstream HTTP request, not for the entire video.

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

Apify residential proxy is enabled by default and included in the transcript price. Custom proxies and explicitly disabling proxies are also supported; access depends on the chosen network.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "languages": [
    "en",
    "fr"
  ],
  "transcriptType": "any",
  "translateTo": "",
  "preserveFormatting": false,
  "exportFormats": [
    "txt",
    "srt",
    "vtt"
  ],
  "maxVideos": 100,
  "maxConcurrency": 2,
  "maxRetries": 2,
  "requestTimeoutSecs": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Dataset rows including per-video errors.

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

Success and failure counts.

## `files` (type: `string`):

Download TXT, SRT and VTT records.

# 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=jNQXAC9IVRw"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dgn-lab/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=jNQXAC9IVRw"] }

# Run the Actor and wait for it to finish
run = client.actor("dgn-lab/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=jNQXAC9IVRw"
  ]
}' |
apify call dgn-lab/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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