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

YouTube transcript scraper and subtitles downloader. Full captions as plain text plus timestamped segments for videos, shorts, playlists and channels, with title, channel, duration and publish date free. $1.50 per 1,000 transcripts.

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

## Pricing

$1.50 / 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, Captions & Metadata

**YouTube transcript scraper** and **YouTube subtitles downloader** for videos, shorts, playlists, and whole channels. Paste URLs, get the **full transcript as plain text** plus **timestamped segments**, the caption language, whether the captions are **auto-generated**, and the video's **title, channel, duration, views, and publish date**. Metadata is included at no extra charge.

**$1.50 per 1,000 transcripts** ($0.0015 each). No start fee, no metadata add-on, and you are not charged for videos that have no captions.

### What you can use it for

- Feed YouTube transcripts into ChatGPT, Claude, or your own LLM / RAG pipeline
- Summarize videos, podcasts, lectures, and interviews
- Turn videos into blog posts, show notes, or SEO content
- Research what a channel or competitor says across many videos
- Build subtitle (SRT/VTT-style) files from the timestamped segments

### Input

| Field | Default | What to put |
| --- | --- | --- |
| YouTube URLs or video IDs | two example videos | `youtube.com/watch?v=…`, `youtu.be/…`, `/shorts/…`, `/live/…`, `/embed/…`, playlist URLs, channel URLs (`@handle`, `/channel/UC…`, `/c/…`, `/user/…`), or bare 11-character IDs. |
| Preferred languages | `["en"]` | Caption language codes in order, such as `en`, `es`, `pt-BR`. |
| Fall back to any language | on | If none of your languages exist, return the video's own track (marked `language_fallback: true`). |
| Prefer human-made captions | on | Use uploaded captions over auto-generated ones when both exist. |
| Include timestamped segments | on | Adds `segments` with `start`, `duration`, `text`. |
| Max videos per playlist or channel | 50 | Newest videos first. Channel URLs read the Videos tab; link `/shorts` or `/streams` for those tabs. |
| Proxy | Apify Proxy | Leave the default. |

Example:

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/shorts/ai1gIWacf0I",
    "https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH",
    "https://www.youtube.com/@mkbhd"
  ],
  "languages": ["en"],
  "maxVideosPerSource": 20
}
```

### Output

One dataset item per video. Export as JSON, CSV, Excel, or through the API. Example (segments shortened):

```json
{
  "video_id": "dQw4w9WgXcQ",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "status": "ok",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "channel_name": "Rick Astley",
  "channel_id": "UCuAXFkgsw1L7xaCfnd5JJOw",
  "channel_handle": "@RickAstleyYT",
  "duration_seconds": 213,
  "publish_date": "2009-10-24T23:57:33-07:00",
  "view_count": 1840123339,
  "category": "Music",
  "language": "English",
  "language_code": "en",
  "is_generated": false,
  "available_languages": [
    { "language": "English", "language_code": "en", "is_generated": false, "is_translatable": true },
    { "language": "German (Germany)", "language_code": "de-DE", "is_generated": false, "is_translatable": true },
    { "language": "English (auto-generated)", "language_code": "en", "is_generated": true, "is_translatable": true }
  ],
  "transcript_text": "[♪♪♪] ♪ We're no strangers to love ♪ ♪ You know the rules and so do I ♪ …",
  "word_count": 487,
  "segment_count": 61,
  "segments": [
    { "start": 1.36, "duration": 1.68, "text": "[♪♪♪]" },
    { "start": 18.64, "duration": 3.24, "text": "♪ We're no strangers to love ♪" }
  ],
  "charged": true
}
```

A video that can't return a transcript is still listed, with `status: "error"`, an `error` code, and `charged: false`:

| `error` | Meaning |
| --- | --- |
| `no_captions` | The video has captions turned off or none exist. |
| `language_not_found` | None of your languages exist and fallback is off. |
| `video_unavailable` / `video_unplayable` / `age_restricted` | Private, deleted, region-locked, members-only, or age-gated. |
| `blocked_by_youtube` | YouTube refused every retry for this video. Run it again later. |
| `invalid_input` / `list_empty_or_failed` | Not a YouTube URL or ID, or a playlist/channel with no listable videos. |

The **Transcripts** view shows one row per video. The **Timestamped segments** view shows the segment arrays. A run summary is saved as `OUTPUT` in the key-value store.

### Pricing

Pay per event. You pay only for transcripts you receive.

| Event | Price |
| --- | --- |
| `transcript` (one video's transcript + metadata) | **$0.0015** |

100 transcripts = **$0.15**. 1,000 transcripts = **$1.50**. 10,000 transcripts = **$15**. Videos without captions, unavailable videos, invalid inputs, and blocked requests are free. Set **Maximum cost per run** in the run options to cap a run; the Actor stops cleanly when it is reached.

### FAQ

**Does it work for Shorts, live replays, and auto-generated captions?** Yes. Shorts and `/live/` URLs are treated as videos. Auto-generated captions are returned and marked `is_generated: true`.

**Can I get a whole channel or playlist?** Yes. Paste the channel or playlist URL and set *Max videos per playlist or channel*.

**Which languages?** Any caption track the video has. Put several codes in *Preferred languages* to pick the first available. `available_languages` lists every track the video has.

**Do I need a YouTube API key or login?** No. The Actor reads the same public captions the YouTube player shows. It cannot read private, members-only, or age-restricted videos.

**How do I get SRT or VTT subtitles?** Use the `segments` array: each item has `start` and `duration` in seconds and the caption `text`.

**How fast is it?** YouTube rate-limits caption requests, so the Actor paces itself and retries blocked videos at the end of the run instead of failing them. In our test run on Apify (Nov 23, 2026), 15 videos from a mix of single videos, a playlist, and a channel all returned transcripts in about 5 minutes.

**Why is a field like `publish_date` sometimes null?** YouTube occasionally serves a shorter page without it. The transcript is still complete.

**Is scraping YouTube transcripts legal?** The Actor only reads publicly available captions. You are responsible for how you use the data, including YouTube's Terms of Service and copyright in the transcript text.

### Credits

Caption fetching is built on [jdepoix/youtube-transcript-api](https://github.com/jdepoix/youtube-transcript-api) (MIT License, © Jonas Depoix). Playlist and channel listing uses [yt-dlp](https://github.com/yt-dlp/yt-dlp) (Unlicense) in flat mode only. No video or audio is downloaded.

### Support

Open an issue on the Actor's **Issues** tab with the run ID and a video URL, and it will be looked at.

# Actor input Schema

## `urls` (type: `array`):

Video (watch, youtu.be, shorts, live, embed), playlist, or channel (@handle, /channel/UC…, /c/…, /user/…) URLs, or bare 11-character video IDs. Channel URLs read the Videos tab unless you link /shorts or /streams.

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

Caption language codes in order of preference, such as en, es, de, pt-BR. The first one the video has is used.

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

When none of the preferred languages exist, return the video's own caption track instead of an error. The item is marked language_fallback = true.

## `preferManualCaptions` (type: `boolean`):

When a language has both uploaded and auto-generated captions, use the uploaded ones.

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

Add the segments array (start, duration, text) next to the plain-text transcript.

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

How many of the newest videos to take from each playlist or channel URL.

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

How many videos to fetch at once.

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

Extra attempts, each through a new proxy session, when YouTube rate-limits or blocks a request.

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

Apify Proxy spreads requests over several IPs. Retries alternate between a new proxy session and the run's own IP. The default works for most runs.

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/jNQXAC9IVRw"
  ],
  "languages": [
    "en"
  ],
  "fallbackToAnyLanguage": true,
  "preferManualCaptions": true,
  "includeSegments": true,
  "maxVideosPerSource": 20,
  "concurrency": 3,
  "maxRetries": 6,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One dataset item per video, with the transcript text, segments, and metadata.

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

Counts of videos processed, transcripts returned, and errors.

# 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 = {
    "urls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "https://youtu.be/jNQXAC9IVRw"
    ],
    "languages": [
        "en"
    ],
    "maxVideosPerSource": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("cleandata-tools/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 = {
    "urls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "https://youtu.be/jNQXAC9IVRw",
    ],
    "languages": ["en"],
    "maxVideosPerSource": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("cleandata-tools/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 '{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/jNQXAC9IVRw"
  ],
  "languages": [
    "en"
  ],
  "maxVideosPerSource": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call cleandata-tools/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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