# YouTube Transcript API: Video Captions to Text & RAG Chunks (`plainprobe/youtube-transcript-ai`) Actor

Get the transcript of any YouTube video, playlist or channel as clean text, timestamped segments and LLM-ready RAG chunks. Input: video URLs or IDs. Output: one JSON row per video with text, segments, chunks, chapters, language and status. Failed videos are free.

- **URL**: https://apify.com/plainprobe/youtube-transcript-ai.md
- **Developed by:** [Plainprobe](https://apify.com/plainprobe) (community)
- **Categories:** Videos, AI, Social media
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 transcripts returned

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/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 API: Video Captions to Text & RAG Chunks

Get the transcript of any YouTube video, playlist, channel or search as clean text, timestamped segments and **ready-to-embed RAG chunks** (with chapter titles and a deep link to the exact second), plus the video's metadata. The right language is picked automatically, every video gets a clear status, and **videos without a transcript are free**.

### Example

**Input** (Input tab → JSON, or the API body):

```json
{"videos": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"], "preferredLanguages": ["en"]}
```

**Output**: one row per video (shortened, real run of 5 December 2026):

```json
{"videoId": "jNQXAC9IVRw", "status": "ok", "title": "Me at the zoo", "channelName": "jawed",
 "language": "en", "captionType": "manual", "durationSeconds": 19, "wordCount": 39,
 "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…",
 "chunks": [{"index": 0, "start": 1.2, "end": 3.36, "chapter": "Intro", "text": "All right, so here we are, in front of the elephants",
             "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw&t=1s"}],
 "chapters": [{"start": 0, "end": 5, "title": "Intro"}, {"start": 5, "end": 17, "title": "The cool thing"}]}
```

**[▶ Try it now with this input](https://console.apify.com/actors/H5JT4d492IGiruvQe/input)**: your first 100 transcripts are free.

**Ready-made inputs by use case** (also published as tasks of this Actor):

- *YouTube video to RAG chunks*: `{"videos": ["<video URL>"], "includeChunks": true, "chunkMaxChars": 1500}`
- *YouTube channel to RAG chunks* (latest videos of a channel): `{"videos": ["https://www.youtube.com/@3blue1brown"], "maxVideosPerSource": 3, "includeSegments": false}`
- *Subtitles file*: `{"videos": ["<video URL>"], "includeSrt": true, "includeVtt": true}`

> **Switching from johnvc/YoutubeTranscripts or starvibe/youtube-video-transcript?** Keep your input and your automation: `youtube_url`, `channel`, `channel_url`, `languages`, `language`, `max_videos` and `output_formats` are understood, and each record also carries their field names (`video_id`, `timestamped`, `non_timestamped`, `transcript_text`, `selected_language`…). Only the Actor ID changes in n8n, Make or your code.
>
> **Price:** **$2.00 per 1,000 transcripts** on the free plan (less on paid plans), failures free. johnvc/YoutubeTranscripts: $2.75; starvibe/youtube-video-transcript: $5.00 (public Store prices, 4 December 2026).
>
> **Launch offer:** your first 100 transcripts are free on every Apify account until 31 January 2027.

### What does YouTube Transcript for AI do?

- **One record per video**, always: `status` is `ok` or a precise reason (`no_captions`, `private`, `unavailable`, `age_restricted`, `members_only`, `language_unavailable`, `blocked`…). No silent failures, no empty runs.
- **The spoken language, not a random track.** Auto-dubbed videos list 20+ "auto-generated" tracks; this Actor reads the original audio track and returns the transcript in the language actually spoken, preferring captions uploaded by the creator.
- **Output made for LLMs**: plain `text`, `segments` (start, duration, text), `chunks` for retrieval (size you choose, never split across chapters, each with `start`, `end`, `chapter` and a `url` like `…watch?v=ID&t=754s` for citations), `chapters`, optional Markdown, SRT and WebVTT.
- **Metadata included at no extra cost**: title, channel, channel ID and URL, publish date, category, duration, views, keywords, description, thumbnail, available caption languages.
- **Bulk input**: video URLs or IDs (watch, youtu.be, Shorts, live, embed), playlists, channels (`/channel/UC…`, `@handle`), search URLs or plain search queries.

**Runs on Apify:** call it from the API or from an AI agent (MCP), schedule it, connect it to Make, Zapier or n8n, export JSON, CSV or Excel.

### How to use it (start in 30 seconds)

1. Click **Try for free**.
2. Keep the default input (two short videos) or paste your own video, playlist or channel URLs.
3. Click **Start**. Transcripts appear in the **Output** tab, one row per video.

### Use it from your code, an AI agent or a no-code tool

- **API**: `POST https://api.apify.com/v2/acts/plainprobe~youtube-transcript-ai/run-sync-get-dataset-items?token=<YOUR_TOKEN>` with the input as JSON body.
- **AI agents (MCP)**: add the Apify MCP server (`https://mcp.apify.com`) to Claude, Cursor or any MCP client; the Actor is callable as a tool.
- **No-code**: n8n, Make and Zapier have official Apify integrations (Run Actor, then Get dataset items).

### How it compares (measured on the same 50 videos, 4 December 2026)

| | This Actor | johnvc/YoutubeTranscripts (defaults) | starvibe/youtube-video-transcript |
|---|---|---|---|
| Transcripts returned | **41 / 50** (all that exist) | 19 / 50 (English only unless configured) | 40 / 50 |
| In the spoken language | **41 / 41** | 19 / 19 | 29 / 40 |
| Compute time per video | **0.6 s** | 1.4 s | 2.9 s |
| Price per 1,000 transcripts | **$2.00** | $2.75 | $5.00 |
| Metadata completeness | **91 %** | 71 % | 85 % |
| RAG chunks, chapters, deep links | **yes** | no | no |
| Playlists, channels, searches | **yes** | channels | no (1 video per run) |

Full method and per-video results: see the benchmark published with the source of this Actor. The other tools have strengths too: johnvc can translate transcripts, which this Actor does not.

### For AI agents (MCP)

- **Tool**: `plainprobe/youtube-transcript-ai` via the Apify MCP server (https://mcp.apify.com).
- **Minimal input**: `{"videos": ["https://www.youtube.com/watch?v=VIDEO_ID"]}`. Add `"preferredLanguages": ["en"]` to prefer a language; without it you get the spoken language.
- **Key output fields**: `status`, `error{code,message}`, `title`, `channelName`, `publishDate`, `durationSeconds`, `language`, `captionType` (`manual` or `auto`), `text`, `chunks[{start,end,chapter,text,url}]`.
- **Cost**: $0.002 per transcript returned. Videos without a transcript, private, removed or blocked videos are free.
- **Time**: 2 videos in about 10 s; 50 videos in about 30 s; 240 videos from a playlist and a channel in 160 s.

### When to use it

- Feed YouTube content to an LLM, a RAG index, a summariser or a search engine, with timestamps you can cite.
- Analyse a whole channel or playlist (topics, quotes, mentions of a brand or product).
- Produce subtitles files (SRT, VTT) or a readable Markdown version of talks, courses and interviews.

### When not to use it

- Videos with no captions at all: this Actor does not run speech recognition; those videos come back as `no_captions` (free).
- Translation: you get the languages that YouTube publishes for the video (`availableLanguages`), not machine translations.
- Downloading video or audio: not supported, and never done.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `videos` | array of strings | — | Video URLs or IDs, playlist URLs, channel URLs or `@handles`, search result URLs |
| `searchQueries` | array of strings | — | Optional searches; top results are transcribed |
| `maxVideosPerSource` | integer | 20 | Max videos taken from each playlist, channel or search (1–1,000; channels newest first) |
| `preferredLanguages` | array of strings | `[]` | Language codes in order of preference (`en`, `fr`, `pt-BR`…); empty = spoken language |
| `languageFallback` | boolean | true | If no preferred language exists, return the spoken-language transcript (`languageMatched: false`) |
| `preferAutoCaptions` | boolean | false | Prefer YouTube's automatic captions over uploaded ones |
| `includeChunks` / `chunkMaxChars` | boolean / integer | true / 1500 | RAG chunks and their maximum size in characters |
| `includeSegments` | boolean | true | Timestamped caption lines |
| `includeMarkdown`, `includeSrt`, `includeVtt` | boolean | false | Extra formats |
| `includeDescription`, `includePublishDate` | boolean | true | Full description; publish date and category |
| `cleanText` | boolean | true | Remove `[Music]`, `[Applause]`, `♪` |
| `maxConcurrency` | integer | 5 | Videos processed in parallel (1–20) |

Example: `{"videos": ["https://www.youtube.com/@veritasium"], "maxVideosPerSource": 10, "preferredLanguages": ["en"], "includeMarkdown": true}`

### Output (one record per video)

```json
{
  "videoId": "T-D1OfcDW1M", "url": "https://www.youtube.com/watch?v=T-D1OfcDW1M", "status": "ok", "error": null,
  "title": "What is Retrieval-Augmented Generation (RAG)?", "channelName": "IBM Technology", "publishDate": "2023-08-23T04:00:32-07:00",
  "durationSeconds": 395, "viewCount": 2138452, "language": "en", "languageName": "English", "originalLanguage": "en",
  "captionType": "manual", "languageMatched": true, "availableLanguages": [{"code": "en", "name": "English", "type": "manual"}],
  "chapters": [], "text": "Large language models. They are everywhere. …", "wordCount": 1062, "segmentCount": 92,
  "segments": [{"start": 0.06, "dur": 2.572, "text": "Large language models. They are everywhere."}],
  "chunks": [{"index": 0, "start": 0.06, "end": 85.26, "chapter": null, "text": "Large language models. …", "charCount": 1417, "url": "https://www.youtube.com/watch?v=T-D1OfcDW1M&t=0s"}],
  "source": {"type": "video", "input": "https://youtu.be/T-D1OfcDW1M", "position": null}
}
```

A failed video keeps the same shape with `status` and `error`, for example `{"status": "no_captions", "error": {"code": "NO_CAPTIONS", "message": "This video has no captions (neither uploaded nor automatic)."}}`.

### Statuses

| `status` | Meaning | Charged |
|---|---|---|
| `ok` | Transcript returned | yes |
| `no_captions` | The video has no caption track | no |
| `language_unavailable` | None of your languages exists and fallback is off | no |
| `private`, `unavailable`, `members_only`, `age_restricted`, `geo_restricted`, `not_yet_available` | YouTube does not show this video publicly | no |
| `blocked` | YouTube refused every attempt, even through proxies; retry later | no |
| `invalid_input`, `error` | Your value is not a YouTube URL, or an unexpected answer | no |

### How much does it cost to get YouTube transcripts?

**Launch offer:** the first 100 transcripts of each Apify account are free until 31 January 2027 (the count is kept in a small key-value store named `youtube-transcript-ai-launch-offer` in your own account; if the Actor cannot open it, the normal price applies).

Pay per event: **$0.002 per transcript returned** ($2 per 1,000), cheaper on higher Apify plans. Everything that fails is free. Platform costs are included. Set a maximum cost per run in Apify and the Actor stops cleanly when it is reached.

### How it works

For each video the Actor asks YouTube for the public player data (title, duration, caption tracks), picks the right track, then downloads only that caption file: no video or audio is downloaded and no account is used. Requests go direct first; if YouTube asks for a bot check, they are retried through Apify Proxy (datacenter, then residential).

### Limits and good practice

- Up to 5,000 entries per run and 1,000 videos per playlist, channel or search. For larger jobs, split into several runs.
- Age-restricted and members-only videos need a signed-in account, which this Actor never uses: they return a status, free.
- YouTube changes often. Failures are reported per video, never as a failed run; if something breaks, open an issue and it is fixed quickly.

### Legal and data

The Actor reads only public information that YouTube shows to any visitor (captions and metadata), without logging in and without downloading videos. Transcripts belong to their creators: you are responsible for how you use them (copyright, quotation rights, YouTube's terms). Nothing about you or your runs is kept outside your Apify account.

### FAQ

**Why is the transcript in another language than I asked?** None of your `preferredLanguages` exists for that video; you got the spoken language (`languageMatched: false`). Turn off `languageFallback` to get `language_unavailable` instead (free).

**Auto or manual captions?** `captionType` tells you. Uploaded (`manual`) captions are preferred by default because they are usually more accurate.

**Does it work for Shorts and live replays?** Yes, if they have captions. Upcoming lives and premieres return `not_yet_available`.

**Can I get only the text?** Turn off `includeSegments` and `includeChunks`; the output becomes small and fast to read.

**Something is wrong?** Open an issue on the Actor page with the video URL and the run ID.

### Switching from another Actor

Send the input you already use with johnvc/YoutubeTranscripts or starvibe/youtube-video-transcript: `youtube_url`, `channel`, `channel_url`, `languages`, `language`, `max_videos` and `output_formats` are understood, and each record also carries their field names (`video_id`, `timestamped`, `non_timestamped`, `transcript_text`, `selected_language`…). The field `outputFormat` (default `auto`) picks the compatible output from the field names you send; set it to `plainprobe` to get only our own fields.

Public reliability of those Actors (Apify API `publicActorRunStats30Days`, 4 December 2026, runs that failed, timed out or were aborted): johnvc/YoutubeTranscripts 0.2 % of 234,296 runs, starvibe/youtube-video-transcript 0.1 % of 347,240 runs.

### Like it?

If this Actor saves you time, a short rating on its **Reviews** tab helps other users find it. Something missing or wrong? Open an issue on the **Issues** tab: it is answered and fixed quickly.

### More from Plainprobe

Other tools by Plainprobe are listed on https://apify.com/plainprobe and documented at https://plainprobe.github.io.

# Actor input Schema

## `videos` (type: `array`):

One per line: video URLs or IDs (watch, youtu.be, Shorts, live), playlist URLs, channel URLs (/channel/UC…, /@handle) or search result URLs. Playlists and channels are expanded up to 'Max videos per playlist, channel or search'.

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

Optional. Each query is searched on YouTube (videos only) and the top results are transcribed.

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

Upper limit of videos taken from each playlist, channel or search (1 to 1,000). Channels are listed newest first.

## `preferredLanguages` (type: `array`):

Language codes in order of preference (en, fr, es, pt-BR…). Uploaded captions are preferred over automatic ones in the same language. Leave empty to get the video's original language.

## `languageFallback` (type: `boolean`):

If none of the preferred languages exists, return the original-language transcript (flagged languageMatched: false). Off: such videos get status language_unavailable and are not charged.

## `preferAutoCaptions` (type: `boolean`):

Pick YouTube's automatic (speech-recognition) track before uploaded captions in the same language.

## `includeChunks` (type: `boolean`):

Add 'chunks': consecutive passages up to 'Chunk size', never crossing a chapter, each with start/end seconds, chapter title and a timestamped link for citations.

## `chunkMaxChars` (type: `integer`):

Maximum characters per RAG chunk (200 to 20,000). 1,500 characters ≈ 350 tokens.

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

Add 'segments': every caption line with start and duration in seconds.

## `includeMarkdown` (type: `boolean`):

Add 'markdown': a readable document with metadata, chapter headings and \[m:ss] paragraph timestamps.

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

Add 'srt': the transcript as an SRT subtitle file (string).

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

Add 'vtt': the transcript as a WebVTT file (string).

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

Add the full video description.

## `includePublishDate` (type: `boolean`):

Add publishDate and category (one extra light request per video).

## `cleanText` (type: `boolean`):

Remove \[Music], \[Applause], ♪ and similar annotations from the text and segments.

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

Videos processed at the same time (1 to 20).

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

Switching from another transcript Actor? Send your existing input unchanged (youtube_url, channel, channel_url, languages, language, max_videos, output_formats are understood) and the output also carries that Actor's field names (video_id, timestamped, non_timestamped, transcript_text, ...). Our own fields are always kept.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "maxVideosPerSource": 20,
  "preferredLanguages": [
    "en"
  ],
  "languageFallback": true,
  "preferAutoCaptions": false,
  "includeChunks": true,
  "chunkMaxChars": 1500,
  "includeSegments": true,
  "includeMarkdown": false,
  "includeSrt": false,
  "includeVtt": false,
  "includeDescription": true,
  "includePublishDate": true,
  "cleanText": true,
  "maxConcurrency": 5,
  "outputFormat": "auto"
}
```

# Actor output Schema

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

One record per video: status, metadata, chapters, text, segments and RAG chunks.

# 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 = {
    "videos": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw"
    ],
    "preferredLanguages": [
        "en"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("plainprobe/youtube-transcript-ai").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 = {
    "videos": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"],
    "preferredLanguages": ["en"],
}

# Run the Actor and wait for it to finish
run = client.actor("plainprobe/youtube-transcript-ai").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 '{
  "videos": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "preferredLanguages": [
    "en"
  ]
}' |
apify call plainprobe/youtube-transcript-ai --silent --output-dataset

```

## MCP server setup

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

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/H5JT4d492IGiruvQe/builds/JBod6ZAXpsFwNNg8O/openapi.json
