# YouTube Transcript Scraper: Videos, Shorts, Channels (`chekitocantu/youtube-transcript-scraper`) Actor

Extract YouTube transcripts, subtitles and captions from videos, Shorts, playlists and entire channels. Get clean text, timestamped segments or SRT in any language, with auto-translation. Built for AI, RAG and content repurposing. Pay only for transcripts delivered.

- **URL**: https://apify.com/chekitocantu/youtube-transcript-scraper.md
- **Developed by:** [Sergio Cantu Salazar](https://apify.com/chekitocantu) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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

Get the transcript (subtitles) of any YouTube video as clean text, timestamped segments or an SRT file. Paste videos, Shorts, whole playlists or channels, choose your languages, and optionally translate everything into one language. You only pay for transcripts that are delivered: videos without captions cost nothing.

### What you can do with it

- **Feed AI tools and LLMs.** Turn videos into text for summaries, RAG pipelines, embeddings or fine-tuning datasets.
- **Repurpose content.** Get blog posts, newsletters, show notes and social posts out of your own videos.
- **Research and monitoring.** Search what a channel or a whole playlist says about a topic without watching hours of video.
- **Subtitles.** Download SRT files for editing, archiving or accessibility.
- **Multilingual work.** Get transcripts in Spanish, Portuguese, English or any language YouTube supports, or translate them.

### Features

- Works with **videos, Shorts, live replays, playlists and channels** (newest videos first). Plain video IDs also work.
- **Language preferences in order**, for example `["es", "en"]`. `es` also matches regional variants such as `es-419` and `es-ES`.
- **Human-made captions first**, auto-generated captions only when there is nothing better.
- **Translation** into any language YouTube supports, using YouTube's own translation.
- **Three output formats at once:** plain text, segments with start time and duration, and SRT.
- **Video details included:** title, channel name and channel URL.
- **Clear errors:** every video that has no transcript still appears in the results with the reason (no captions, unavailable, blocked), so nothing silently disappears.
- **Light and fast:** it calls YouTube's player API directly instead of loading full web pages.

### Input

| Field | What it does | Default |
|---|---|---|
| `startUrls` | Video, Shorts, playlist or channel URLs (or video IDs) | required |
| `languages` | Preferred language codes, in order | `["en"]` |
| `fallbackToAnyLanguage` | If no preferred language exists, return any available transcript | `true` |
| `translateTo` | Translate every transcript into this language code | empty |
| `includeTimestamps` | Add timestamped segments | `true` |
| `includeSrt` | Add an SRT subtitle file | `false` |
| `maxVideosPerSource` | Videos taken from each playlist or channel | `50` |
| `maxTranscripts` | Stop after this many videos in total (0 = no limit) | `0` |
| `maxConcurrency` | Videos processed at the same time | `3` |
| `residentialFallback` | Retry blocked videos through residential IPs | `true` |
| `proxyConfiguration` | Proxy for the first attempt | Apify Proxy |

Example:

```json
{
  "startUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/@veritasium",
    "https://www.youtube.com/playlist?list=PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI"
  ],
  "languages": ["es", "en"],
  "translateTo": "es",
  "maxVideosPerSource": 20
}
```

### Output

One item per video:

```json
{
  "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",
  "channelUrl": "https://www.youtube.com/@RickAstleyYT",
  "languageCode": "es-419",
  "language": "Spanish (Latin America)",
  "isAutoGenerated": false,
  "translatedTo": null,
  "availableLanguages": ["de-DE", "en", "es-419", "ja", "pt-BR"],
  "wordCount": 308,
  "durationSeconds": 211,
  "text": "Conocemos bien el amor Tú conoces las reglas, igual que yo ...",
  "segments": [
    { "start": 18.64, "duration": 3.24, "text": "Conocemos bien el amor" }
  ],
  "status": "ok"
}
```

Videos without a transcript come back with `"status": "error"` and an `error` message, and they are not charged.

You can export the results as JSON, CSV, Excel or HTML, or read them through the Apify API.

### Pricing

Pay per transcript delivered. Failed videos, videos without captions and playlist or channel listings are free. You can set a maximum cost per run in the run options and the Actor stops when it reaches it.

### Tips

- Blocked videos are retried through residential IPs automatically. If some still fail, lower **Parallel requests** or choose the **RESIDENTIAL** group under **Proxy**.
- To get every video of a channel, raise **Max videos per playlist or channel**.
- To get Shorts from a channel, use its Shorts tab URL, such as `https://www.youtube.com/@channel/shorts`.

### FAQ

**Does it work for videos without captions?** No. It reads the captions YouTube already has, either uploaded by the creator or auto-generated. Most videos with speech have auto-generated captions.

**Is it legal?** It only reads publicly available captions and does not log in to any account. Make sure your use of the data follows YouTube's terms and the laws that apply to you.

**Can I call it from my code?** Yes. Use the Apify API or the Apify clients for JavaScript and Python with the same input as above.

# Actor input Schema

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

Videos, Shorts, playlists or channels. Video IDs also work. Playlists and channels are expanded into their videos.

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

Language codes in order of preference, such as en, es or pt. 'es' also matches regional variants like es-419 and es-ES. Human-made captions win over auto-generated ones in the same language.

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

If none of the preferred languages exist, return whatever transcript the video has instead of an error.

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

Optional language code (for example en or es). Transcripts in other languages are translated with YouTube's own translation.

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

Add a list of segments with start time and duration in seconds.

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

Add the transcript as an SRT subtitle file in the 'srt' field.

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

How many videos to take from each playlist or channel (newest first for channels).

## `maxTranscripts` (type: `integer`):

Stop after this many videos. 0 means no limit.

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

How many videos to process at the same time.

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

Start with the regular Apify Proxy and retry blocked videos through residential IPs. Keeps runs reliable without paying residential traffic for every video.

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

Proxy for the first attempt at each video. Leave the default; blocked videos are retried through residential IPs automatically.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "languages": [
    "en"
  ],
  "fallbackToAnyLanguage": true,
  "includeTimestamps": true,
  "includeSrt": false,
  "maxVideosPerSource": 50,
  "maxTranscripts": 0,
  "maxConcurrency": 3,
  "residentialFallback": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All transcripts in a table view (title, channel, language, word count, status and text).

## `fullResults` (type: `string`):

Every field, including timestamped segments and SRT when enabled.

# 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("chekitocantu/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("chekitocantu/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 chekitocantu/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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