# YouTube Transcripts Scraper (`scrapewonder/youtube-transcripts-scraper`) Actor

Get YouTube video transcripts and subtitles as clean text, timestamped segments, SRT or VTT. Videos, Shorts, playlists and channels. Manual and auto-generated captions, language fallback, no login. Pay only for transcripts found.

- **URL**: https://apify.com/scrapewonder/youtube-transcripts-scraper.md
- **Developed by:** [Wonderland Data](https://apify.com/scrapewonder) (community)
- **Categories:** Videos, AI, Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 transcript extracteds

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 Transcripts Scraper

Get **YouTube video transcripts and subtitles** as clean plain text, **timestamped segments**, **SRT** or **WebVTT**. Works with single videos, **Shorts**, **playlists** and **whole channels**. Human-made captions are preferred, with automatic (auto-generated) captions as a fallback, in the language you choose. Every item also includes the video title, channel, publish date, duration and view count. No YouTube account, no login, no API key, no browser.

You **pay only for transcripts found**: videos without captions are still listed (so you know why) but are **not charged**.

Built for **AI and RAG pipelines** (feed transcripts into LLMs, embeddings and vector databases), **content repurposing** (blog posts, newsletters, show notes, clips), **SEO**, **research and media monitoring**, translation and accessibility work, and any dataset that needs what was actually said in a video.

### What you get

One dataset item per video.

| Field | Example | Notes |
|---|---|---|
| `videoId`, `url` | `dQw4w9WgXcQ`, `https://www.youtube.com/watch?v=dQw4w9WgXcQ` | Canonical watch URL, whatever URL form you gave |
| `title` | `Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)` | |
| `channelName`, `channelId`, `channelUrl` | `Rick Astley`, `UCuAXFkgsw1L7xaCfnd5JJOw`, `https://www.youtube.com/@RickAstleyYT` | |
| `publishDate` | `2009-10-25T06:57:33.000Z` | Always a full ISO 8601 UTC timestamp. When YouTube gives only a day, the time is `T00:00:00.000Z` |
| `durationSeconds`, `viewCount` | `213`, `1839948740` | Numbers, not "3:33" or "1.8B views" |
| `category`, `keywords`, `thumbnailUrl` | `Music`, `["rick astley", ...]` | |
| `isLive`, `wasLive` | `false`, `false` | `isLive`: the stream is live right now. `wasLive`: a recording of a past live stream |
| `description` | | Full description, only with **Include video description** |
| `transcriptAvailable` | `true` | `false` when the video has no usable captions |
| `unavailableReason` | `No captions available for this video` | Why there is no transcript (no captions, private, age-restricted, language not available...) |
| `language`, `languageName` | `en`, `English` | Language of the returned transcript |
| `isAutoGenerated` | `false` | `true` = YouTube automatic speech recognition captions |
| `availableLanguages` | `[{"code":"en","name":"English","isAutoGenerated":false}, ...]` | All caption tracks of the video |
| `transcript` | `We're no strangers to love. You know the rules...` | Full plain text, line breaks inside captions removed. Japanese/Chinese lines are joined without inserting spaces |
| `wordCount`, `characterCount`, `segmentCount` | `487`, `1893`, `61` | Words are split on spaces; Japanese and Chinese text (no spaces) is split into words with a dictionary-based word segmenter. `characterCount` = characters without whitespace, the better length measure for CJK |
| `segments` | `[{"start":18.64,"duration":3.24,"text":"♪ We're no strangers to love ♪"}, ...]` | Seconds as numbers (ms precision). Optional |
| `srt`, `vtt` | `1\n00:00:18,640 --> 00:00:21,880\n...` | Ready-to-save subtitle files. Optional |
| `playlistId` | `UUuAXFkgsw1L7xaCfnd5JJOw` | Set when the video came from a channel or playlist input |
| `inputUrl`, `scrapedAt` | | Which input produced the item, ISO time of scraping |
| `error` | `true` | Only on items that failed (see Reliability); absent otherwise |

### How to use

1. Paste video links or IDs into **Video URLs or IDs**. Any form works: `watch?v=`, `youtu.be/`, `/shorts/`, `/embed/`, `/live/`, `m.youtube.com`, `music.youtube.com` or the bare 11-character ID.
2. Optionally add **channel or playlist URLs** (`/@handle`, `/channel/UC...`, `/c/...`, `/user/...`, legacy `youtube.com/name`, `playlist?list=...`) and set **Max videos per channel / playlist**.
3. Optionally set **Preferred languages** (e.g. `en`, `es`, `pt-BR`). Leave empty to get each video's default caption track (English when the uploader provided it, otherwise usually the original language); set e.g. `es` to get the Spanish track of a Spanish video.
4. Choose the output formats (segments, SRT, VTT) and run. Download the results as JSON, CSV, Excel or via the API.

#### Example input

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/kJQP7kiw5Fk",
    "https://www.youtube.com/shorts/C0DPdy98e4c"
  ],
  "channelOrPlaylistUrls": ["https://www.youtube.com/@RickAstleyYT"],
  "maxVideosPerChannel": 20,
  "languages": ["en"],
  "allowAutoGenerated": true,
  "fallbackToAnyLanguage": true,
  "includeSegments": true,
  "includeSrt": true,
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

#### Example item (shortened)

```json
{
  "videoId": "dQw4w9WgXcQ",
  "url": "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",
  "publishDate": "2009-10-25T06:57:33.000Z",
  "durationSeconds": 213,
  "viewCount": 1839948740,
  "category": "Music",
  "transcriptAvailable": true,
  "unavailableReason": null,
  "language": "en",
  "languageName": "English",
  "isAutoGenerated": false,
  "availableLanguages": [
    { "code": "en", "name": "English", "isAutoGenerated": false },
    { "code": "en", "name": "English", "isAutoGenerated": true },
    { "code": "de-DE", "name": "German (Germany)", "isAutoGenerated": false }
  ],
  "transcript": "[♪♪♪] ♪ We're no strangers to love ♪ ♪ You know the rules and so do I ♪ ...",
  "wordCount": 487,
  "segmentCount": 61,
  "segments": [
    { "start": 1.36, "duration": 1.68, "text": "[♪♪♪]" },
    { "start": 18.64, "duration": 3.24, "text": "♪ We're no strangers to love ♪" }
  ],
  "srt": "1\n00:00:01,360 --> 00:00:03,040\n[♪♪♪]\n\n2\n00:00:18,640 --> 00:00:21,880\n♪ We're no strangers to love ♪\n...",
  "playlistId": null,
  "inputUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "scrapedAt": "2026-11-22T19:54:04.263Z"
}
```

### How the language is chosen

For each language in **Preferred languages**, in order (the first language that has any usable track wins):

1. human-made captions in exactly that code (`pt-BR`);
2. human-made captions in the same base language (`en` also matches `en-US`, `en-GB`);
3. auto-generated captions in exactly that code (only if **Allow auto-generated captions** is on);
4. auto-generated captions in the same base language (same condition).

So human-made captions always beat auto-generated ones within a language: with tracks `en` (auto-generated) and `en-US` (human-made), asking for `en` returns `en-US`.

If nothing matches (or **Preferred languages** is empty) and **Fall back to any language** is on, you get the caption track YouTube turns on by default for an English-language viewer (English when the uploader provided English captions, otherwise usually the original language), replaced by a human-made track in the same language when the default one is auto-generated. If **Fall back to any language** is off, the item has `transcriptAvailable: false` and `unavailableReason` lists the languages the video does have. With **Allow auto-generated captions** off, auto-generated tracks are never returned, not even as a fallback.

### Pricing: pay only for transcripts

This Actor charges a custom event **`transcript`**, once per video for which a transcript was actually returned. Videos without captions, private or deleted videos, unavailable languages and failed videos are saved with `transcriptAvailable: false` **free of charge** (turn on **Skip videos without transcript** to leave them out completely). Channel and playlist expansion is not charged. If you set a maximum cost for a run, the Actor stops when the limit is reached; a transcript that no longer fits in the limit is not saved and not charged.

### Tips

- **Bulk runs:** put hundreds or thousands of video URLs into one run; the Actor processes 5 videos in parallel by default (`maxConcurrency`, up to 20). Duplicate URLs, and the same channel given twice in different forms, are processed once.
- **Channels:** a channel input expands to all its uploads, newest first, including Shorts and past live streams. Use a playlist URL if you need a specific selection.
- **LLM / RAG:** use `transcript` for plain text, or `segments` to keep timestamps so you can link back to `url&t=<start>s`.
- **Subtitles:** turn on SRT or VTT and save the string as a `.srt` / `.vtt` file.
- **Smaller output:** turn off **Include timestamped segments** if you only need the text.
- **Live streams:** a stream that is currently live, or whose recording is not available, has no transcript; it is reported with the reason.

### Cost and proxy

The Actor uses plain HTTP requests to YouTube's own JSON endpoints (no browser), so it is fast (about 0.3 s per video) and light: about **45 KB of proxy traffic per video** (about 4.5 MB per 100 videos, measured), plus about 70 KB per 100 videos listed from a channel or playlist.

**Residential proxy is the default and is recommended.** YouTube often answers datacenter IPs with "Sign in to confirm you're not a bot". When that happens the Actor saves nothing for that video yet, switches to a fresh IP and retries, so no video is duplicated or silently dropped. A video that still fails after 5 retries is saved with `transcriptAvailable: false` and the error, free of charge.

### Reliability

YouTube periodically changes which app versions it accepts. The Actor tries several client identities in turn for each video (Android, iOS, Android VR), so one breaking does not stop your run, and every video ends with either a transcript or a clear reason. Errors are classified: IP blocks (HTTP 429, YouTube's "Sorry" page, "confirm you're not a bot") are retried with a fresh IP, network errors and HTTP 5xx are retried, and permanent outcomes (private, removed or unplayable videos, no captions, caption links YouTube will not serve to any client) are saved right away without retries, so they do not waste proxy traffic. Such failed items have `error: true`. If 30 videos in a row fail with a permanent error, the Actor stops and reports that YouTube has probably changed its API. Channels and playlists are listed one page (100 videos) per request, so a retry repeats only the failed page, and large channels (thousands of videos) are listed reliably. Run statistics (videos with/without transcript, failed, blocks, which client worked, listed pages, traffic) are saved in the `RUN_STATS` record of the run's key-value store.

### FAQ

**Do I need a YouTube account, cookies or an API key?** No. Only public data is read, without logging in.

**Can it get transcripts of private, members-only or age-restricted videos?** No. These are reported with `transcriptAvailable: false` and the reason given by YouTube. The Actor does not log in or bypass any restriction.

**Does it translate transcripts?** Not at the moment. YouTube's machine translation of captions is not available without a signed-in browser session, so the Actor returns the original caption tracks only. You get every available language in `availableLanguages` and can request any of them in **Preferred languages**.

**Why do some videos have no transcript?** The uploader did not add captions and YouTube did not generate automatic ones (common for music-only videos, very short videos, some Shorts and new uploads, and some languages).

**Are auto-generated captions accurate?** They are YouTube's speech recognition output: good for search, summarization and RAG, but without punctuation guarantees. `isAutoGenerated` tells you which kind you got; human-made captions are always preferred when they exist in your language.

**What timing format do segments use?** `start` and `duration` are seconds as numbers with millisecond precision. SRT and VTT end times are trimmed so auto-generated lines do not overlap.

**Is it legal?** The Actor reads publicly available data. Transcripts can be copyrighted by their creators; make sure your use complies with copyright law and YouTube's terms in your jurisdiction.

# Actor input Schema

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

YouTube video links or 11-character video IDs. Accepts watch, youtu.be, Shorts, embed, live and mobile URLs.

## `channelOrPlaylistUrls` (type: `array`):

Optional. A playlist URL (?list=...), a channel URL (/@handle or just @handle, /channel/UC..., /c/..., /user/..., legacy youtube.com/name) or a channel ID. All uploads of a channel (videos, Shorts and past live streams, newest first) are expanded into videos.

## `maxVideosPerChannel` (type: `integer`):

Stop expanding each channel or playlist after this many videos. Has no effect on the video URLs above.

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

Language codes in order of preference, e.g. en, de, pt-BR. 'en' also matches en-US and en-GB. For each language, human-made captions are tried before auto-generated ones (exact code first, then the base language). Leave empty to get the video's default caption language.

## `allowAutoGenerated` (type: `boolean`):

Use YouTube's automatic (speech recognition) captions when no human-made captions exist in the chosen language. Human-made captions in the same language are always preferred. When off, auto-generated captions are never returned.

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

If none of the preferred languages is available, return the video's default caption track (human-made if one exists in that language) instead of no transcript.

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

Add a 'segments' array with start time, duration (seconds) and text for every caption line.

## `includeSrt` (type: `boolean`):

Add the transcript as a ready-to-save SRT subtitle string in the 'srt' field.

## `includeVtt` (type: `boolean`):

Add the transcript as a WebVTT subtitle string in the 'vtt' field.

## `includeDescription` (type: `boolean`):

Add the full video description text in the 'description' field.

## `includePublishDate` (type: `boolean`):

Fetch publish date, category and channel URL with one small extra request (~11 KB) per video. Turn off to save a little proxy traffic.

## `skipVideosWithoutTranscript` (type: `boolean`):

By default videos without captions are still saved (free of charge) with transcriptAvailable=false and a reason. Turn on to leave them out of the dataset.

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

How many videos are processed in parallel.

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

Residential proxy is strongly recommended: YouTube often answers datacenter IPs with 'Sign in to confirm you're not a bot'. Each video uses only ~50-80 KB of proxy traffic.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/kJQP7kiw5Fk"
  ],
  "maxVideosPerChannel": 20,
  "languages": [],
  "allowAutoGenerated": true,
  "fallbackToAnyLanguage": true,
  "includeSegments": true,
  "includeSrt": false,
  "includeVtt": false,
  "includeDescription": false,
  "includePublishDate": true,
  "skipVideosWithoutTranscript": false,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

All scraped items in the default dataset.

# 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://youtu.be/kJQP7kiw5Fk"
    ],
    "maxVideosPerChannel": 20,
    "languages": [],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapewonder/youtube-transcripts-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://youtu.be/kJQP7kiw5Fk",
    ],
    "maxVideosPerChannel": 20,
    "languages": [],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("scrapewonder/youtube-transcripts-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://youtu.be/kJQP7kiw5Fk"
  ],
  "maxVideosPerChannel": 20,
  "languages": [],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call scrapewonder/youtube-transcripts-scraper --silent --output-dataset

```

## MCP server setup

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