# YouTube Transcript & Subtitles Extractor (`deomoreo/youtube-transcript`) Actor

Get the transcript of any YouTube video, Short or live replay: full text, timestamped segments and SRT, in the language you choose (manual captions first, auto-generated as fallback). Pay only for transcripts delivered.

- **URL**: https://apify.com/deomoreo/youtube-transcript.md
- **Developed by:** [Francesco Marotta](https://apify.com/deomoreo) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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/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 & Subtitles Extractor

Get the transcript of any YouTube video, Short or live replay: **full text, timestamped segments and SRT subtitles**, in the language you choose when the video has it. You pay only for transcripts that are delivered. Videos without captions and invalid links are reported, not charged.

### What you get

| Field | Description |
|---|---|
| `videoId`, `url` | The video |
| `title`, `channelName`, `channelId`, `durationSeconds`, `viewCount` | Basic video details |
| `language`, `languageName` | Language of the returned transcript |
| `isAutoGenerated` | `true` if YouTube generated the captions automatically |
| `availableLanguages` | Every caption track the video has |
| `text` | The full transcript as one string |
| `segments` | `[{ start, duration, text }]` in seconds (optional) |
| `srt` | Ready-to-use SRT subtitles (optional) |

Example item:

```json
{
  "videoId": "abcDEF12345",
  "title": "How to bake sourdough bread at home",
  "channelName": "Example Kitchen",
  "language": "en",
  "isAutoGenerated": false,
  "text": "Today we are going to bake a simple sourdough loaf ...",
  "segments": [{ "start": 0.5, "duration": 2.8, "text": "Today we are going to bake" }]
}
```

### How to use

1. Paste YouTube links or video IDs in **Videos**. Watch, `youtu.be`, Shorts, embed and live links all work.
2. Choose a **Preferred language** (for example `en`, `it`, `de`, `pt-BR`).
3. Run it. Download the results as JSON, CSV or Excel, or call the Actor through the Apify API, from Make, Zapier or n8n, or from an AI agent via MCP.

### Language selection

1. Manual captions in your language.
2. Auto-generated captions in your language.
3. Captions in a regional variant (for example `en-GB` when you asked for `en`).
4. Otherwise the original language is returned, and `language` tells you which one it is.

### Errors

Failed videos appear in the dataset with an `error` code and are **not charged**:

- `INVALID_INPUT`: not a YouTube video link or ID
- `VIDEO_UNAVAILABLE`: private, removed or region-blocked video
- `NO_CAPTIONS`: the video has no captions or transcript
- `BLOCKED` / `RATE_LIMITED`: YouTube still refused the request after all retries (rare with the default proxy settings).

### Pricing

**$3 per 1,000 transcripts** ($0.003 each), charged only for transcripts delivered. Videos without captions, invalid links and failures are free. The run stops by itself when your spending limit is reached.

### Reliability

YouTube blocks most cloud servers. This Actor uses Apify datacenter proxies first and automatically retries blocked videos through residential proxies, so you get your transcripts instead of errors. In our tests from the Apify cloud, 20 of 20 captioned videos were delivered.

### Use cases

Content repurposing and summaries, SEO and keyword research, training and RAG datasets for LLMs, accessibility and subtitles, media monitoring and research.

### Notes

This Actor reads only publicly available captions. It does not download video or audio and does not log in to YouTube. Make sure your use of the transcripts respects the rights of the video owners.

# Actor input Schema

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

YouTube video URLs or 11-character video IDs. Watch, youtu.be, Shorts, embed and live links all work. Duplicates are removed.

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

Language code such as en, it, de, es or pt-BR. Manual captions in this language are preferred, then auto-generated ones, then a regional variant (en-GB for en). If the video has none, the original language is returned and reported in the output field language.

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

Adds a list of { start, duration, text } segments (seconds).

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

Adds the transcript as a ready-to-use .srt subtitle string.

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

How many videos to process at the same time.

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

YouTube blocks most cloud IP addresses. Apify datacenter proxy is used by default; change it only if you know you need to.

## `residentialFallback` (type: `boolean`):

Retry videos that are still blocked through a residential proxy. Recommended: it is what makes near-100% success possible.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "language": "en",
  "includeSegments": true,
  "includeSrt": false,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "residentialFallback": true
}
```

# Actor output Schema

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

No description

## `overview` (type: `string`):

No description

# 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"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

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

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

```

## MCP server setup

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