# YouTube Transcript API - Subtitles for Any Video (`aolmo/youtube-transcript`) Actor

Gets the transcript of any YouTube video in one call: plain text plus timed segments, in the language you prefer. No API key, no browser: one second per video and $0.003 per transcript.

- **URL**: https://apify.com/aolmo/youtube-transcript.md
- **Developed by:** [Antonio del Olmo Tena](https://apify.com/aolmo) (community)
- **Categories:** Videos, AI
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 transcript fetcheds

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

Get the transcript of any YouTube video in one call: plain text plus timed segments, in the language you prefer. No API key, no browser, no proxies, so it is fast (about one second per video) and one of the cheapest transcript Actors in the Store.

Typical uses: feeding videos to an LLM or a RAG pipeline, summarizing talks and podcasts, subtitles research, content repurposing, keyword analysis of competitors' videos, and monitoring whether a video's captions changed.

### What you get

One Dataset item per video with:

- `transcript`: the full text, cleaned and in reading order.
- `segments`: a list of `{ start, duration, text }` entries with the caption timings (optional).
- `title`, `author`, `channelId`, `durationSeconds`, `viewCount`, `description`.
- `language`, `languageCode`, `isAutoGenerated` (manual captions are preferred when both exist).
- `availableLanguages`: every caption track the video offers, so you can request another one.

Videos that cannot be processed (no captions, private, removed, age-restricted) are returned with an `error` field instead of failing the run, and they are not charged.

### How to use it

1. Open the **Input** tab.
2. Paste one or more video URLs or ids in **Video URLs or ids**. Watch, youtu.be, shorts, embed and live links all work.
3. Optionally set **Preferred languages** (for example `es, en`). The first available one is used.
4. Click **Start** and read the results in the **Output** tab, or download them as JSON, CSV or Excel.
5. To use it from your code or an AI agent, see the API section below.

### Input

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/jNQXAC9IVRw"
  ],
  "languages": ["en"],
  "includeSegments": true
}
```

| Field             | Description |
|-------------------|-------------|
| `videoUrls`       | Video URLs or 11-character ids. Up to 50 per run. |
| `languages`       | Language codes in order of preference. Default `["en"]`. If none is available, the first track is used. |
| `includeSegments` | Default `true`. Set to `false` for smaller items when you only need the text. |

### Output example

```json
{
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "videoId": "jNQXAC9IVRw",
  "title": "Me at the zoo",
  "author": "jawed",
  "durationSeconds": 19,
  "viewCount": 439209561,
  "language": "English",
  "languageCode": "en",
  "isAutoGenerated": false,
  "availableLanguages": [
    { "code": "en", "name": "English", "autoGenerated": false },
    { "code": "de", "name": "German", "autoGenerated": false }
  ],
  "transcript": "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...",
  "wordCount": 39,
  "segments": [{ "start": 1.2, "duration": 2.16, "text": "All right, so here we are, in front of the elephants" }],
  "timestamp": "2026-10-02T18:00:00.000Z"
}
```

### Pricing

You pay per transcript, nothing else:

- **Transcript fetched** ($0.003): one video processed successfully.
- **Actor start** ($0.00005): Apify's standard start fee.

Videos without captions or unavailable videos are never charged. 1,000 transcripts cost $3. Comparable Actors charge $0.005 to $0.01 per video.

### Use it as an API

```bash
curl -X POST "https://api.apify.com/v2/acts/USERNAME~youtube-transcript/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrls":["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],"languages":["en"]}'
```

Replace `USERNAME~youtube-transcript` with the Actor id shown on this page. The call returns the Dataset items directly. The Actor is also available to AI agents through Apify's MCP integration.

### FAQ

**The item says "No captions available".** The video has no subtitles at all, not even auto-generated ones. YouTube does not generate them for every video, and some channels disable them.

**I asked for Spanish and got English.** The video has no Spanish track; `availableLanguages` in the output lists what exists. The transcript is returned in an available language and you can translate it with any LLM.

**Are auto-generated captions supported?** Yes. When a video has both manual and auto-generated captions in your language, the manual ones are used; `isAutoGenerated` tells you which one you got.

**Does it work with Shorts and live streams?** Shorts yes. Live streams only once the stream has ended and YouTube has produced captions.

**Is anything bypassed?** No. The Actor calls YouTube's public player API and public caption endpoint, nothing else.

# Actor input Schema

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

One per line. Accepts watch, youtu.be, shorts, embed and live URLs, or the 11-character video id.

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

Language codes in order of preference, e.g. en, es, pt-BR. Manual captions are preferred over auto-generated ones. If none matches, the first available track is used.

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

Return the transcript also as a list of segments with start time and duration.

## `product` (type: `string`):

Internal. Leave as is.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "languages": [
    "en"
  ],
  "includeSegments": true,
  "product": "youtube-transcript"
}
```

# Actor output Schema

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

Dataset items: url, changed, events, data, timestamp and error (when the target failed).

# 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"
    ],
    "languages": [
        "en"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("aolmo/youtube-transcript").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"],
    "languages": ["en"],
}

# Run the Actor and wait for it to finish
run = client.actor("aolmo/youtube-transcript").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"
  ],
  "languages": [
    "en"
  ]
}' |
apify call aolmo/youtube-transcript --silent --output-dataset

```

## MCP server setup

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

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/mEM5CjnaJYSWaQn7l/builds/vJ2TX9C6FdJqz5W1P/openapi.json
