# Kuantum YouTube Transcript API — JSON (`kuantum/youtube-transcript-api`) Actor

Extract YouTube transcripts from videos, channels, and playlists in any language with Kuantum YouTube Transcript API. Get structured JSON, Markdown, and RAG-ready chunks. Start a run now and turn video into usable data.

- **URL**: https://apify.com/kuantum/youtube-transcript-api.md
- **Developed by:** [\[R\] Kuantum](https://apify.com/kuantum) (community)
- **Categories:** AI, Videos, Developer tools
- **Stats:** 2 total users, 1 monthly users, 23.8% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $15.00 / 1,000 transcript delivereds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## 🎬 YouTube Transcript API — Captions to JSON + LLM-ready text

**Get any YouTube video's transcript as clean, structured, AI-ready text.** Extract transcripts and metadata from **YouTube** — single videos, or **whole channels and playlists** — in **any available language**. Every result ships as **JSON** *and* **LLM-ready** formats (clean Markdown + token-aware **RAG chunks**), so it drops straight into ChatGPT, Claude, a vector database, or your analytics pipeline.

> No API keys. No monthly lock-in. **Pay only for what you extract.**

***

### ⚡ Why this one

- **YouTube done right.** It solves YouTube's JavaScript/PoToken challenge and consent walls (via `yt-dlp` + `deno`) — the stuff that breaks naive scrapers. Use residential proxy for scale.
- **LLM-ready out of the box.** Not just raw captions — cleaned plain text, paragraphed Markdown, and **embedding-ready chunks** whose size and `token_estimate` come from a real tokenizer (tiktoken `o200k`/`cl100k`), accurate even for CJK/emoji/code.
- **Channels & playlists.** Paste a channel or playlist URL → it transcribes the videos (bounded by `maxVideosPerList`).
- **Any language.** Requests your preferred language and falls back to the closest available variant.

### 🚀 Build with it

- **"Chat with a YouTube channel"** — transcribe a creator's catalog, embed the chunks, ship a RAG bot.
- **Research & datasets** — talks, lectures, podcasts as clean timestamped text in any language.
- **Repurposing** — turn a video into a blog post, summary, or show notes from the Markdown.
- **Analytics** — bulk-pull transcripts for sentiment / topic analysis.

### 📥 Input (highlights)

| Field | Type | Default | Description |
|---|---|---|---|
| `videoUrls` | array | — (required) | YouTube video, channel, or playlist URLs. |
| `language` | string | `en` | Preferred subtitle language; falls back to the closest variant. |
| `maxVideosPerList` | integer | `20` | Cap per channel/playlist (max 200; run ceiling 1,000). |
| `outputFormats` | array | all | `json`, `text`, `markdown`, `chunks`. |
| `chunkTokens` / `tokenizer` | — | `400` / `o200k` | Real, enforced token budget for RAG chunks. |
| `translateTo` | string | — | Optionally also return a translated copy. **Best-effort, often unavailable** — uses YouTube's auto-translation. |
| `priorityProcessing` | boolean | `false` | Bulk priority add-on; only charged on a successful delivery once the premium event is published. |
| `webhookUrl` / `webhookSecret` | string | — | Optional HMAC-signed final-run summary to your HTTPS endpoint. |
| `proxyConfiguration` | object | Residential | Residential is the reliability default. |

```json
{
  "videoUrls": ["https://www.youtube.com/watch?v=UF8uR6Z6KLc"],
  "language": "en",
  "outputFormats": ["json", "text", "markdown", "chunks"],
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

### 📤 Output

One dataset item per video: normalized metadata (title, channel, duration, views, upload date), `transcript_found`, `is_auto_generated`, `selected_language`, plus `text`, timestamped `transcript`, LLM-ready `markdown`, and token-aware `chunks` (with exact `token_estimate`). Add `translateTo` for a `translated` object alongside the original.

### 💸 Pricing

**Pay-per-result** — you pay per video successfully transcribed, no monthly subscription. Free Apify tier available to try it.

### ❓ Notes

Extraction needs the video to expose a caption track (human **or** auto-generated); unavailable captions are skipped and never billed. This is the YouTube-focused edition of the broader [**Transcript-to-RAG API**](https://apify.com/kuantum/video-transcript-scraper), which is production-verified on YouTube and TED.

*Keywords: YouTube transcript API, YouTube captions to JSON, YouTube subtitles download, transcript for LLM, RAG, YouTube channel transcript, playlist transcript, video to text, any language.*

# Actor input Schema

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

One or more YouTube video, channel, or playlist URLs. Channels/playlists are expanded into their videos (see Max videos per list).

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

Preferred subtitle language code (ISO, e.g. 'en', 'es', 'fr', 'de', 'pt'). Falls back to the closest available variant (e.g. es → es-419) when the exact code is missing.

## `includeAutoCaptions` (type: `boolean`):

When no human-made subtitle track exists, fall back to the platform's machine-generated captions.

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

Which representations to include in each result. 'chunks' produces token-aware, embedding-ready segments for RAG / conversational agents.

## `chunkTokens` (type: `integer`):

Token budget per RAG chunk (used only when 'chunks' is selected). Enforced with a real tokenizer — see 'Tokenizer' — so it is accurate even for CJK/emoji/code.

## `tokenizer` (type: `string`):

Tokenizer for chunk sizing + token\_estimate. 'o200k' (GPT-4o / text-embedding-3) and 'cl100k' (ada-002 / GPT-3.5-4) are exact via tiktoken and a good proxy for Claude/Gemini; 'chars' is the fast chars/4 heuristic (under-counts CJK).

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

Optionally also return the transcript translated to this language (e.g. 'es', 'fr'). Best-effort and YouTube-only — uses YouTube's auto-translation, which isn't offered for every video/language. Adds a second extraction per video; result appears under 'translated' (null when unavailable).

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

Include the per-segment start/end array in the JSON output.

## `bestEffort` (type: `boolean`):

Log extra diagnostic detail when captions are unavailable. No dataset item is written and no transcript-result charge occurs for unavailable captions.

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

How many videos to process in parallel.

## `maxVideosPerList` (type: `integer`):

When a channel/playlist URL is given, transcribe at most this many of its videos (most recent first). A total ceiling of 1000 videos per run also applies.

## `priorityProcessing` (type: `boolean`):

Use the priority queue for a batch. This option is charged only when a transcript is successfully delivered and requires the published priority add-on to be active.

## `webhookUrl` (type: `string`):

Optional HTTPS endpoint that receives one signed JSON summary after a successful run. Provide webhookSecret too.

## `webhookSecret` (type: `string`):

Shared secret (16+ characters). The final webhook includes an HMAC SHA-256 signature in X-Apify-Transcript-Signature.

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

Apify Proxy settings. Defaults to RESIDENTIAL for reliable YouTube extraction. You can choose DATACENTER for lower-cost experiments on platforms where it works.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=UF8uR6Z6KLc"
  ],
  "language": "en",
  "includeAutoCaptions": true,
  "outputFormats": [
    "json",
    "text",
    "markdown",
    "chunks"
  ],
  "chunkTokens": 400,
  "tokenizer": "o200k",
  "includeTimestamps": true,
  "bestEffort": false,
  "maxConcurrency": 5,
  "maxVideosPerList": 20,
  "priorityProcessing": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

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

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

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

```

## MCP server setup

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

```

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/YdKDWDHbyhZzGmKz0/builds/wyWhj1gb7CcQlZUXQ/openapi.json
