# YouTube Transcript Scraper - Subtitles, SRT & Timestamps (`swerve/youtube-transcript-scraper`) Actor

Get the transcript of any YouTube video as clean text, timestamped segments, SRT or WebVTT, in bulk. Paste video, Shorts, channel, @handle or playlist URLs or search by keyword. Choose the caption language or let YouTube translate it. No login, no API key; pay only for transcripts you receive.

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

## Pricing

$5.00 / 1,000 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

## YouTube Transcript Scraper - Subtitles, SRT & Timestamps

Get the **transcript of any YouTube video** as clean text, timestamped segments, SRT or WebVTT, in bulk. Paste video, Shorts, channel, @handle or playlist URLs, or search by keyword, and get one row per video with its captions and details. **No login, no API key, no quota.**

### Why this transcript scraper

- **Whole channels and playlists in one run.** A channel URL transcribes every video it lists, not just the latest 15.
- **Every format at once.** Plain text for AI and search, `{start, duration, text}` segments for timestamps, and ready-to-save SRT and WebVTT files, all in the same row.
- **Your language, your caption type.** Pick an ordered list of preferred languages and keep only manual or only auto-generated captions; every language the video offers is listed in the row.
- **You only pay for transcripts you get.** Videos without captions, private or removed videos are reported in the output with a plain-language reason and are never charged.
- **Video details for free.** Title, channel, length, views, publish date, description and thumbnail come from the same response that carries the captions.

### Use cases

- Feed video content to an LLM: summaries, Q\&A over a channel, RAG pipelines, MCP tools
- Build searchable archives of lectures, podcasts, interviews and conference talks
- Pull subtitles (SRT/VTT) for translation workflows, dubbing or accessibility work
- Research what competitors, creators or news channels actually say, at scale
- Mine keywords and topics from a niche's top videos for SEO and content planning

### Input

| Field | What it does | Example |
|-------|--------------|---------|
| **YouTube URLs** | Videos, Shorts, youtu.be links, channels, @handles, playlists, or bare video ids. A channel or playlist returns every video it contains. | `https://youtu.be/aircAruvnKk`, `https://www.youtube.com/@veritasium` |
| **Search terms** | Or find videos by keyword and transcribe the results. | `react tutorial`, `מתכון חומוס` |
| **Preferred languages** | Ordered ISO codes; the first track that exists wins. Blank = the video's own spoken language. | `en`, `es`, `pt-BR` |
| **Caption type** | Any (manual first, then auto-generated), manual only, or auto-generated only. | `any` |
| **Transcript formats** | Plain text, timestamped segments, SRT, WebVTT. Pick any combination. | `text`, `segments` |
| **Include video details** | Title, channel, length, views, publish date, description, thumbnail. On by default. | on |
| **Max videos per channel / playlist / search** | How many newest videos to take from each source. Blank = all. | `200` |
| **Max videos in total** | Optional overall cap for the run. Blank = everything. | `1000` |

Run it with just the prefilled URL to see a full example row.

### Output

One row per video:

```json
{
  "videoId": "aircAruvnKk",
  "url": "https://www.youtube.com/watch?v=aircAruvnKk",
  "status": "ok",
  "error": null,
  "title": "But what is a neural network? | Deep learning chapter 1",
  "channelName": "3Blue1Brown",
  "channelId": "UCYO_jab_esuFRV4b17AJtAw",
  "channelUrl": "https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw",
  "durationSeconds": 1120,
  "viewCount": 25080283,
  "publishedAt": "2017-10-05",
  "category": "Education",
  "keywords": null,
  "description": "What are the neurons, why are there layers, and what is the math underlying it?...",
  "thumbnail": "https://i.ytimg.com/vi/aircAruvnKk/maxresdefault.jpg",
  "language": "English",
  "languageCode": "en",
  "isAutoGenerated": false,
  "availableLanguages": [
    { "code": "en", "name": "English", "isAutoGenerated": false },
    { "code": "en", "name": "English (auto-generated)", "isAutoGenerated": true },
    { "code": "es", "name": "Spanish", "isAutoGenerated": false }
  ],
  "transcript": "This is a 3. It's sloppily written and rendered at an extremely low resolution of 28x28 pixels, but your brain has no trouble recognizing it as a 3...",
  "segments": [
    { "start": 4.22, "duration": 1.18, "text": "This is a 3." },
    { "start": 6.06, "duration": 4.653, "text": "It's sloppily written and rendered at an extremely low resolution of 28x28 pixels," }
  ],
  "srt": null,
  "vtt": null,
  "wordCount": 3357,
  "segmentCount": 286,
  "transcriptDurationSeconds": 1105.64,
  "scrapedAt": "2026-11-02T13:10:11.000Z"
}
```

`status` tells you what happened to each video:

| status | Meaning | Charged? |
|--------|---------|----------|
| `ok` | Transcript returned | yes |
| `no_captions` | The video has no caption track, or none of the kind / language you asked for (`error` lists what it does have) | no |
| `unavailable` | YouTube returned no video: private, removed, age-gated or region-locked | no |
| `error` | YouTube did not serve the caption file after retries; run the video again | no |

### How it works

The actor talks to the same internal interface the YouTube site uses to list a video's caption tracks, picks the track that best matches your language settings, and downloads its timed caption feed. Auto-generated captions are cleaned of YouTube's rendering hints so each segment is a readable line. Channel and playlist URLs are expanded through YouTube's own listing endpoint, page by page, so a channel with 2,000 videos returns 2,000 rows.

YouTube blocks caption downloads from datacenter addresses, so requests go through a residential proxy by default and a blocked request is retried from a fresh address.

### Limits

- A transcript can only exist where captions exist. Videos with captions disabled come back as `no_captions`, with the rest of the row filled.
- Transcripts are returned in the language of an existing caption track; YouTube no longer serves its machine-translated tracks outside the player, so translation is not offered.
- `publishedAt` is the date YouTube reports; for a few videos only a relative label is available.

### Export formats

Download results as JSON, CSV, Excel or XML, or pull them through the Apify API into your own app, spreadsheet, vector database or MCP client.

### Frequently asked questions

**Do I need a YouTube API key?** No. The official YouTube Data API does not expose transcripts at all; this actor reads them directly and has no quota.

**Can I get the transcript of a whole channel?** Yes. Paste the channel or @handle URL; every video it lists is transcribed, newest first. Use "Max videos per channel" to take only the latest N.

**Does it work with auto-generated captions?** Yes. By default it prefers manually written captions and falls back to auto-generated ones; you can also force either kind.

**Can I get subtitles as a file?** Select SRT or WebVTT; each row then carries the complete subtitle file as text, ready to save with a `.srt` or `.vtt` extension.

**What about Shorts and youtu.be links?** All YouTube URL forms work: `watch?v=`, `youtu.be/`, `/shorts/`, `/embed/`, `/live/`, mobile links, and bare 11-character ids.

**Is scraping YouTube transcripts legal?** The actor collects only public data. You are responsible for how you use it; review YouTube's terms and your local laws before large-scale use.

### Pricing

Pay per transcript. Videos that come back without a transcript are listed in your results but never charged.

# Actor input Schema

## `startUrls` (type: `array`):

Video, Shorts, youtu.be, channel, @handle or playlist URLs, or bare 11-character video IDs. A channel or playlist URL returns the transcript of every video it contains. Examples: https://www.youtube.com/watch?v=aircAruvnKk , https://youtu.be/dQw4w9WgXcQ , https://www.youtube.com/shorts/abc123DEF45 , https://www.youtube.com/@veritasium , https://www.youtube.com/playlist?list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi

## `searchTerms` (type: `array`):

Or find videos by keyword and transcribe the top results, e.g. react tutorial, מתכון חומוס, entrevista elon musk.

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

Ordered list of ISO 639-1 codes. The first caption track that matches wins, e.g. en, es, he, pt-BR. Leave empty to take the video's own spoken-language track (manual captions first, auto-generated second).

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

Which caption tracks to accept. 'Any' prefers manually written captions and falls back to YouTube's auto-generated ones; 'Manual only' and 'Auto-generated only' skip videos that lack that kind.

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

Which forms of the transcript each row carries. 'Plain text' is one clean paragraph; 'Timestamped segments' is an array of {start, duration, text}; SRT and WebVTT are ready-to-use subtitle files as text.

## `includeMetadata` (type: `boolean`):

Add title, channel, duration, view count, publish date, description and thumbnail to every row. They come from the same response that carries the captions, so this costs nothing extra. On by default.

## `maxVideosPerSource` (type: `integer`):

For each channel, playlist or search term, how many of its newest videos to transcribe. Leave blank to take every video the source lists. Does not apply to single video URLs.

## `maxItems` (type: `integer`):

Optional overall cap on how many videos the whole run returns. Leave blank for everything your inputs point to.

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

YouTube blocks caption downloads from datacenter addresses, so a residential proxy is the default. Keep it on unless you bring your own proxies.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk"
  ],
  "searchTerms": [],
  "languages": [],
  "transcriptType": "any",
  "outputFormats": [
    "text",
    "segments"
  ],
  "includeMetadata": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

All transcript rows (JSON). Append ?format=csv for CSV.

# 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 = {
    "startUrls": [
        "https://www.youtube.com/watch?v=aircAruvnKk"
    ],
    "searchTerms": [],
    "languages": [],
    "outputFormats": [
        "text",
        "segments"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("swerve/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 = {
    "startUrls": ["https://www.youtube.com/watch?v=aircAruvnKk"],
    "searchTerms": [],
    "languages": [],
    "outputFormats": [
        "text",
        "segments",
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("swerve/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 '{
  "startUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk"
  ],
  "searchTerms": [],
  "languages": [],
  "outputFormats": [
    "text",
    "segments"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call swerve/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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