# YouTube Transcript & Subtitles (SRT, VTT) (`oas_built/youtube-transcripts`) Actor

Get YouTube video transcripts as text, timestamped segments, SRT or VTT. One row per video, in input order; failed videos get a clear error and are not charged.

- **URL**: https://apify.com/oas_built/youtube-transcripts.md
- **Developed by:** [OAS Built](https://apify.com/oas_built) (community)
- **Categories:** Videos, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 transcripts

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/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 transcripts from YouTube videos

Paste YouTube links. Get each video's transcript back, ready to read, search or download.

### What you get for each video

- **The full transcript** in the formats you pick: plain text, timestamped lines, or SRT and WebVTT subtitle text you can save as files.
- **The language**, and whether the creator wrote the captions or YouTube made them automatically.
- **The title, channel and length** of the video.
- **A plain reason** if there's no transcript. You're not charged for those.

### Example output

```json
{
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "status": "OK",
  "title": "Me at the zoo",
  "channelName": "jawed",
  "language": "en",
  "isAutoGenerated": false,
  "text": "All right, so here we are, in front of the elephants…"
}
```

### How to use it

1. Paste video links into **Videos** (up to 100). Two examples are already filled in.
2. Optional: add up to 5 **Channels** to get their latest videos.
3. Press **Start**. Download your results from the **Output** tab as Excel, CSV or JSON.

No YouTube account or API key needed.

### Pricing

You pay only for transcripts you get. The price is the same for any video length or format. Videos without a transcript are free. There's also a small charge each time a run starts. Current prices are on the pricing card. To cap a run's cost, set a maximum charge in the run options.

### When there's no transcript

The row is free, and `errorReason` says which of three cases it is:

- **Nothing to get.** No captions, or the video is removed, private, age-restricted or restricted by YouTube. Trying again won't help. (`NO_CAPTIONS`, `UNAVAILABLE`, `LOGIN_REQUIRED`, `CAPTIONS_RESTRICTED`)
- **Try again later.** YouTube didn't answer properly this time, or the run ran out of time. (`BOT_CHECK`, `RATE_LIMITED`, `CONNECTION_FAILED`, `EMPTY_TRANSCRIPT`, `SOURCE_ERROR`, `TIME_BUDGET`)
- **Check your settings.** A bad or repeated link, a channel that couldn't be found, no captions in your languages, or a limit you set. (`INVALID_INPUT`, `DUPLICATE_INPUT`, `CHANNEL_UNAVAILABLE`, `LANGUAGE_NOT_FOUND`, `OVER_MAX_VIDEOS`, `CHARGE_LIMIT`)

### Limits

- Public videos only.
- No translation, playlists, search, comments or video downloads.
- Channels give their latest videos only (up to 15 each).

### For developers and AI agents

Run it from the Apify API, on a schedule, or from AI agents through Apify's MCP server ([mcp.apify.com](https://mcp.apify.com)). Simplest input:

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

Every setting is explained in the **Input** tab. Match on `errorReason`, not on the wording of `errorDetail`.

### Your data

Everything the Actor saves stays in your own Apify account; we, the developer, can't see it. Run results follow [Apify's retention policy](https://docs.apify.com/platform/storage/dataset); export them or name the dataset to keep them. To speed up reruns, the Actor keeps a small store called `yt-transcripts-cache` in your account. You can delete it at any time.

### Your responsibilities

Transcripts are the creator's words and are usually protected by copyright. Getting one doesn't give you the right to republish it. You're responsible for following YouTube's Terms of Service and your local law. Don't use this Actor to collect personal data about people.

### Not affiliated

Not affiliated with, endorsed by or sponsored by YouTube or Google. "YouTube" is a trademark of Google LLC. Questions? Use the **Issues** tab.

# Actor input Schema

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

YouTube video links or 11-character IDs, up to 100. Accepts watch, youtu.be, Shorts and embed links. Each entry normally gets one output row. Charged once per transcript; error rows are free.

## `channels` (type: `array`):

Up to 5 channels as a link, @handle or UC… channel ID. Each adds its latest uploads after your video list. A channel that can't be read gets one CHANNEL_UNAVAILABLE row (free) and the run continues.

## `maxVideosPerChannel` (type: `integer`):

How many of each channel's latest uploads to add, newest first. Each one that returns a transcript is charged once.

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

Language codes in order of preference, e.g. en, es-419, zh-Hans. Creator captions are preferred within each language. With auto-generated captions on, an unmatched video may return another transcript (languageMatched false); otherwise LANGUAGE_NOT_FOUND.

## `includeAutoGenerated` (type: `boolean`):

Auto-generated captions are allowed by default. Turn this off for creator captions only; videos without a fitting creator track get a free LANGUAGE_NOT_FOUND row listing the available languages.

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

Which transcript fields to fill: plain text, timestamped segments, SRT, WebVTT. The price per transcript is the same for any combination.

## `maxVideos` (type: `integer`):

Process at most this many unique videos (videos plus channel uploads). Entries beyond it get a free OVER_MAX_VIDEOS row. Use it to cap what one run can charge.

## `concurrency` (type: `integer`):

How many videos to fetch at the same time. 1 is the safest; 2 or 3 make large batches faster. Rows stay in input order, and the price per transcript is the same.

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

A proxy is required. Keep the default: it is the setting the Actor is tested with. Turning the proxy off stops the run before anything is fetched.

## `useCache` (type: `boolean`):

Save transcripts in a named store in your own Apify account and reuse them on later runs. Cached transcripts are free and need no YouTube request. Off by default; storage is billed to your account.

## `maxAgeDays` (type: `integer`):

With the cache on, reuse a saved transcript only if it is at most this many days old; older ones are fetched again (charged) and replaced. 0 = always fetch fresh, but still save.

## `cacheStoreName` (type: `string`):

Name of the key-value store in your account that holds the cache. 1–63 letters, digits or hyphens; no leading or trailing hyphen.

## `errorCacheHours` (type: `integer`):

Remember videos that came back UNAVAILABLE or NO_CAPTIONS for this many hours, so a rerun returns the same free error row without asking YouTube again. 0 = off.

## `useHelperCache` (type: `boolean`):

Remember error results (see Error cache) and each @handle's channel ID in your account. Stores no transcript text. Off = no helper reads or writes.

## Actor input object example

```json
{
  "videos": [
    "jNQXAC9IVRw",
    "https://youtu.be/arj7oStGLkU"
  ],
  "channels": [],
  "maxVideosPerChannel": 10,
  "languages": [
    "en"
  ],
  "includeAutoGenerated": true,
  "outputFormats": [
    "text",
    "segments"
  ],
  "maxVideos": 100,
  "concurrency": 1,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "useCache": false,
  "maxAgeDays": 90,
  "cacheStoreName": "yt-transcripts-cache",
  "errorCacheHours": 24,
  "useHelperCache": true
}
```

# Actor output Schema

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

All rows of this run's default dataset.

# 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": [
        "jNQXAC9IVRw",
        "https://youtu.be/arj7oStGLkU"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    },
    "useCache": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("oas_built/youtube-transcripts").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": [
        "jNQXAC9IVRw",
        "https://youtu.be/arj7oStGLkU",
    ],
    "proxyConfiguration": { "useApifyProxy": True },
    "useCache": False,
}

# Run the Actor and wait for it to finish
run = client.actor("oas_built/youtube-transcripts").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": [
    "jNQXAC9IVRw",
    "https://youtu.be/arj7oStGLkU"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "useCache": false
}' |
apify call oas_built/youtube-transcripts --silent --output-dataset

```

## MCP server setup

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

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/NP2dCfGtPAlWQdzlh/builds/LjjnEqpZC5yIx48vw/openapi.json
