# YouTube Transcript Scraper - Videos, Playlists & Channels (`anticipatory_pipefish/youtube-transcript-scraper`) Actor

Get the transcript of any YouTube video, playlist or channel as clean text, timestamped segments, SRT or VTT. Language priority, translation, manual or auto captions. Pay only for transcripts actually fetched.

- **URL**: https://apify.com/anticipatory_pipefish/youtube-transcript-scraper.md
- **Developed by:** [Pipefish Data](https://apify.com/anticipatory_pipefish) (community)
- **Categories:** Videos, AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 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

Paste YouTube links, get transcripts back. Works with single videos, Shorts, playlists and whole channels. Each result has the plain text, the timestamped segments, and optionally SRT or WebVTT subtitles, plus which languages were available.

No browser, no speech-to-text, no login. It reads the caption tracks YouTube already has, so a transcript takes about a second.

### What you get

One row per video:

| Field | Example |
|---|---|
| `videoId`, `url` | `dQw4w9WgXcQ`, `https://www.youtube.com/watch?v=dQw4w9WgXcQ` |
| `status` | `ok`, or `error` with `errorType` and `error` |
| `languageCode`, `language`, `isGenerated` | `en`, `English`, `false` (manual captions) |
| `text` | the whole transcript as one clean string, ready for an LLM |
| `segments` | `[{"text": "We're no strangers to love", "start": 18.64, "duration": 3.24}, ...]` |
| `srt`, `vtt` | subtitle files as strings, when requested |
| `wordCount`, `segmentCount`, `transcriptDurationSeconds` | `487`, `61`, `211.32` |
| `availableTranscripts` | every caption track on the video, with language and whether it is auto-generated or translatable |
| `title`, `channel`, `durationSeconds`, `viewCount` | filled for videos found through a playlist or channel; `includeMetadata` adds them for every video, plus like count, upload date, description, thumbnail and tags |

Videos without captions are reported with `errorType: transcripts_disabled`. Videos with captions in other languages only are reported with `no_transcript_in_requested_languages` and the list of what is available, so you can re-run with the right code or use `translateTo`.

### Input

| Field | Default | What it does |
|---|---|---|
| `videoUrls` | required | Video, Shorts, youtu.be, embed, playlist or channel URLs. Channels and playlists are expanded, newest first. |
| `videoIds` | | Plain 11-character IDs, if you already have them. |
| `languages` | `["en"]` | Priority list of ISO 639-1 codes. First match wins. |
| `transcriptType` | `any` | `any` prefers manual captions and falls back to auto-generated; `manual` or `generated` restrict to one type. |
| `translateTo` | | Translate with YouTube's own translation, for example `de`, `th`, `ja`. |
| `outputFormats` | `[]` | Add `srt` and/or `vtt`. |
| `includeMetadata` | `false` | Title, channel, counts, upload date, description, thumbnail, tags. One extra request per video. |
| `listOnly` | `false` | Only report which transcripts exist. Free. |
| `maxVideosPerCollection` | 50 | Cap per playlist or channel. |
| `concurrency` | 5 | Parallel videos. Lower it if YouTube starts blocking. |
| `proxyConfiguration` | Apify Proxy on | On by default; YouTube blocks the platform's direct IPs. Change groups or add your own proxies only if you see `request_blocked` or `ip_blocked`. |

Example input:

```json
{
  "videoUrls": [
    { "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" },
    { "url": "https://www.youtube.com/@apify" }
  ],
  "languages": ["en", "en-GB"],
  "outputFormats": ["srt"],
  "maxVideosPerCollection": 20
}
```

### Pricing

You pay per transcript fetched. Listing playlists and channels is free. Videos that fail or have no captions are free. `listOnly` runs are free.

### Typical uses

- Feed a channel's back catalogue into a RAG pipeline or a summariser.
- Turn videos into blog posts, show notes, chapter lists or quote banks.
- Monitor competitors' videos for keywords.
- Build subtitle files for re-upload or translation review.
- Research: pull every talk from a conference playlist as text.

### Limitations

- Only public caption tracks are read. Private, members-only and age-restricted videos fail with a clear `errorType`.
- Auto-generated captions are what YouTube produced; the Actor does not correct them.
- YouTube rate-limits some IPs. The Actor runs through Apify Proxy by default and retries each video once on a fresh proxy session if it is blocked.
- Channel listing uses the channel's Videos tab (uploads). Shorts-only or live-only channels may list fewer items.

### Support

Open an issue on the Actor's Issues tab with the video URL and the `errorType` you got.

# Actor input Schema

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

Any YouTube link works: watch URLs, youtu.be short links, Shorts, embeds, playlist URLs and channel URLs (@handle, /channel/, /c/, /user/). Playlists and channels are expanded to their videos, newest first.

## `videoIds` (type: `array`):

Optional. Plain 11-character video IDs, if you already have them.

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

ISO 639-1 codes in priority order. The first available transcript in this order is returned. Example: \["en", "en-GB", "de"].

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

any returns a manual transcript when one exists, otherwise the auto-generated one. manual and generated restrict to that type only.

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

Optional ISO 639-1 code. Uses YouTube's own translation of the transcript, for example de, fr, th, ja.

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

Plain text and timestamped segments are always included. Add srt and/or vtt to also get subtitle files as strings.

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

Adds title, channel, duration, view and like counts, upload date, description, thumbnail and tags. Costs one extra request per video and is slower; off by default.

## `listOnly` (type: `boolean`):

Do not fetch any transcript, only report which languages are available for each video. Free of charge.

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

Keep <i> and <b> tags from the captions in the text.

## `maxVideosPerCollection` (type: `integer`):

Cap on how many videos to take from each playlist or channel URL.

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

How many videos to process at the same time. Lower it if YouTube starts blocking.

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

Apify Proxy is on by default because YouTube blocks the platform's direct IPs. Leave it on. Switch groups or add your own proxies only if you see request_blocked or ip_blocked errors.

## Actor input object example

```json
{
  "videoUrls": [
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    },
    {
      "url": "https://youtu.be/jNQXAC9IVRw"
    }
  ],
  "videoIds": [],
  "languages": [
    "en"
  ],
  "transcriptType": "any",
  "translateTo": "",
  "outputFormats": [],
  "includeMetadata": false,
  "listOnly": false,
  "preserveFormatting": false,
  "maxVideosPerCollection": 50,
  "concurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

No description

## `datasetUi` (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 = {
    "videoUrls": [
        {
            "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
        },
        {
            "url": "https://youtu.be/jNQXAC9IVRw"
        }
    ],
    "videoIds": [],
    "translateTo": "",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("anticipatory_pipefish/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 = {
    "videoUrls": [
        { "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ" },
        { "url": "https://youtu.be/jNQXAC9IVRw" },
    ],
    "videoIds": [],
    "translateTo": "",
    "proxyConfiguration": { "useApifyProxy": True },
}

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

```

## MCP server setup

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