# YouTube Transcript Scraper — Multi-Client Fallback (`steadyapi/youtube-transcript-scraper`) Actor

Get YouTube transcripts and subtitles reliably. Four InnerTube clients with automatic fallback, json3 + XML parsing, SRT/VTT/plain text output. No browser, no proxy needed.

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

## Pricing

from $2.00 / 1,000 results

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 — Multi-Client Fallback

Pull transcripts and subtitles from any YouTube video. Watch pages, `youtu.be` links, Shorts, live replays and bare video IDs all work.

Output as **timed segments, plain text, SRT or WebVTT** — or all four at once.

***

### Why another transcript Actor

Because the popular ones still fail, and they fail for a reason you can fix.

YouTube serves its player data through **InnerTube**, the private API its own apps use. Every client — iOS, Android, mobile web, desktop web — gets a slightly different response, and YouTube gates them independently. Measured on 2026-09-15 against the same video:

| Client | Caption tracks | Transcript body |
| --- | --- | --- |
| `ANDROID` | returned 6 tracks | served XML only, `fmt=json3` ignored |
| `IOS` | returned 6 tracks | clean `json3`, 61 segments |

**If your scraper speaks one client and that client is gated today, your run returns nothing.**

This Actor tries **four clients in order** (`IOS` → `ANDROID` → `MWEB` → `WEB`) and parses **both** `json3` and the legacy XML caption format. Every row tells you which client actually resolved it, in `resolvedWith`.

### What you get

- **Four-client fallback.** One gated client does not end the run.
- **Two caption parsers.** `json3` first, XML second. Format changes do not break you.
- **No browser, no proxy required.** Direct API calls. Runs are fast and cheap, and a proxy is optional rather than mandatory.
- **Every language the video has.** `availableLanguages` lists all tracks with auto-generated flags, so you can see what else you could have pulled.
- **Honest failures.** A missing video returns a row with `errorType`, not a dead run. `NO_CAPTIONS`, `VIDEO_UNAVAILABLE`, `INVALID_INPUT`, `FETCH_FAILED`.
- **You are not charged for failed videos.**
- **`RUN_SUMMARY`** in the key-value store: `requested`, `succeeded`, `failed`, `successRate`.

### Input

| Field | Type | Default | Notes |
| --- | --- | --- | --- |
| `videos` | array | required | URLs or 11-char IDs. Watch, `youtu.be`, `/shorts/`, `/live/`, `/embed/` all parsed |
| `startUrls` | array | `[]` | Same thing in Apify request-list format, if you prefer it |
| `preferredLanguages` | array | `["en"]` | In order of preference. Manual captions win over auto-generated |
| `translateTo` | string | `""` | YouTube-side auto-translation, e.g. `ko`. Empty keeps the original |
| `outputFormat` | string | `segments` | `segments`, `text`, `srt`, `vtt`, or `all` |
| `includeMetadata` | boolean | `true` | Title, channel, duration, views, description, thumbnail |
| `maxConcurrency` | integer | `5` | 1-10 |
| `proxyConfiguration` | object | optional | Not needed for normal volumes |

#### Example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/jNQXAC9IVRw",
    "https://www.youtube.com/shorts/tPEE9ZwTmy0",
    "kJQP7kiw5Fk"
  ],
  "preferredLanguages": ["en", "ko"],
  "outputFormat": "all"
}
```

### Output

```json
{
  "videoId": "jNQXAC9IVRw",
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "title": "Me at the zoo",
  "channelName": "jawed",
  "durationSeconds": 19,
  "viewCount": 430401896,
  "language": "en",
  "isAutoGenerated": false,
  "availableLanguages": [
    { "code": "en", "name": "English", "auto": false },
    { "code": "de", "name": "German", "auto": false }
  ],
  "segmentCount": 6,
  "characterCount": 212,
  "resolvedWith": "IOS",
  "segments": [
    { "start": 1.2, "duration": 2.16, "text": "All right, so here we are, in front of the elephants" }
  ],
  "text": "All right, so here we are, in front of the elephants ...",
  "srt": "1\n00:00:01,200 --> 00:00:03,360\nAll right, so here we are...",
  "vtt": "WEBVTT\n\n00:00:01.200 --> 00:00:03.360\n..."
}
```

Failed rows look like this instead:

```json
{
  "videoId": "ZZZZZZZZZZZ",
  "error": "Video could not be opened (tried: IOS:ERROR, ANDROID:ERROR, MWEB:ERROR, WEB:ERROR)",
  "errorType": "VIDEO_UNAVAILABLE"
}
```

The `tried:` list tells you exactly which clients were attempted and what each said. No guessing.

### Common uses

- Feed video content into an LLM for summaries, chapters or Q\&A
- Build searchable archives of a channel
- Generate SRT files for re-uploading or translation
- Content research: what a competitor actually says, not just their title

### Notes

- **Not every video has captions.** Music videos, many Shorts and some regional uploads have none. Those return `NO_CAPTIONS` rather than pretending.
- **Auto-generated captions have no punctuation** and mis-hear proper nouns. `isAutoGenerated` tells you which you got, so you can decide whether to clean it.
- `translateTo` uses YouTube's own machine translation. Quality varies.
- Private, deleted, members-only and some age-restricted videos cannot be read by anyone without login, and this Actor does not attempt to log in.

### Legal

Only publicly available caption data is requested, through the same endpoints YouTube's own clients use. No login, no DRM circumvention, no video or audio download.

# Actor input Schema

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

Video URLs or 11-character video IDs. Watch pages, youtu.be links, Shorts and /live/ links all work.

## `startUrls` (type: `array`):

Same as above, in Apify request-list format. Use either field.

## `preferredLanguages` (type: `array`):

Language codes in order of preference, e.g. en, ko, es. Falls back to any available track.

## `translateTo` (type: `string`):

Optional. YouTube-side auto-translation, e.g. 'ko'. Leave empty for the original language.

## `outputFormat` (type: `string`):

How the transcript is returned. "All" includes segments, plain text, SRT and VTT in one row.

## `includeMetadata` (type: `boolean`):

Title, channel, duration, view count, description, thumbnail.

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

How many videos to fetch in parallel.

## `requestDelayMs` (type: `integer`):

Pause between parallel batches. Raise it only if you process thousands of videos in one run.

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

Optional. This Actor works without a proxy. Add one only if you scrape at very high volume.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "startUrls": [],
  "preferredLanguages": [
    "en"
  ],
  "translateTo": "",
  "outputFormat": "segments",
  "includeMetadata": true,
  "maxConcurrency": 5,
  "requestDelayMs": 250,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One row per video: transcript segments or text/SRT/VTT, plus video metadata and the InnerTube client that resolved it.

## `runSummary` (type: `string`):

requested / succeeded / failed / successRate for the whole run.

# 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=dQw4w9WgXcQ"
    ]
};

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,steadyapi/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/6eK0LrkglxH8ARc1T/builds/0Za8qdfwDnvrdfFD7/openapi.json
