# YouTube Transcript Scraper (`steadyscrape/youtube-transcript-scraper`) Actor

Transcripts of YouTube videos, playlists and whole channels in the language you ask for, with timestamps, SRT/VTT and video metadata. Every video gets a row that says why when there is no transcript. No login, no browser.

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

## Pricing

$5.00 / 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 Scraper

Get the transcript of any YouTube video, playlist or channel: the language you ask for, timestamps, SRT and WebVTT, and the video's metadata. **Every video you ask for comes back as a row**, and when there is no transcript the row says why (`no_captions`, `age_restricted`, `unavailable`…) instead of leaving you guessing. You pay only for rows that carry a transcript.

No login, no cookies, no browser: it calls the same API the YouTube apps use.

### What you get

For each video, one row with:

- **The transcript** as plain `text`, as timed `segments` (`start` and `duration` in seconds), and optionally as `srt` and `vtt` files ready to save.
- **Which track was read**: `language`, `languageName`, `isAutoGenerated`, and `availableLanguages` (every caption track the video has, so you can ask again for another one).
- **The video**: title, channel name and id, duration, views, likes, publish date, category, description, keywords, thumbnail.
- **`status` and `reason`**: `ok`, `no_captions`, `language_missing`, `unavailable`, `age_restricted`, `login_required`, or `blocked`.

### Input

| field | what it does |
|---|---|
| `urls` | Videos (any link shape or bare id), playlists (link or id) and channels (`@handle`, `/channel/UC…`, `/c/…`, `/user/…`). |
| `language` | Caption language code, e.g. `en`, `es`, `pt-BR`. `pt` matches `pt-BR`. Empty: the track YouTube shows by default. |
| `whenLanguageMissing` | `default-track` (read the video's default track; the row tells which) or `skip` (row with status `language_missing` and the languages it has). |
| `preferAutoGenerated` | Read the auto-generated track even when a manual one exists in that language. |
| `formats` | Any of `text`, `segments`, `srt`, `vtt`. Default: text and segments. |
| `maxVideosPerSource` | How many videos to take from each playlist or channel (newest first for channels). Default 100. |
| `residentialFallback` | Retry a video YouTube refused from datacenter IPs through a residential proxy. Default on. |

```json
{
    "urls": ["https://www.youtube.com/watch?v=Ks-_Mh1QhMc", "https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab", "@TED"],
    "language": "en",
    "formats": ["text", "segments", "srt"],
    "maxVideosPerSource": 50
}
```

### Output example

```json
{
    "videoId": "jNQXAC9IVRw",
    "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "status": "ok",
    "reason": null,
    "title": "Me at the zoo",
    "channelName": "jawed",
    "channelId": "UC4QobU6STFB0P71PMvOGN5A",
    "durationSeconds": 19,
    "viewCount": 432880329,
    "likeCount": 19864845,
    "publishDate": "2005-04-23T20:31:52-07:00",
    "category": "Film & Animation",
    "description": "…",
    "keywords": ["me at the zoo", "jawed karim", "first youtube video"],
    "thumbnailUrl": "https://i.ytimg.com/vi/jNQXAC9IVRw/sddefault.jpg",
    "isLive": false,
    "requestedLanguage": "en",
    "language": "en",
    "languageName": "English",
    "isAutoGenerated": false,
    "availableLanguages": [{ "code": "en", "name": "English", "autoGenerated": false }, { "code": "de", "name": "German", "autoGenerated": false }],
    "text": "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 and that's cool …",
    "segments": [{ "start": 1.2, "duration": 2.16, "text": "All right, so here we are, in front of the elephants" }],
    "srt": null,
    "vtt": null,
    "source": { "type": "video", "id": "jNQXAC9IVRw" }
}
```

A video without a transcript still gets its row:

```json
{ "videoId": "hY7m5jjJ9mM", "status": "no_captions", "reason": "The video has no captions", "title": "CATS will make you LAUGH YOUR HEAD OFF - Funny CAT compilation", "availableLanguages": [], "text": null, "segments": null }
```

The run's `SUMMARY` record lists how many videos each playlist or channel gave, the rows per status, and any playlist or channel that could not be read.

### Why this one

The complaints on other transcript scrapers are always the same, and each one has an answer here:

- **"Returned nothing" / "no captions found" on a video that has captions.** That is usually YouTube's bot check on a datacenter IP being reported as "no captions". This Actor tells the two apart: it retries a refused video on another IP class (direct, datacenter proxy, residential proxy), and only says `no_captions` when YouTube itself lists no track. If every route is refused the row says `blocked`, uncharged.
- **"The language parameter is ignored."** The requested language is honored, a short code finds the regional track, and the row states which track was actually read and which ones exist. You choose whether a missing language falls back or skips.
- **"Could not extract the video id."** Every link shape works: `watch?v=`, `youtu.be`, Shorts, live, embed, mobile, music, links with playlist parameters, and bare ids.
- **Charged for failures.** Only rows with a transcript are charged.
- **Playlists and channels.** One line expands to up to `maxVideosPerSource` videos; duplicates across your list are scraped once.

### Pricing

Pay per transcript delivered. Rows with any other status are free. A run of 100 videos usually takes under a minute.

### Limits and notes

- Auto-translated captions are not available through this API; the transcript comes in the languages the video has.
- Age-restricted, private and members-only videos need a signed-in account, which this Actor does not use: they get a row with the reason.
- Live streams in progress have no transcript until YouTube publishes the recording's captions.
- Transcripts are provided for analysis, research, accessibility and indexing. Respect YouTube's terms and the creators' rights in how you use them.

# Actor input Schema

## `urls` (type: `array`):

One per line: a video link in any shape (<code>watch?v=</code>, <code>youtu.be</code>, Shorts, live, embed) or a bare video id; a playlist link or id; a channel link (<code>@handle</code>, <code>/channel/UC…</code>, <code>/c/</code>, <code>/user/</code>) or a bare <code>@handle</code>. A playlist or channel expands to its videos, newest first for channels.

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

Caption language to read, as a code (<code>en</code>, <code>es</code>, <code>pt-BR</code>). A short code matches a regional track (<code>pt</code> finds <code>pt-BR</code>). Empty: the track YouTube shows by default for the video.

## `whenLanguageMissing` (type: `string`):

What to do with a video that has captions but none in the requested language. Either read its default track (the row's <code>language</code> tells which one) or skip it with status <code>language\_missing</code> and the languages it does have.

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

When a video has both a manual and an auto-generated track in the language, read the auto-generated one. Off: the manual one wins, auto-generated is the fallback.

## `formats` (type: `array`):

Which renderings of the transcript to include in each row: plain <code>text</code>, timed <code>segments</code> (start and duration in seconds), <code>srt</code> and <code>vtt</code> subtitle files as strings.

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

Stop expanding each playlist or channel after this many videos. Videos given directly are not counted.

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

YouTube lets about half of datacenter IPs through. A video refused on the direct route and on a datacenter proxy is retried through Apify's residential proxy (a few KB per video, charged by Apify as proxy traffic). Off: such videos end with status <code>blocked</code>.

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=Ks-_Mh1QhMc",
    "https://youtu.be/jNQXAC9IVRw"
  ],
  "language": "en",
  "whenLanguageMissing": "default-track",
  "preferAutoGenerated": false,
  "formats": [
    "text",
    "segments"
  ],
  "maxVideosPerSource": 100,
  "residentialFallback": true
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "urls": [
        "https://www.youtube.com/watch?v=Ks-_Mh1QhMc",
        "https://youtu.be/jNQXAC9IVRw"
    ],
    "language": "en",
    "formats": [
        "text",
        "segments"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("steadyscrape/youtube-transcript-scraper").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 = {
    "urls": [
        "https://www.youtube.com/watch?v=Ks-_Mh1QhMc",
        "https://youtu.be/jNQXAC9IVRw",
    ],
    "language": "en",
    "formats": [
        "text",
        "segments",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("steadyscrape/youtube-transcript-scraper").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 '{
  "urls": [
    "https://www.youtube.com/watch?v=Ks-_Mh1QhMc",
    "https://youtu.be/jNQXAC9IVRw"
  ],
  "language": "en",
  "formats": [
    "text",
    "segments"
  ]
}' |
apify call steadyscrape/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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

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/SF0NzAIxc5P4gbcfL/builds/StZLVOnc8DR5B0qKv/openapi.json
