# YouTube Transcript Extractor (`lsso/youtube-transcript-extractor`) Actor

YouTube transcripts from videos, playlists, channels or a search, in any language: text, SRT, VTT, JSON, RAG-ready chunks and chapters. Auto-translation, free language check, failed videos are free.

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

## Pricing

from $2.00 / 1,000 transcript returneds

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 Extractor: videos, playlists and channels → text, SRT, VTT, JSON

**Get the full transcript of any YouTube video in seconds, in the language you need.** Paste video links, a playlist or a whole channel. No API key, no login, no browser. Built for AI pipelines, content teams and researchers.

- ✅ **Videos, Shorts, playlists, channels and YouTube search** in one input: type `andrej karpathy llm` and get the top videos' transcripts, no URL collecting
- ✅ **Any language**: picks human-made captions first, falls back to auto-generated, and **translates** when the language you want is missing (100+ languages, timestamps kept; Simplified and Traditional Chinese handled separately)
- ✅ **8 output formats**: plain text, timestamped lines, readable paragraphs, timed JSON segments, **SRT**, **WebVTT**, **RAG-ready chunks** (with start/end time and a deep link to the second) and **text per chapter**
- ✅ **Video metadata** included: title, channel, publish date, duration, views, category, description, keywords, thumbnail, chapters
- ✅ **Free language check**: list every video's caption tracks before you pay for a big run
- ✅ **Never an empty row without a reason**: every item has a `status` (`OK`, `NO_CAPTIONS`, `LOGIN_REQUIRED`, `BLOCKED`…). Residential proxies + four YouTube clients + automatic retries
- ✅ **$2 per 1,000 transcripts, failures are free**: no start fee, you pay only for transcripts actually returned

***

### 🚀 Quick start

1. Paste one or more URLs into **YouTube videos, playlists or channels**: `https://www.youtube.com/watch?v=…`, `https://youtu.be/…`, `…/shorts/…`, `…/playlist?list=…`, `https://www.youtube.com/@handle`.
2. (Optional) Set **Preferred languages**, e.g. `en` or `ko, en`.
3. Pick **Output formats**, then click **Start**. Results appear in the **Output** tab and can be downloaded as JSON, CSV or Excel.

### ⬇️ Input example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/playlist?list=PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI",
    "https://www.youtube.com/@veritasium"
  ],
  "searchQueries": ["andrej karpathy llm"],
  "maxResultsPerSearch": 10,
  "languages": ["en"],
  "outputFormats": ["text", "srt", "chunks"],
  "maxVideos": 100
}
```

### ⬆️ Output example (one dataset item per video)

```json
{
  "videoId": "dQw4w9WgXcQ",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video)",
  "channel": "Rick Astley",
  "durationSeconds": 213,
  "viewCount": 1650000000,
  "thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
  "hasTranscript": true,
  "language": "en",
  "captionType": "manual",
  "translated": false,
  "availableLanguages": ["en", "en (auto)", "de-DE", "ja", "pt-BR", "es-419"],
  "wordCount": 371,
  "transcript": "We're no strangers to love. You know the rules and so do I…",
  "segments": [{ "start": 18.6, "duration": 3.2, "text": "We're no strangers to love" }],
  "srt": "1\n00:00:18,600 --> 00:00:21,800\nWe're no strangers to love\n…"
}
```

| Field | Meaning |
|---|---|
| `transcript` | Plain text, one string |
| `transcriptTimestamped` | `[mm:ss] text` lines, ideal for quoting |
| `paragraphs` | ~1-minute paragraphs with start/end times, ideal for LLM summarisation |
| `segments` | Timed cues `{start, duration, text}` |
| `srt` / `vtt` | Subtitle files, ready to save |
| `chunks` | RAG-ready pieces of ~300 words (`chunkWords`): `{id, start, end, words, text, url}`; `url` jumps to that second |
| `chapters` | The video's chapters (from its description); with the `chapters` format each chapter also carries its transcript text |
| `publishedAt` / `category` | Upload date and YouTube category |
| `status` | `OK`, or why there is no transcript (see below) |
| `captionType` | `manual` (uploaded by the creator) or `auto` (speech recognition) |
| `translated` | `true` when the captions were translated into your preferred language |
| `translationEngine` | `youtube` or `google-translate`: which service produced the translation |
| `languageFallback` | `true` when none of your languages was available and the original language was returned |
| `error` / `errorCode` | Human-readable reason and code when there is no transcript |

**Status codes** (never charged): `NO_CAPTIONS` (the video has no subtitles at all), `ONLY_AUTO_CAPTIONS` (you turned auto-captions off), `LOGIN_REQUIRED` (private or age-restricted), `UNAVAILABLE` (deleted or region-locked), `BLOCKED` (YouTube kept refusing after all retries; re-run later), `POT_REQUIRED`, `UNKNOWN`.

### 💵 Pricing

| Event | Price |
|---|---|
| Transcript returned | **$0.002** (that is **$2 per 1,000 videos**) |

No start fee. Videos without captions, private, unavailable or blocked videos are **not charged**. Playlist, channel and search expansion is free, and *Only list available caption languages* runs are free.

### 🧠 How languages are chosen

1. A caption track in one of your **preferred languages** (human-made first, unless *Prefer human-made captions* is off).
2. Otherwise, if **Translate** is on, the best available track translated into your first preferred language.
3. Otherwise the video's original captions, flagged with `languageFallback: true`.

Turn **Allow auto-generated captions** off to accept only creator-uploaded subtitles.

**About translation:** YouTube's own caption translation is now rate-limited for almost every IP (a YouTube-side limit, also reported by yt-dlp users). The Actor tries it once; if YouTube refuses, it downloads the original captions and translates them line by line with Google Translate, keeping every timestamp, so SRT/VTT stay in sync. `translationEngine` tells you which one was used. Only if both fail do you get the original-language transcript with `languageFallback: true` and a `translationError` note.

### 🧩 Use cases for AI workflows

- **Summaries and chapters**: feed `paragraphs` to any LLM; each paragraph carries timestamps for citations.
- **RAG / knowledge bases**: turn on `chunks` and load them straight into a vector DB; each chunk has an `id`, timestamps and a `url` that opens the video at that second.
- **"Distill" an expert**: search their name or paste their channel, get every talk as text, then let an LLM build notes, a course outline or a custom GPT/Skill from it.
- **Content repurposing**: turn talks and podcasts into blog posts, newsletters and social posts.
- **Research and monitoring**: schedule the Actor on a channel URL to collect every new video's transcript automatically.

Call it from Python, JavaScript, LangChain, n8n, Make or Zapier through the Apify API.

### 🤖 Use it from AI agents (MCP): Claude, Cursor & any MCP client

This Actor works as a ready-made **connector for AI assistants**. Add one URL and your agent can call it on its own:

```
https://mcp.apify.com?tools=lsso/youtube-transcript-extractor
```

- **Claude** (claude.ai / Claude Desktop): *Settings → Connectors → Add custom connector*, paste the URL above, sign in to Apify.
- **Cursor / VS Code / any MCP client**: add it to your MCP config:

```json
{ "mcpServers": { "youtube-transcripts": { "url": "https://mcp.apify.com?tools=lsso/youtube-transcript-extractor" } } }
```

- **Claude Code**: `claude mcp add --transport http youtube-transcripts "https://mcp.apify.com?tools=lsso/youtube-transcript-extractor"`

Sign-in uses Apify OAuth in the browser, so you never paste a token into the config. Then just ask:

> *"Summarize this video in 5 bullet points with timestamps: https://youtu.be/…"*

> *"Get the transcripts of the last 10 videos on @channel and list the topics they cover."*

> *"Translate the captions of this video to Korean and give me an SRT file."*

Transcripts come back as clean `paragraphs` with timestamps, so the agent can quote and cite the exact second. You pay only for results, same as a normal run.

### ❓ FAQ

**Does it work on videos without subtitles?**
It returns whatever YouTube has: creator subtitles or auto-generated captions (most spoken-word videos have them). Videos with neither are reported with `hasTranscript: false` and are free.

**Why residential proxies?**
YouTube blocks most datacenter IPs with a "confirm you're not a bot" check. The Actor uses Apify residential proxies by default; traffic is tiny (about 0.3 MB per video), so this costs a fraction of a cent.

**Is it legal?**
The Actor reads publicly available caption data that YouTube serves to any viewer. It collects no personal data. Respect the copyright of the content you process.

**Some videos come back with `languageFallback: true`.**
Either no preferred language exists and *Translate* is off, or both YouTube and the Google Translate fallback refused the translation. The original captions are returned instead; re-run those videos later.

**What do I pay if a video fails?**
Nothing. Only items with `status: "OK"` and a transcript are charged. Check `status` / `errorCode` for the reason.

**How do I check which languages exist before a big run?**
Turn on *Only list available caption languages*. It returns every caption track (language, human or auto, translatable) for free.

**Can I get channel videos older than the latest few hundred?**
Yes, raise **Max videos**; the channel's Videos tab is paged until the limit is reached.

### 📝 Changelog

- **1.2**: YouTube search as input; RAG-ready `chunks` with deep links; chapters (and text per chapter); publish date and category; free *list languages* mode; a `status` code on every item; price cut to $2 per 1,000 with no start fee.
- **1.1**: Translation no longer depends on YouTube's rate-limited translator: automatic Google Translate fallback with timestamps kept, new `translationEngine` field; `zh-Hans` and `zh-Hant` are never mixed up.
- **1.0**: First release: videos, Shorts, playlists, channels; language preference + translation; text, timestamped, paragraphs, segments, SRT, VTT; metadata; residential proxy with multi-client retries.

# Actor input Schema

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

Video URLs (watch, youtu.be, shorts, live), video IDs, playlist URLs, or channel URLs / @handles. Playlists and channels are expanded automatically (newest first for channels). Optional if you use *Search YouTube*.

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

Search terms, e.g. `andrej karpathy llm`. The top videos for each search are added to the run (relevance order), so you don't need to collect URLs first.

## `maxResultsPerSearch` (type: `integer`):

How many videos to take from each search.

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

Language codes in order of preference, e.g. `en`, `es`, `ko`, `ja`, `zh-Hans` (Simplified Chinese), `zh-Hant` (Traditional), `pt-BR`. If the video has no captions in these languages and *Translate* is on, the transcript is translated into the first one. Leave empty to get the video's original language.

## `translate` (type: `boolean`):

When none of the preferred languages exists for a video, translate the captions into the first preferred language (~100 languages). YouTube's own translation is tried first; when YouTube rate-limits it (common), the original captions are translated with Google Translate, keeping every timestamp. The output field `translationEngine` says which one was used.

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

Which fields to include per video: `text` (plain transcript), `segments` (timed cues as JSON), `timestamped` (`[mm:ss] text` lines), `paragraphs` (readable ~1-minute paragraphs), `srt`, `vtt`, `chunks` (RAG-ready ~300-word pieces with start/end time and a deep link), `chapters` (transcript split by the video's chapters, when the description has them).

## `chunkWords` (type: `integer`):

Target size of each item in `chunks` (CJK characters count as words). Chunks end at caption boundaries.

## `listLanguagesOnly` (type: `boolean`):

Don't download transcripts; just return each video's caption tracks (language, human/auto, translatable) and metadata. Not charged — use it to check what exists before a big run.

## `preferManual` (type: `boolean`):

When both human-uploaded and auto-generated captions exist, pick the human-made ones.

## `includeAutoGenerated` (type: `boolean`):

Turn off to return only human-made captions (videos with auto-captions only will be reported as having no transcript).

## `maxVideos` (type: `integer`):

Upper limit of videos processed in this run (applies after expanding playlists and channels).

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

How many videos to process in parallel.

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

Each retry uses a fresh proxy session and a different YouTube client.

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

YouTube blocks datacenter IPs, so Apify residential proxies are used by default. Proxy traffic is tiny (about 0.3 MB per video).

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "searchQueries": [],
  "maxResultsPerSearch": 20,
  "languages": [
    "en"
  ],
  "translate": true,
  "outputFormats": [
    "text",
    "segments"
  ],
  "chunkWords": 300,
  "listLanguagesOnly": false,
  "preferManual": true,
  "includeAutoGenerated": true,
  "maxVideos": 50,
  "concurrency": 5,
  "maxRetries": 4,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

No description

## `summary` (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": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "https://www.youtube.com/watch?v=jNQXAC9IVRw"
    ],
    "languages": [
        "en"
    ],
    "outputFormats": [
        "text",
        "segments"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("lsso/youtube-transcript-extractor").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": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
        "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    ],
    "languages": ["en"],
    "outputFormats": [
        "text",
        "segments",
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("lsso/youtube-transcript-extractor").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": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "languages": [
    "en"
  ],
  "outputFormats": [
    "text",
    "segments"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call lsso/youtube-transcript-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lsso/youtube-transcript-extractor"
        }
    }
}
```

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/sAAg0YmkqGnRElrdV/builds/Cxt4I8bLbTK7REE4X/openapi.json
