# YouTube Transcript API - Instant Transcripts & Timestamps (`topapi/youtube-transcript-api`) Actor

Get any YouTube video's transcript in one HTTP request: plain text, timestamped segments, language, auto-generated flag and video metadata, straight back in the response. Works from code, n8n, Make, Zapier and AI agents (MCP). Charged only when a transcript is returned.

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

## Pricing

$0.80 / 1,000 per video 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 API - Instant Transcripts & Timestamps

**YouTube Transcript API** returns the transcript of any YouTube video in **one HTTP request**: send a video link, get
the transcript back in the response. No run to start, no dataset to fetch, no polling. It is an Apify **Server
Actor**, so it also works as a **tool for AI agents (MCP)** and as a single **HTTP Request** step in n8n, Make or Zapier.

Each answer carries the transcript as plain text and as timestamped segments, the caption language and whether it is
auto-generated, every other caption language the video offers, and the video's title, channel, duration, views,
likes and publish date. **You pay only when a transcript comes back.** A video without captions answers `404` and
costs nothing.

### ✨ What you get

- 📝 **Full transcript** as plain text, plus **timestamped segments** (`start`, `duration`, `end`, `text`)
- 🌍 **Any caption language**: pick your preferred languages in order, fall back to whatever exists
- 🤖 **Auto-generated (ASR) or human captions**, flagged on every answer; YouTube's rolling ASR redraws are removed, so no line appears twice
- 🎞️ **SRT and WebVTT** subtitle files on request
- 📊 **Video metadata**: title, channel name / id / URL, duration, views, likes, publish and upload date, category, keywords, description, thumbnail
- 🗂️ **Every caption language** the video offers (`availableLanguages`)
- ⚡ **Real-time**: answered directly over HTTP, about 1-2 s for a typical video
- 🧠 **MCP endpoint** for AI agents (Claude, ChatGPT, Cursor and any MCP client): tool `get_transcript`
- 🔑 No YouTube API key, no login, no cookies

### 🚀 How to call it

Every request needs your **Apify API token** (Console > Settings > API & Integrations) in the `Authorization` header.

#### GET

```bash
curl "https://topapi--youtube-transcript-api.apify.actor/transcript?video=https://www.youtube.com/watch?v=dQw4w9WgXcQ" \
  -H "Authorization: Bearer <YOUR_APIFY_TOKEN>"
```

#### POST

```bash
curl -X POST "https://topapi--youtube-transcript-api.apify.actor/transcript" \
  -H "Authorization: Bearer <YOUR_APIFY_TOKEN>" -H "Content-Type: application/json" \
  -d '{"video": "dQw4w9WgXcQ", "languages": ["es", "en"], "includeSrt": true}'
```

#### Python

```python
import requests

r = requests.get(
    "https://topapi--youtube-transcript-api.apify.actor/transcript",
    params={"video": "https://youtu.be/dQw4w9WgXcQ", "languages": "en"},
    headers={"Authorization": "Bearer <YOUR_APIFY_TOKEN>"},
    timeout=120,
)
data = r.json()
if r.status_code == 200:
    print(data["items"][0]["transcript"][:500])
else:
    print(r.status_code, data["error"]["type"], data["error"]["message"])
```

#### JavaScript

```javascript
const res = await fetch(
    'https://topapi--youtube-transcript-api.apify.actor/transcript?video=dQw4w9WgXcQ',
    { headers: { Authorization: `Bearer ${process.env.APIFY_TOKEN}` } },
);
const data = await res.json();
console.log(res.status, data.items?.[0]?.wordCount);
```

#### n8n, Make, Zapier

Add an **HTTP Request** step: method `GET`, URL `https://topapi--youtube-transcript-api.apify.actor/transcript`,
query parameter `video` = the video link, header `Authorization` = `Bearer <YOUR_APIFY_TOKEN>`. The transcript is
`items[0].transcript` in the response.

#### AI agents (MCP)

MCP server URL: `https://topapi--youtube-transcript-api.apify.actor/mcp` (Streamable HTTP, header
`Authorization: Bearer <YOUR_APIFY_TOKEN>`). It exposes one tool, `get_transcript`, with the same parameters as the
HTTP endpoint. You can also add the actor through Apify's own MCP server, `mcp.apify.com`.

### ⚙️ Parameters

| Parameter | Type | Default | What it does |
|---|---|---|---|
| `video` | string | required | YouTube video URL (`watch`, `youtu.be`, `/shorts/`, `/live/`, `/embed/`, `m.` and `music.` hosts) or the 11-character video id. Also accepted as `url`, `videoUrl`, `videoId`, `id`, `v`. |
| `languages` | list | `en` | Preferred caption languages in order, as language codes (`en`, `es`, `pt-BR`). Comma-separated in a query string. |
| `fallbackToAnyLanguage` | boolean | `true` | When none of your languages exists, return the first caption track the video has. `false` answers `404` instead. |
| `preferAutoGenerated` | boolean | `false` | Prefer the auto-generated (ASR) track over a human-made one in the same language. |
| `includeSegments` | boolean | `true` | Timestamped segments. |
| `includeSrt` | boolean | `false` | The transcript as an SRT subtitle file. |
| `includeVtt` | boolean | `false` | The transcript as a WebVTT subtitle file. |
| `includeVideoMetadata` | boolean | `true` | Publish date, upload date, category and like count (one extra lookup; `false` is a little faster). |

`GET /` lists the endpoints and parameters; `.actor/openapi.json` (the **Server** tab in Console) describes them in OpenAPI 3.

### 📦 Response

```json
{
  "ok": true,
  "count": 1,
  "items": [{
    "videoId": "dQw4w9WgXcQ",
    "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
    "channelName": "Rick Astley",
    "durationSeconds": 213,
    "transcriptStatus": "ok",
    "language": "English",
    "languageCode": "en",
    "isAutoGenerated": false,
    "transcript": "[♪♪♪] ♪ We're no strangers to love ♪ ...",
    "segmentCount": 61,
    "wordCount": 487,
    "segments": [{ "start": 1.36, "duration": 1.68, "end": 3.04, "text": "[♪♪♪]" }],
    "availableLanguages": [
      { "languageCode": "en", "languageName": "English", "kind": "manual" },
      { "languageCode": "en", "languageName": "English (auto-generated)", "kind": "asr" }
    ]
  }],
  "meta": { "charged": { "transcript-scraped": 1 }, "ms": 1080 }
}
```

| Field | Filled (14-video test corpus, 13 with captions) |
|---|---|
| `videoId`, `videoUrl`, `title`, `channelName`, `channelId`, `channelUrl`, `durationSeconds`, `viewCount`, `thumbnailUrl` | 100% |
| `transcript`, `segments`, `segmentCount`, `wordCount`, `language`, `languageCode`, `isAutoGenerated`, `availableLanguages` | 100% |
| `publishedAt`, `uploadedAt`, `category`, `likeCount`, `description` | 100% |
| `keywords` | when the uploader set them |
| `srt`, `vtt` | when asked for |

### 🧾 Status codes (and what is charged)

| HTTP | `error.type` | Meaning | Charged |
|---|---|---|---|
| `200` | | Transcript returned | **Yes, once** |
| `400` | `invalid-input`, `translation-unavailable` | Not a YouTube video, a bad parameter, or `translateTo` (see limits) | No |
| `404` | `no-captions` | The video publishes no captions | No |
| `404` | `no-transcript-in-requested-language` | Captions exist, not in your languages, and `fallbackToAnyLanguage` is `false`. `error.video.availableLanguages` lists what exists | No |
| `404` | `video-unavailable` | Private, deleted or region-locked video | No |
| `429` | `too-many-requests` | More than 8 of your requests in flight at once; wait for one to finish | No |
| `503` | `blocked`, `unreachable`, `transcript-fetch-failed` | YouTube refused or did not answer in time; retry | No |

A `404` answer still carries `error.video` (title, channel, available languages), free.

### 💰 Pricing

**$0.0008 per transcript returned** ($0.80 per 1,000), pay per event. Nothing is charged for `400`, `404`, `429` or
`503` answers, and there is no start fee. Apify's free plan works too.

### 🗃️ Batch runs (input interface)

You can also start the actor as a normal run with a list of videos, playlists, channels or search terms. Each video
becomes one dataset row (charged per row, like any batch scraper). Use that for thousands of videos at once; use the
HTTP endpoint for one video at a time.

### ⏱️ Speed (measured on Apify, 2026-11-18)

- A typical video (500-3,000 words): **1.1-1.9 s**
- A 9,840-word transcript (a 1 h lecture): 3-6.6 s
- First request after a quiet spell: add a few seconds while the server starts
- 8 requests in parallel: all answered, 0.9-5.8 s each

### ⚠️ Limits

- **Machine translation (`translateTo`) is not available.** YouTube refuses translated caption files to signed-out
  clients (HTTP 429 on every exit we tried, 2026-11-18). Ask for an original caption language with `languages`; a
  request with `translateTo` answers `400` and is not charged.
- Videos without captions have no transcript to return (`404`, free). This actor does not do speech-to-text.
- One video per request. For many videos at once, use a batch run.

### ❓ FAQ

#### Do I need a YouTube API key?

No. The actor reads YouTube's own caption files, signed out. You only need your Apify token.

#### What does one request cost?

$0.0008 when a transcript is returned. Errors and videos without captions are free.

#### How fast is it?

About 1-2 s for a typical video once the server is warm (measured on Apify). The first request after a quiet spell
takes a few seconds longer.

#### Can I get the transcript in a specific language?

Yes: `languages=es,en` tries Spanish first, then English. With `fallbackToAnyLanguage=false` you get a `404` instead
of a different language.

#### Can it translate a transcript?

Not at the moment: YouTube refuses machine-translated caption files to signed-out clients. The request answers `400`
and is free.

#### Does it work for YouTube Shorts and live replays?

Yes, `/shorts/` and `/live/` links work when the video publishes captions.

#### Are auto-generated captions included?

Yes. `isAutoGenerated` tells you which kind you got, and `preferAutoGenerated` picks the ASR track when both exist.

#### How do I use it from an AI agent?

Point any MCP client at `https://topapi--youtube-transcript-api.apify.actor/mcp` with your Apify token, or add the
actor through `mcp.apify.com`. The tool is `get_transcript`.

#### How do I use it in n8n or Make?

One HTTP Request step, GET, with `video` as a query parameter and your token in the `Authorization` header.

#### Can I process a whole playlist or channel?

Yes, with a batch run (the input interface): give playlist or channel links and get one dataset row per video.

#### What happens if YouTube blocks a request?

You get a `503` and are not charged. Retrying usually works: the actor already retries on fresh residential exits.

#### Your feedback

Found a video that should work and does not? Open an issue on the actor page with the video link.

# Actor input Schema

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

YouTube videos to transcribe. Accepts watch URLs, youtu.be short links, /shorts/, /embed/, /live/ and bare 11-character video IDs. Mix any of them freely.

## `playlistUrls` (type: `array`):

Transcribe every video in these playlists. Accepts a playlist URL (https://www.youtube.com/playlist?list=…), a watch URL that carries a `list=` parameter, or a bare playlist ID. Capped per playlist by 'Max videos per source'.

## `channelUrls` (type: `array`):

Transcribe the newest videos from these channels. Accepts @handles, /channel/UC… URLs, /c/ and /user/ vanity URLs, or a bare UC… channel ID. Capped per channel by 'Max videos per source'.

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

Search YouTube and transcribe the top video results for each query. Capped per query by 'Max videos per source'.

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

Ordered preference list of language codes, e.g. \['en', 'es', 'pt-BR']. The first one the video actually publishes wins; 'en' also matches 'en-US' and 'en-GB'. Use \['any'] to always take the video's own default track.

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

If the video has captions but not in your preferred languages, return the best track it does have instead of an empty row. On by default — a Spanish video coming back blank because you asked for English is the most common complaint about transcript scrapers.

## `preferAutoGenerated` (type: `boolean`):

By default human-written captions win over YouTube's automatic speech recognition for the same language, because they are punctuated and accurate. Switch this on to prefer the ASR track instead (it is usually more complete on long videos).

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

Include the `segments` array — every caption cue with its start, duration and end in seconds. Turn off for a much smaller row when you only want the plain text.

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

Add an `srt` field containing the transcript rendered as a ready-to-use .srt subtitle file.

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

Add a `vtt` field containing the transcript rendered as a ready-to-use WebVTT file.

## `includeVideoMetadata` (type: `boolean`):

Fetch the video's publish date, upload date, YouTube category and like count. These live in a different response than the captions, so this adds one small request per video. Title, channel, duration, views, description, keywords and thumbnail come free either way.

## `skipVideosWithoutTranscript` (type: `boolean`):

Leave off (the default) to get a row for every video, with `transcriptStatus` and `transcriptError` explaining any that came back empty — you are never charged for a row you did not ask to skip, but you do see which videos failed and why. Switch on to deliver only videos that actually produced a transcript.

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

How many videos to take from each playlist, channel or search query. Bounded by default so a channel with 5,000 uploads does not run away. 0 = no per-source limit.

## `maxItems` (type: `integer`):

Hard stop on the total number of videos transcribed in this run, across every source. 0 = no limit.

## `requestConcurrency` (type: `integer`):

How many videos to fetch in parallel. YouTube throttles hard above ~10; the default of 5 is measured as the fast, reliable setting.

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

Defaults to Apify Proxy with the RESIDENTIAL group, and you should leave it there. Measured 2026-09-02: through Apify's DATACENTER pool YouTube answers every request with 'Sign in to confirm you're not a bot' and zero caption tracks; through RESIDENTIAL it returns full transcripts. Datacenter proxies do not work for this endpoint. You can supply your own residential proxy instead.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/jNQXAC9IVRw"
  ],
  "playlistUrls": [],
  "channelUrls": [],
  "searchQueries": [],
  "languages": [
    "en"
  ],
  "fallbackToAnyLanguage": true,
  "preferAutoGenerated": false,
  "includeSegments": true,
  "includeSrt": false,
  "includeVtt": false,
  "includeVideoMetadata": true,
  "skipVideosWithoutTranscript": false,
  "maxVideosPerSource": 50,
  "maxItems": 2,
  "requestConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

The dataset of scraped transcripts (one item per video).

# 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://youtu.be/jNQXAC9IVRw"
    ],
    "languages": [
        "en"
    ],
    "maxItems": 2
};

// Run the Actor and wait for it to finish
const run = await client.actor("topapi/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=dQw4w9WgXcQ",
        "https://youtu.be/jNQXAC9IVRw",
    ],
    "languages": ["en"],
    "maxItems": 2,
}

# Run the Actor and wait for it to finish
run = client.actor("topapi/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=dQw4w9WgXcQ",
    "https://youtu.be/jNQXAC9IVRw"
  ],
  "languages": [
    "en"
  ],
  "maxItems": 2
}' |
apify call topapi/youtube-transcript-api --silent --output-dataset

```

## MCP server setup

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