# YouTube Transcript API & Subtitles Scraper: Captions, Channel (`data-for-agents/youtube-transcripts`) Actor

$2.50 per 1,000 transcripts; videos without captions are free. Input: YouTube video URLs or IDs, a channel (@handle, newest videos first, with a limit) or a playlist. Returns the full transcript text, timestamped segments, optional SRT/VTT subtitles, caption language, title, channel and views.

- **URL**: https://apify.com/data-for-agents/youtube-transcripts.md
- **Developed by:** [Data for Agents](https://apify.com/data-for-agents) (community)
- **Categories:** Videos, AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.50 / 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.

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 & Subtitles Scraper: Captions, Channel

Returns one row per video: the transcript as plain text and as timestamped segments, the caption
language, and the video's title, channel, views and duration. Optional SRT and VTT files, and
description, tags, publish date, category and likes at no extra charge. Input: video links or IDs,
playlist links, channel links or @handles. No YouTube account, no API key, no browser.

**Price:** $2.50 per 1,000 transcripts (one `transcript` event per transcript returned). Error rows are free, and so is starting a run.

### Input example

```json
{ "videoUrls": ["https://www.youtube.com/watch?v=arj7oStGLkU", "@TED"],
  "maxVideosPerSource": 20, "languages": ["en"], "outputFormats": ["srt"] }
```

### Output row (real, shortened)

```json
{ "video_id": "arj7oStGLkU", "title": "Inside the Mind of a Master Procrastinator | Tim Urban | TED",
  "channel": "TED", "status": "ok", "error_code": null, "error": null, "language": "en", "is_generated": false,
  "text": "So in college, I was a government major, ...",
  "segments": [{"start": 12.645, "duration": 1.37, "text": "So in college,"}], "srt": "1\n00:00:12,645 --> ..." }
```

### Tested on Apify (residential proxy)

- 9,727 videos from five channels in one run: 9,525 transcripts in 22 minutes, 341 MB of memory at
  the peak. The other 202 had no captions or were restricted; none failed.
- 1,000 mixed videos: 816 transcripts in 128 s. The other 184 had no captions, were age-restricted,
  private or not available in the proxy's country, and 1 was blocked.
- 120 podcasts and courses of up to 24 hours in a 512 MB run: 116 transcripts, no crash. The minimum is
  now 1,024 MB.
- A channel, a playlist and two sources that do not exist: 169 transcripts from 170 videos in 76 s.

### Limits

No translation and no speech-to-text: a video without captions returns `no_captions`. Channel
uploads include Shorts and past live streams. The limit per channel or playlist is applied before the
date filter.

- **Run size:** at most 50,000 videos in one run, after channels and playlists are listed. A larger
  input stops at the start with a message and no charge: split it into several runs.
  About 440 videos a minute: for more than 25,000 videos raise the run timeout above one hour. A run
  that reaches its time limit stops cleanly, and resurrecting it continues where it stopped.
- **Memory:** 1,024 MB by default and at least. Long videos wait their turn so that they fit; a
  run that still lacks memory stops with free `low_memory` rows and does not crash.
- **Row size:** one row holds at most 8 MB. A 12-hour video with segments, SRT and VTT fits. A longer
  one loses VTT, then SRT, then segments; the full `text` always stays.
- **Maximum cost:** set it in the run options ("Maximum cost per run" in Console, `maxTotalChargeUsd` in
  the API; it is not an input field). The run stops at your limit, never charges above it, and writes one free
  `cost_limit` row with the number of videos it did not read.
- **Restarts:** a run that Apify restarts or that you resurrect continues where it stopped. It
  stores no video twice and charges no transcript twice.
- **Videos that were not read:** a run that stops early (maximum cost, time limit, memory, a block)
  writes one free row with the number of videos it did not read. Resurrect the run and it reads them.
  Unusable entries get up to 1,000 `invalid_input` rows; one more row counts the rest.
- **Input:** an entry that is not a YouTube link or ID returns a free `invalid_input` row.
- **Wrong option values:** Apify checks the input form before a run starts and refuses a wrong type or an
  unknown output format with a message that names the field (for example a word where a number belongs).
  A date that is not `YYYY-MM-DD` stops the run at its start with one free `invalid_input` row. A language
  that YouTube does not know simply matches nothing. A row
  repeats at most 500 characters of the entry.

### Error codes (rows with `status: "error"`, free)

`error_code` is one of: `no_captions`, `language_not_available`, `not_found`, `access_restricted`,
`invalid_input`, `missing_input`, `blocked`, `rate_limited`, `timeout`, `network_error`, `proxy_error`,
`site_changed`, `cost_limit`, `low_memory`, `run_timeout`, `no_data`, `internal_error`. `error` is one
sentence that says what to do. The table is under "Videos without a transcript are free".

### How to use it

1. Paste video links or IDs, playlist links, or channel links and @handles into **Videos, playlists
   or channels**, one per line. You can mix them.
2. For channels and playlists, set how many videos to read from each, and a date range if you want
   one.
3. Set **Preferred languages** if you want something other than English.
4. Start the run. Each video becomes one row in the dataset, which you can download as JSON, CSV or
   Excel, or read through the Apify API.

Regular videos, Shorts, `youtu.be` links, embed links and bare 11-character IDs all work. The same
video pasted twice is read once. A channel can be `@handle`, `youtube.com/@handle`,
`youtube.com/channel/UC...`, `youtube.com/c/name` or `youtube.com/user/name`, and gives its newest
uploads first, Shorts and past live streams included. A playlist gives its videos in playlist order. A
watch link that has a playlist in it is read as that one video.

### Input

| Field | What it does |
|---|---|
| **Videos, playlists or channels** (`videoUrls`) | Video links or IDs, playlist links, channel links or @handles, one per line. |
| **Videos per channel or playlist** (`maxVideosPerSource`) | How many videos to read from each channel (newest first) or playlist (in its order). Default: 20. |
| **Published on or after / before** (`publishedAfter`, `publishedBefore`) | Days as `YYYY-MM-DD`. A video published outside the range is skipped before its captions are fetched: no row, no charge. The run's status message says how many were skipped. The limit per channel is applied first, so for a channel this means: of its newest videos, the ones in the range. |
| **Only new videos** (`onlyNew`) | For a scheduled job. On: a video whose transcript this Actor already returned to you in an earlier run with this option on is skipped before any request: no row, no charge. The Actor remembers the videos in the key-value store `youtube-transcripts-memory` of your account; delete that store to start again. A video that had no transcript is tried again in the next run. |
| **Preferred languages** (`languages`) | Language codes in order of preference, for example `en`, `es`, `pt-BR`. Default: `en`. The first language the video has is returned. `en` also matches `en-US` and `en-GB`. Captions written by the creator are preferred over auto-generated ones. |
| **Use the video's own language** (`fallbackToAnyLanguage`) | On (default): a video with none of your languages returns its transcript in the language spoken in the video. Off: such a video returns a free `language_not_available` row. The same free row comes back when the spoken language cannot be told: several written caption tracks and no automatic one. |
| **Include timestamped segments** (`includeTimestamps`) | On (default): each row has the `segments` list. Off: only the full text, for smaller rows. |
| **Subtitle files** (`outputFormats`) | `srt`, `vtt` or both: each row gets the transcript as a ready subtitle file in the `srt` and `vtt` fields. Default: none. |
| **Include description, tags, publish date, category and likes** (`includeVideoDetails`) | On (default): the five extra fields, at no extra charge. Off: smaller rows. |
| **Proxy** (`proxyConfiguration`) | Default: residential proxies. YouTube limits how many transcripts one address may fetch, and the residential pool is large enough for big runs. The Actor moves to a new address when one is blocked. Datacenter proxies are refused by YouTube in larger runs: in a test of 1,000 videos a datacenter run returned 339 transcripts and then stopped itself. |

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=arj7oStGLkU",
    "https://youtu.be/jNQXAC9IVRw",
    "@TED"
  ],
  "maxVideosPerSource": 20,
  "publishedAfter": "2026-10-01",
  "languages": ["en", "es"],
  "outputFormats": ["srt"]
}
```

### Output

One row per video. Every row has the same fields.

```json
{
  "input": "https://www.youtube.com/watch?v=arj7oStGLkU",
  "video_id": "arj7oStGLkU",
  "url": "https://www.youtube.com/watch?v=arj7oStGLkU",
  "title": "Inside the Mind of a Master Procrastinator | Tim Urban | TED",
  "channel": "TED",
  "channel_id": "UCAuUUnT6oDeKwE6v1NGQxug",
  "duration_seconds": 844,
  "views": 62208470,
  "likes": 2055903,
  "published_at": "2016-04-06T09:59:35-07:00",
  "category": "People & Blogs",
  "description": "Tim Urban knows that procrastination doesn't make sense, but he's never been able to shake his habit of waiting until the last minute to get ...",
  "tags": ["TED Talk", "TED Talks", "Tim Urban", "procrastination"],
  "status": "ok",
  "error_code": null,
  "error": null,
  "language": "en",
  "language_name": "English",
  "is_generated": false,
  "available_languages": [
    { "language": "ar", "name": "Arabic", "is_generated": false },
    { "language": "hy", "name": "Armenian", "is_generated": false }
  ],
  "text": "So in college, I was a government major, which means I had to write a lot of papers. Now, ...",
  "segments": [
    { "start": 12.645, "duration": 1.37, "text": "So in college," },
    { "start": 15.349, "duration": 1.564, "text": "I was a government major," }
  ],
  "srt": "1\n00:00:12,645 --> 00:00:14,015\nSo in college,\n\n2\n00:00:15,349 --> 00:00:16,913\nI was a government major,\n",
  "vtt": null
}
```

This is a real row, cut short: the full one has 12,671 characters of text, 315 segments, 13 tags
and 50 caption languages. `input` is the line the video came from: for a video found through a
channel or playlist, that channel or playlist. `published_at` is in the uploader's time zone. `srt`
and `vtt` are `null` unless you ask for them, and the five detail fields are `null` when the option
is off or YouTube does not give them. A run with a date range fills `published_at`, `category` and
`likes` even when the option is off. `is_generated` is `true` for YouTube's automatic captions and `false` for
captions written by the creator.

### Videos without a transcript are free

Every row has `status`: `ok` or `error`. An error row has the same fields as a transcript row, with
`error_code` (stable, lower case) and `error` (one sentence: what happened and what to do). Error
rows cost nothing.

| `error_code` | What it means | Free | Does a retry help? |
|---|---|---|---|
| `no_captions` | The video has no captions: the creator switched them off, or YouTube made none. | yes | no |
| `language_not_available` | The video has captions, but not in your languages, and the own-language option is off or cannot tell the spoken language. `available_languages` lists what exists. | yes | with another language |
| `not_found` | The video, channel or playlist does not exist, was removed, or has no public videos. | yes | no, check the link |
| `access_restricted` | YouTube does not give this video to a signed-out viewer: age-restricted, private, members-only, a live stream, or not available in the proxy's country. `error` has YouTube's reason. | yes | no |
| `invalid_input` | The entry is not a YouTube video, playlist or channel link and not a video ID; or the whole input cannot be used (a date that is not `YYYY-MM-DD`, more than 50,000 videos). | yes | after correcting it |
| `missing_input` | The input has no `videoUrls`. | yes | after adding them |
| `blocked` | YouTube refused every address the Actor tried for this video or this channel. After 5 such videos in a row the run stops and one row says how many videos were not read. | yes | yes, later or with another proxy |
| `rate_limited` | YouTube answered "too many requests" (HTTP 429) on every try. | yes | yes, later |
| `timeout` | YouTube did not answer within 30 seconds on every try. | yes | yes |
| `network_error` | The connection failed or YouTube answered with a server error on every try. | yes | yes |
| `proxy_error` | The proxy did not connect, or could not be set up. | yes | yes, or change the proxy |
| `site_changed` | YouTube answered in a form the Actor does not know. | yes | once; if it repeats, the Actor needs an update |
| `cost_limit` | The run reached your maximum cost. One row says how many videos were not read. | yes | raise the maximum cost and resurrect the run |
| `low_memory` | The run did not have enough memory for this video, or for the videos left (then one row says how many). `error` names the memory to run it with. | yes | with more memory |
| `run_timeout` | The run reached its time limit. One row says how many videos were not read. | yes | resurrect the run: it continues where it stopped |
| `no_data` | Every video was outside your date range, or was returned in an earlier only-new run. | yes | with another date range; nothing to do for only-new |
| `internal_error` | An error inside the Actor. | yes | yes |
| `partial_result` | On a row with `status: "ok"`: the transcript is complete, but the row was over 8 MB, so the subtitle files or segments were left out. | charged as a transcript | no |

One bad entry never stops the others. Every run ends as SUCCEEDED, and its rows say why a video has
no transcript. When none came back because of a block, a changed site or an error inside the Actor,
the `OUTPUT` record has `"status": "failed"`. The
status message and the `OUTPUT` record give the counts per `error_code`:
`{"transcripts": 41, "errors": {"no_captions": 6, "not_found": 1}, "skipped_by_date": 0}`.

Each video gets up to 5 tries on different addresses, with a growing wait between them, and at most
180 seconds in all. A final answer such as `not_found` is never tried again.

### Price

$2.50 per 1,000 transcripts, and nothing else: proxy and platform usage are included in that price. You pay per transcript returned. Error rows are free, and there is no charge for starting a run. Set a maximum cost per run and the Actor stops reading videos when it
is reached.

### Questions

**Can it read a whole channel?** Yes. Paste the channel and raise **Videos per channel or playlist**
to the number you want. Listing a channel is free: you pay only for the transcripts returned.

**Can I get only new videos?** Yes. Switch on **Only new videos** (`onlyNew`) and run the same input on a
schedule: each run returns and charges only videos it has not returned to you before. For a daily job on a
channel, 20 videos per channel covers the day. You can also set **Published on or after** to a date. A run that
finds nothing new ends as succeeded with one free `no_data` row and no charge.

**Does it translate?** No. It returns captions that exist on YouTube, in their own language. The
`available_languages` field shows which ones a video has.

**Why do some videos have no transcript?** Captions are the creator's choice. Music videos, very new
uploads and live streams often have none. Age-restricted and private videos need a signed-in viewer,
which this Actor never uses.

**Auto-generated or written captions?** Whichever exists, and written captions win when both do. The
`is_generated` field tells you which one you got.

**How long can a video be?** Any length. A two-hour video returns about 3,000 segments in one row. Above about 12 hours the row keeps the full text and leaves out the subtitle files (see Limits).

**Do I need a YouTube account or API key?** No. The Actor reads only what a signed-out visitor can see.

# Actor input Schema

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

One per line: a video link or 11-character ID, a playlist link, a channel link or an @handle. A channel gives its newest uploads first. Video links can be watch, youtu.be, Shorts, live or embed.

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

The newest N videos of a channel, the first N of a playlist. Single video links are not counted. Raise it to read a whole channel.

## `publishedAfter` (type: `string`):

YYYY-MM-DD. Older videos are skipped before their captions are read: no row, no charge. The limit per channel or playlist is applied first.

## `publishedBefore` (type: `string`):

YYYY-MM-DD. Newer videos are skipped before their captions are read: no row, no charge.

## `onlyNew` (type: `boolean`):

For a job you run on a schedule. On: a video whose transcript this Actor already returned to you in an earlier run with this option on is skipped: no row, no charge. The Actor remembers the videos in the key-value store `youtube-transcripts-memory` of your account; delete that store to start again.

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

The first language the video has wins, in your order, for example en, es, pt-BR. Written captions beat auto-generated ones, and en also matches en-US and en-GB.

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

On: a video with none of your languages returns its transcript in the language spoken in the video, and counts as a transcript. Off, or when the spoken language cannot be told: a free language_not_available row that lists the languages it has.

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

On: every row has the segments list with start time and duration in seconds. Off: plain text only, for smaller rows.

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

Adds srt, vtt or both as text to every row. The plain text is always there.

## `includeVideoDetails` (type: `boolean`):

Adds description, tags, publish date, category and likes to every row at no extra charge. Off: title, channel, duration and views only.

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

YouTube limits how many transcripts one address may fetch. The default is residential proxies, a pool large enough for big runs, and the Actor moves to a new address when one is blocked. Datacenter proxies work for a few dozen videos and are refused by YouTube in larger runs.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=arj7oStGLkU"
  ],
  "maxVideosPerSource": 20,
  "onlyNew": false,
  "languages": [
    "en"
  ],
  "fallbackToAnyLanguage": true,
  "includeTimestamps": true,
  "outputFormats": [],
  "includeVideoDetails": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

One row per video: text, timestamped segments, optional SRT and VTT, language and video details. A video without a transcript is a free row with status error, an error_code and one sentence in error.

## `summary` (type: `string`):

Transcripts returned, counts by error_code, and videos skipped by the date filter.

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

// Run the Actor and wait for it to finish
const run = await client.actor("data-for-agents/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 = {
    "videoUrls": ["https://www.youtube.com/watch?v=arj7oStGLkU"],
    "languages": ["en"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("data-for-agents/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 '{
  "videoUrls": [
    "https://www.youtube.com/watch?v=arj7oStGLkU"
  ],
  "languages": [
    "en"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call data-for-agents/youtube-transcripts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data-for-agents/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/AhjPjcapVefPJfh4O/builds/RTgsgzO5fDGXIoOrh/openapi.json
