# YouTube Transcript & Subtitles: Video, Channel, Playlist (`yaroslav1/youtube-transcript-scraper`) Actor

Download YouTube transcripts in bulk: any video or Shorts, a playlist, a whole channel or search results. Video to text with timestamps, subtitles as SRT or VTT, original language or translated. Videos without captions are free.

- **URL**: https://apify.com/yaroslav1/youtube-transcript-scraper.md
- **Developed by:** [Data Robots](https://apify.com/yaroslav1) (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

from $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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 & Subtitles: Bulk, Channels, Search

Get the transcript of any public YouTube video, or of a whole channel, playlist or search, in one run. Each video becomes one row with the full text, timed segments and, if you want, ready SRT or WebVTT subtitles, in the original language or another language the video has.

- **Any input:** video, Shorts and live URLs, video IDs, playlists, channels (`@handle`, `/channel/UC…`, `/c/…`), YouTube search URLs or plain keywords.
- **Any format:** plain text, timed segments, text with `[1:15]` timestamps, SRT, WebVTT.
- **Languages:** the original language by default, or the languages you choose, including the AI translations YouTube has made for many videos.
- **Pay only for transcripts.** Videos without captions, private or deleted videos and other problems are listed as free rows that say why.

### What you get for every video

| Field | What it is |
|---|---|
| `text` | The whole transcript as plain text |
| `wordCount` | Number of words |
| `segments` | Every caption line with `start` and `duration` in seconds (on by default) |
| `timestampedText` | One line per caption, like `[1:15] text` (optional) |
| `srt`, `vtt` | Ready subtitle files as text (optional) |
| `language`, `languageName` | Language of the returned text |
| `isAutoGenerated` | `true` for YouTube's automatic captions, `false` for subtitles made by people |
| `isTranslated`, `translatedFrom` | `true` when the text is a machine translation, and from which language |
| `originalLanguage` | The language spoken in the video, when YouTube says it |
| `availableLanguages` | All caption languages of the video, e.g. `en`, `en (auto)`, `uk (auto-translated)` |
| `title`, `channelName`, `channelId`, `channelUrl` | Video and channel |
| `durationSeconds`, `viewCount`, `keywords`, `thumbnailUrl` | Video details |
| `description` | Video description (optional) |
| `source`, `sourceType` | The input line the video came from |

### Input example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=arj7oStGLkU",
    "https://www.youtube.com/@TED",
    "https://www.youtube.com/playlist?list=PLBCF2DAC6FFB574DE"
  ],
  "searchQueries": ["how to bake bread"],
  "maxVideosPerSource": 10,
  "language": "en"
}
```

- **Max videos per channel, playlist or search** limits each of those sources. Channels are read newest first. Video URLs are always processed.
- **Channel content** chooses the Videos tab (default), Shorts, past live streams or all uploads. A channel URL ending in `/shorts` or `/streams` overrides it.

### Output example

```json
{
  "recordType": "transcript",
  "videoId": "jNQXAC9IVRw",
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "title": "Me at the zoo",
  "channelName": "jawed",
  "channelId": "UC4QobU6STFB0P71PMvOGN5A",
  "language": "en",
  "languageName": "English",
  "isAutoGenerated": false,
  "isTranslated": false,
  "text": "All right, so here we are, in front of the elephants the cool thing about these guys is that they have really... really really long trunks and that's cool (baaaaaaaaaaahhh!!) and that's pretty much all there is to say",
  "wordCount": 39,
  "segments": [
    { "start": 1.2, "duration": 2.16, "text": "All right, so here we are, in front of the elephants" },
    { "start": 5.318, "duration": 2.656, "text": "the cool thing about these guys is that they have really..." }
  ],
  "durationSeconds": 19,
  "viewCount": 448000000,
  "thumbnailUrl": "https://i.ytimg.com/vi/jNQXAC9IVRw/hqdefault.jpg",
  "availableLanguages": ["en", "de"],
  "source": "https://youtu.be/jNQXAC9IVRw",
  "sourceType": "video"
}
```

Export the dataset as JSON, CSV, Excel or XML, or read it through the Apify API.

### Languages and translation

- **Language empty** (default): each video in its original language. Subtitles made by people are preferred over automatic captions; switch **Prefer human-made subtitles** off to get the automatic ones.
- **Language set**, e.g. `en` or `es, en`: the first language the video has. `es` also matches regional captions such as `es-419`.
- **Machine translation** decides what happens when a video has none of your languages:
  - **YouTube AI translations when they exist** (default): YouTube has made AI-translated captions for many videos. They are used and marked with `isTranslated: true` and `translatedFrom`.
  - **Also translate on request**: otherwise the Actor asks YouTube to translate. YouTube allows this only a few times per IP address, so expect many free rows with `errorType: "translation-limited"`.
  - **No machine translation**: only captions that exist in your language.
- A video without any of your languages comes back as a free row with `errorType: "language-unavailable"` and the list of its languages in `availableLanguages`.

### Rows without a transcript (free)

Every video that did not return a transcript is still listed, with `recordType: "error"` and an `errorType`:

| errorType | Meaning |
|---|---|
| `no-captions` | The video has no subtitles and no automatic captions |
| `unavailable` | Private, deleted, age-restricted, members-only or not available in the region |
| `language-unavailable` | None of your languages and no usable translation; `availableLanguages` lists what the video has |
| `translation-limited` | YouTube refused a translation on request; see above |
| `empty-captions` | The caption track exists but is empty |
| `blocked` | YouTube refused the requests from this IP address after several retries |
| `invalid-input`, `source-error` | An input line is not a YouTube URL, or a playlist, channel or search returned nothing |

The run's `SUMMARY` record in the key-value store counts transcripts and errors per source.

### Good to know

- The Actor reads captions that YouTube already has. It does not transcribe audio, so a video without any captions gives no transcript.
- Age-restricted, private and members-only videos need a signed-in account and are skipped. The Actor never logs in.
- YouTube asks cloud servers to sign in, so the Actor uses Apify Proxy by default, and its cost is included in the price per transcript. If many rows say `blocked`, run them again with the Residential proxy group.
- Transcripts belong to the video creators. Use them in line with YouTube's Terms of Service and copyright law, for example for research, accessibility, search or summaries, and ask the creator before republishing a full transcript.

# Actor input Schema

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

One per line: video, Shorts or live URLs (or 11-character video IDs), playlist URLs, channel URLs or @handles, and YouTube search-results URLs. Each channel, playlist or search adds up to <b>Max videos per channel, playlist or search</b> videos.

## `searchQueries` (type: `array`):

Optional. Each keyword runs a YouTube search (videos only) and adds the top results.

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

How many videos to take from each channel, playlist or search (newest first for channels). Video URLs are always processed.

## `channelTab` (type: `string`):

Which uploads to take from channel URLs. A channel URL that ends in <code>/shorts</code> or <code>/streams</code> overrides this.

## `language` (type: `string`):

Language code such as <code>en</code>, <code>es</code>, <code>de</code> or <code>pt-BR</code>. Several codes separated by commas are tried in order. Leave empty to get each video in its original language.

## `translation` (type: `string`):

What to do when a video has no captions in your language. <b>YouTube AI translations</b>: use the translated captions YouTube already made for many videos (reliable). <b>Also translate on request</b>: otherwise ask YouTube to translate, which it allows only a few times per IP address, so many videos may come back as free <code>translation-limited</code> rows. Translated text is marked with <code>isTranslated</code>.

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

When a language has both human-made subtitles and auto-generated captions, take the human-made ones. Turn off to prefer auto-generated captions.

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

Add <code>segments</code>: every caption line with its start time and duration in seconds.

## `includeTimestampedText` (type: `boolean`):

Add <code>timestampedText</code>: one line per caption, like <code>\[1:15] text</code>. Handy for AI tools and quotes.

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

Add <code>srt</code>: a ready SRT subtitle file as text.

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

Add <code>vtt</code>: a ready WebVTT subtitle file as text.

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

Add the video description.

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

YouTube asks cloud servers to sign in, so Apify Proxy is on by default; its cost is included in the price per transcript. If many rows say <code>blocked</code>, choose the Residential group.

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=arj7oStGLkU"
  ],
  "maxVideosPerSource": 20,
  "channelTab": "videos",
  "translation": "youtube",
  "preferManualCaptions": true,
  "includeTimestamps": true,
  "includeTimestampedText": false,
  "includeSrt": false,
  "includeVtt": false,
  "includeDescription": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All rows of this run 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 = {
    "urls": [
        "https://www.youtube.com/watch?v=arj7oStGLkU"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("yaroslav1/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=arj7oStGLkU"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("yaroslav1/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=arj7oStGLkU"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call yaroslav1/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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