# YouTube Transcript for LLM & RAG (Multilingual) (`henrycrawl/youtube-transcript-llm`) Actor

Get YouTube transcripts in any language from videos, Shorts, channels and playlists. Manual captions first, auto-captions as fallback, timestamps, and ready-made RAG chunks with title, channel, duration and publish date. Pay only for transcripts delivered.

- **URL**: https://apify.com/henrycrawl/youtube-transcript-llm.md
- **Developed by:** [Henry Crawl](https://apify.com/henrycrawl) (community)
- **Categories:** AI, Videos, Developer tools
- **Features:** Limited permissions
- **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 for LLM & RAG (Multilingual)

Get **clean YouTube transcripts in any language**, with **timestamps**, **video metadata** and **ready-made RAG chunks**, from single videos, Shorts, playlists or whole channels. You only pay for transcripts that are actually delivered.

### What does it do?

Paste YouTube links and you get back one row per video with:

- **Transcript text**: human-made captions first, auto-generated captions as fallback.
- **Language detection that gets dubbed videos right**: by default you get the video's *original spoken language*, even when YouTube has added AI-dubbed audio tracks.
- **Timestamped segments** (`start`, `duration`, `text`) and an optional **.srt** file.
- **LLM / RAG chunks**: you set the token size and overlap. Chunks never cut a caption line in half. Every chunk keeps its start/end time and a deep link (`...&t=754s`), so your chatbot can cite the exact moment.
- **Metadata**: title, channel name and ID, duration, publish date, view count, category, thumbnail, keywords, and the description (optional).
- **Every available caption language** for the video, so you know what else you can request.

### Why this Actor?

| | This Actor |
|---|---|
| Inputs per run | Any mix of videos, Shorts, youtu.be, live replays, playlists, channels (`@handle`, `/channel/ID`, `/c/`, `/user/`) and bare video IDs |
| Languages | Original language by default, or your preference list (`["en","es"]`). `es` also matches `es-419`. Optional YouTube machine translation. |
| RAG-ready | Token-sized chunks with overlap, timestamps and deep links. A "one row per chunk" mode loads straight into Pinecone, Qdrant, Weaviate, pgvector, LangChain or LlamaIndex. |
| Fair billing | Charged **only for successful transcripts**. Videos without captions, private videos and invalid URLs still return a row explaining why, free of charge. |
| Polite and stable | Low default concurrency, exponential back-off, and Apify Proxy included. No login and no cookies. |

### Input example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/sd6OLoQW0hY",
    "https://www.youtube.com/shorts/E_F-FjJvxHo",
    "https://www.youtube.com/playlist?list=PLovlAKbQVz6Bnt8Lov66TRVVhjvJMeps6",
    "@mkbhd"
  ],
  "languages": [],
  "chunkSizeTokens": 500,
  "chunkOverlapTokens": 50,
  "maxVideosPerSource": 20
}
```

Main options:

| Field | Default | What it does |
|---|---|---|
| `urls` | – | Videos, Shorts, playlists, channels or video IDs |
| `languages` | `[]` (original language) | Preferred caption languages, in order |
| `preferManualCaptions` | `true` | Use creator captions before auto-generated ones |
| `allowAutoGenerated` | `true` | Turn off to accept only human-made captions |
| `translateIfMissing` | `false` | Use YouTube machine translation when no preferred language exists (best effort, see Limits) |
| `outputFormat` | `video` | `video` = one row per video. `chunks` = one row per chunk. |
| `chunkSizeTokens` / `chunkOverlapTokens` | `500` / `50` | Chunk size and overlap |
| `includeSegments` / `includeSrt` / `includeDescription` | `true` / `false` / `false` | Extra fields to include |
| `maxVideosPerSource` | `20` | Videos per channel or playlist; for channels, newest first |
| `channelTab` | `videos` | `videos`, `shorts` or `streams` |

### Output example (one row per video, shortened)

```json
{
  "status": "OK",
  "videoId": "sd6OLoQW0hY",
  "url": "https://www.youtube.com/watch?v=sd6OLoQW0hY",
  "title": "Life balance: Yoshie Komuro at TEDxTokyo",
  "channelName": "TEDx Talks",
  "durationSeconds": 734,
  "publishDate": "2012-06-29T23:52:08-07:00",
  "originalLanguage": "ja",
  "language": "ja",
  "captionType": "manual",
  "availableLanguages": [{"code": "en", "name": "English", "isAutoGenerated": false}, {"code": "ja", "name": "Japanese", "isAutoGenerated": false}],
  "transcriptText": "皆さん こんにちは ...",
  "tokenEstimate": 4410,
  "segments": [{"start": 4.2, "duration": 3.1, "text": "皆さん こんにちは"}],
  "chunks": [
    {
      "chunkIndex": 0,
      "startSeconds": 4.2,
      "endSeconds": 95.8,
      "startTimestamp": "00:00:04",
      "endTimestamp": "00:01:35",
      "url": "https://www.youtube.com/watch?v=sd6OLoQW0hY&t=4s",
      "text": "...",
      "tokenEstimate": 498
    }
  ]
}
```

In `chunks` mode, each row is one chunk and carries `videoId`, `videoUrl`, `title`, `channelName`, `publishDate`, `durationSeconds`, `language` and `captionType`, so it can be embedded directly.

#### Status codes (only `OK` is charged)

| Status | Meaning |
|---|---|
| `OK` | Transcript delivered |
| `NO_CAPTIONS` | The video has no captions at all |
| `LANGUAGE_NOT_AVAILABLE` | None of your languages exist; try `translateIfMissing` |
| `TRANSLATION_FAILED` | YouTube refused the machine translation; the original-language transcript is included free |
| `VIDEO_UNAVAILABLE` / `LOGIN_REQUIRED` | Deleted, private, members-only or age-restricted video |
| `LIVE_NOT_FINISHED` | Live stream still running or not started |
| `BOT_CHECK` / `RATE_LIMITED` | YouTube throttled the request even after retries; run it again later |
| `INVALID_URL` / `SOURCE_UNAVAILABLE` / `SOURCE_EMPTY` | Problem with the input link |

A run summary is saved as `SUMMARY` in the default key-value store.

### Pricing

Pay per event: **$3.00 per 1,000 transcripts** ($0.003 per video with status `OK`). Failed videos, chunk rows and metadata cost nothing extra.

### Use with AI agents (MCP)

The Actor works as a tool through the Apify MCP server, so Claude, Cursor, ChatGPT and other MCP clients can call it with a list of URLs and receive transcripts plus chunks ready for context.

### FAQ

**Does it need a YouTube account or API key?** No. It reads only public caption data, the same captions any viewer can switch on.

**Which language do I get by default?** The language spoken in the video. If the video has dubbed audio tracks, the original track wins. If you set `languages`, your list wins.

**Why is a video marked `NO_CAPTIONS`?** The creator disabled captions, and YouTube did not create auto-captions (common for music, very short or very new videos). You are not charged.

**How accurate is `tokenEstimate`?** Within about 10–15% of OpenAI and Claude tokenizers, for both Latin and CJK scripts. Use it to size chunks, not for billing.

**Can I get a whole channel?** Yes. Paste the channel link and set `maxVideosPerSource` (up to 5,000). Channels are read newest first.

### Limits

- Only videos that have captions (human-made or auto-generated) can be transcribed. There is no speech-to-text fallback.
- Machine translation (`translateIfMissing`) is best effort: YouTube heavily rate-limits it from cloud IPs, so expect some `TRANSLATION_FAILED` rows.
- Auto-generated captions reflect YouTube's speech recognition quality: missing punctuation and misheard names.
- For videos with no auto-captions, original-language detection falls back to YouTube's default caption track, which can be a translation. Set `languages` when this matters.
- Comments, likes and viewer data are not collected.

### Legal

The Actor collects only publicly available caption and video metadata, without logging in. You are responsible for using the transcripts in line with YouTube's Terms of Service, copyright law and applicable data protection law in your jurisdiction.

# Actor input Schema

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

Videos, Shorts, youtu.be links, live replays, playlists, channels (@handle, /channel/ID, /c/, /user/) or bare 11-character video IDs. Mix freely; duplicates are removed.

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

Language codes in order of preference, e.g. \["en", "es"]. "es" also matches regional tracks such as "es-419". Leave empty to get the video's ORIGINAL spoken language.

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

Use captions uploaded by the creator before YouTube's auto-generated ones when both exist in the chosen language.

## `allowAutoGenerated` (type: `boolean`):

If off, videos with only auto-generated (speech recognition) captions return status LANGUAGE_NOT_AVAILABLE / NO_CAPTIONS and are not charged.

## `translateIfMissing` (type: `boolean`):

If none of the preferred languages exist, return YouTube's own machine translation into the first preferred language (captionType = "translated").

## `outputFormat` (type: `string`):

"One row per video" keeps full text, segments and chunks together. "One row per chunk" gives flat rows ready to load into a vector database (each chunk carries the video metadata). Billing is per video in both modes.

## `chunkSizeTokens` (type: `integer`):

Approximate size of each RAG chunk. Chunks never split a caption line, so every chunk keeps an exact start/end timestamp and a deep link.

## `chunkOverlapTokens` (type: `integer`):

How much text consecutive chunks share, to keep context across boundaries. Capped at half the chunk size.

## `includeSegments` (type: `boolean`):

Add the raw caption lines (start, duration, text). Only for "One row per video".

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

Add the transcript as an .srt string. Only for "One row per video".

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

Add the full video description to the metadata.

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

Newest videos first for channels. Has no effect on single video URLs.

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

Which channel tab to read when a channel URL is given.

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

Videos processed in parallel. Keep it low to stay polite to YouTube; 3 is a good default.

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

Apify residential proxy is on by default (included in the price): YouTube blocks most cloud/datacenter IPs. You can switch to datacenter, but expect BOT_CHECK errors.

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "languages": [],
  "preferManualCaptions": true,
  "allowAutoGenerated": true,
  "translateIfMissing": false,
  "outputFormat": "video",
  "chunkSizeTokens": 500,
  "chunkOverlapTokens": 50,
  "includeSegments": true,
  "includeSrt": false,
  "includeDescription": false,
  "maxVideosPerSource": 20,
  "channelTab": "videos",
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Transcripts (or chunks / segments) and error rows.

## `summary` (type: `string`):

Counts per status for this run (SUMMARY record).

# 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=dQw4w9WgXcQ"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("henrycrawl/youtube-transcript-llm").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=dQw4w9WgXcQ"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

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

```

## MCP server setup

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

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/BEj1BZunpj4e0A0EQ/builds/NCr3VaxIb6UrBOyfw/openapi.json
