# YouTube Transcript Scraper (`clearpipe/youtube-transcript-scraper`) Actor

Get YouTube transcripts and captions for videos, Shorts, playlists and whole channels. Timestamps, plain text, SRT, any language or auto-translated. Clear error codes, no silent failures.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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

Retrieve available public YouTube captions from videos, Shorts, playlists or channels, subject to your input limits and source availability. Output includes full text, timestamped segments, and optional SRT subtitles. Select available caption languages or request YouTube's machine translation of captions when supported. Videos without retrievable captions cannot produce a transcript.

**Inspect results and errors together.** Expected source failures return error rows with a code. Spending limits can stop processing before every video is reached; unexpected errors, storage failures and interruptions can also leave incomplete output. Check the run status as well as the dataset.

### What you can do with it

- **Feed AI and RAG pipelines.** Turn a channel's back catalogue into transcript text for embeddings, summaries or a chatbot.
- **Research and monitoring.** Search available caption text for topics mentioned by a creator, competitor or brand.
- **Content repurposing.** Turn videos into blog posts, newsletters, show notes or quotes.
- **Subtitles.** Download SRT files for editing or translation.
- **Datasets.** Build transcript datasets for analysis using content you have the right to use.

### Input

Paste any mix of these into **YouTube URLs**:

| You paste | You get |
|---|---|
| `https://www.youtube.com/watch?v=dQw4w9WgXcQ` | that video |
| `https://youtu.be/dQw4w9WgXcQ` or a bare ID `dQw4w9WgXcQ` | that video |
| `https://www.youtube.com/shorts/...` | that Short |
| `https://www.youtube.com/playlist?list=...` | every video in the playlist (up to your limit) |
| `https://www.youtube.com/@handle` or `/channel/UC...` | the channel's newest videos (up to your limit) |

Options:

- **Preferred languages**: language codes in order, for example `en, es`. Empty means English if the video has it, otherwise the video's main language.
- **Prefer human-made captions**: use creator-uploaded captions over auto-generated ones when both exist (on by default).
- **Translate to**: for example `en`, to get a YouTube-translated transcript of a foreign-language video.
- **Include timestamped segments** (on by default) and **Include SRT subtitles** (off by default).
- **Max videos per playlist or channel**: default 50.

Example input:

```json
{
  "startUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/@veritasium"
  ],
  "languages": ["en"],
  "maxVideosPerSource": 20,
  "includeSrt": true
}
```

### Output

One dataset row per saved result. Example successful row (language list and segments shortened):

```json
{
  "input": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "status": "ok",
  "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",
  "lengthSeconds": 213,
  "viewCount": 1825312539,
  "language": "en",
  "isAutoGenerated": false,
  "isTranslated": false,
  "availableLanguages": [
    {"language": "en", "name": "English", "isAutoGenerated": false},
    {"language": "en", "name": "English (auto-generated)", "isAutoGenerated": true},
    {"language": "de-DE", "name": "German (Germany)", "isAutoGenerated": false}
  ],
  "wordCount": 487,
  "text": "[♪♪♪] ♪ We're no strangers to love ♪ ♪ You know the rules and so do I ♪ ...",
  "segments": [
    {"start": 1.36, "duration": 1.68, "text": "[♪♪♪]"},
    {"start": 18.64, "duration": 3.24, "text": "♪ We're no strangers to love ♪"}
  ]
}
```

Download the results as JSON, CSV, Excel or XML, or read them through the Apify API. The **Transcripts** view in the Console shows the title, channel, language, word count and full text.

### Error codes

Processed videos with expected caption errors get an error row. Videos not reached before a budget stop or interruption may have no row.

| errorCode | Meaning |
|---|---|
| `NO_TRANSCRIPT` | The video has no captions at all. |
| `LANGUAGE_NOT_FOUND` | No captions in the languages you asked for. The error lists the languages that exist. |
| `VIDEO_UNAVAILABLE` | Private, deleted, age-restricted, or region-locked. |
| `BLOCKED` / `RATE_LIMITED` | YouTube refused the request after the available retry attempts. Proxy fallback depends on configuration and availability. |
| `NETWORK` | Connection failure after retries. |
| `INVALID_URL` / `SOURCE_UNRESOLVED` | The input wasn't a YouTube video, playlist or channel we could resolve. |

### Pricing

**Free during launch.** Apify platform usage still applies. The implemented paid event is one saved successful video transcript, regardless of its number of segments. Error rows do not trigger the transcript event fee; platform usage can still apply to failed attempts. Published pricing determines whether event fees apply. Check the Actor's current pricing before running it.

### Reliability

- Fetches YouTube's caption data without downloading the video; latency depends on the source and retry attempts.
- Residential proxy fallback is enabled by default and used when available. You can disable it with `residentialFallback: false`. Proxy usage may add platform cost.
- Runs many videos in parallel (8 by default, up to 20).

### FAQ

**Does it work for videos without captions?** No. It reads captions YouTube already has (creator-uploaded or auto-generated). Auto-generated captions may be available, but coverage varies by video and language. They can contain recognition errors and sound annotations. Videos without any are returned as `NO_TRANSCRIPT`.

**Can I use it from code, Make, Zapier or n8n?** Yes. Use the Apify API, the Python or JavaScript client, or any Apify integration.

**Is scraping transcripts legal?** This actor reads publicly available caption data. You are responsible for how you use the content, including copyright and YouTube's terms. Don't use it for personal data you have no right to process.

### Support

Open an issue on the actor's **Issues** tab. Include the run ID and a public sample URL to help reproduce the problem.

# Actor input Schema

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

Video, Shorts, playlist or channel URLs (or bare 11-character video IDs). Playlists and channels are expanded into their videos.

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

Language codes in order of preference, e.g. en, es, de. Leave empty for English if available, otherwise the video's main language.

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

Use creator-uploaded captions over auto-generated ones when both exist.

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

Optional language code (e.g. en). Uses YouTube's own caption translation.

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

Adds a segments array with start time, duration and text. Plain full text is always included.

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

Adds a ready-to-use SRT subtitle file as a string.

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

Newest videos first for channels.

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

How many videos to fetch at once. The default suits most runs.

## `residentialFallback` (type: `boolean`):

Keeps success rates high when YouTube blocks datacenter IPs.

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

Default Apify Proxy works for most runs.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "preferManualCaptions": true,
  "includeTimestamps": true,
  "includeSrt": false,
  "maxVideosPerSource": 50,
  "maxConcurrency": 8,
  "residentialFallback": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One row per video: full text, timestamped segments, metadata, or an error code.

## `transcriptsFull` (type: `string`):

No description

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

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

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

```

## MCP server setup

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