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

Get YouTube transcripts as timed segments or plain text, plus title, channel, duration and views. Works on videos, Shorts, playlists and channels; picks your preferred caption language. No browser, no API key. Videos without captions are not charged.

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

## Pricing

Pay per event

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

Turn YouTube videos into text. Give the actor video links, Shorts links, video IDs, playlists or whole channels and get **one JSON row per video** with the transcript as timed segments or plain text, the caption language that was used, and the video's title, channel, duration and view count. It reads YouTube the way the mobile app does, so it **needs no browser and no API key**. It runs through Apify's residential proxy by default, because YouTube asks datacenter IPs to sign in.

Built for AI and LLM pipelines (RAG over video libraries, summarisation, fine-tuning data), content teams repurposing videos into articles and posts, researchers building interview or lecture corpora, SEO tools mining spoken keywords, and accessibility work.

Three things set it apart from other transcript scrapers:

- **You know what happened to every video.** Videos without captions, private, removed or age-restricted videos still get a row, with `transcript: null` and an `error` code such as `no_captions` or `video_unavailable`. Those rows are not charged as transcripts.
- **Language control.** Pass a preference list (`["en", "es"]`): the actor picks the first match, prefers a human-made track over the auto-generated one, and tells you which track it used (`language`, `isAutoGenerated`) and which others exist (`availableLanguages`).
- **Playlists and channels in one input.** A playlist or channel URL is expanded to its videos (newest first) with one request per 100 videos.

### What you get

One row per video.

| Field | Description |
| --- | --- |
| `videoId`, `url` | The video and its watch URL |
| `title`, `channelName`, `channelId`, `channelUrl` | Video and channel identity |
| `durationSeconds`, `viewCount`, `isLive`, `thumbnailUrl`, `keywords`, `description` | Video metadata (switch off with `includeMetadata: false`) |
| `transcript` | Array of `{start, duration, text}` in seconds (`outputFormat: segments`, default) or one string (`text`); `null` when the video has no usable captions |
| `transcriptText` | The joined text, only with `outputFormat: both` |
| `language`, `languageName`, `isAutoGenerated` | Which caption track was used and whether YouTube generated it automatically |
| `availableLanguages` | Every caption track of the video: `[{code, name, kind}]` (`kind` is `manual` or `asr`) |
| `isTranslated`, `translationError` | Result of the optional `translateTo` request |
| `segmentCount`, `wordCount` | Size of the transcript |
| `error`, `errorReason` | `null` on success; otherwise `no_captions`, `language_not_available`, `video_unavailable`, `private`, `age_restricted`, `live`, `unplayable`, `bot_detected`, `rate_limited` or `fetch_failed`, plus YouTube's own message |
| `source` | The input line that produced the row (the playlist or channel URL for expanded videos) |
| `scrapedAt` | ISO-8601 UTC timestamp |

### Use cases

- **RAG and chat over video.** Pull a channel's transcripts with timestamps and index them; answers can link to `watch?v=ID&t=<start>`.
- **Video to blog, newsletter or social posts.** Fetch `outputFormat: text` for a playlist and hand the text to your writing model.
- **Research corpora.** Interviews, lectures, earnings calls and political speeches as clean text with speaker-free timing, in the language you need.
- **SEO and topic research.** Count what competitors actually say in their videos; `keywords` and `description` are included in every row.
- **Monitoring.** Schedule a run on a channel URL; the checkpoint makes a re-run with the same input skip videos already delivered.

### Input

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `videoUrls` | array | – | Video URLs (`watch?v=`, `youtu.be/`, `/shorts/`, `/embed/`, `/live/`), bare video IDs, playlist URLs or `PL…` IDs, channel URLs (`/@handle`, `/channel/UC…`, `/c/…`, `/user/…`). |
| `languages` | array | `["en"]` | Preferred caption languages in order. `en` also matches `en-US` and `en-GB`. |
| `fallbackToAnyLanguage` | boolean | `true` | Use the video's default track when none of the preferred languages exists. |
| `translateTo` | string | – | Ask YouTube to translate the chosen track (`de`, `en`, …). Best effort: YouTube throttles translations per IP, and the row falls back to the original language with `translationError: rate_limited`. |
| `outputFormat` | enum | `segments` | `segments`, `text` or `both`. |
| `includeMetadata` | boolean | `true` | Title, channel, duration, views, thumbnail, keywords, description. |
| `maxVideos` | integer | `100` | Cap on videos per run, including those expanded from playlists and channels. |
| `concurrency` | integer | `5` | Parallel videos (1–10). |
| `proxyConfiguration` | object | Apify residential | YouTube bot-checks datacenter IPs; keep residential unless you bring your own clean proxies. |

#### Example input

```json
{
    "videoUrls": [
        "https://www.youtube.com/watch?v=UF8uR6Z6KLc",
        "https://www.youtube.com/shorts/-_aMgxyQo_8",
        "https://www.youtube.com/playlist?list=PLbpi6ZahtOH6Blw3RGYpWkSByi_T7Rygb",
        "https://www.youtube.com/@TED"
    ],
    "languages": ["en"],
    "outputFormat": "segments",
    "maxVideos": 50
}
```

#### Example output row

```json
{
    "videoId": "UF8uR6Z6KLc",
    "url": "https://www.youtube.com/watch?v=UF8uR6Z6KLc",
    "title": "Steve Jobs' 2005 Stanford Commencement Address",
    "channelName": "Stanford",
    "channelId": "UC-EnprmCZ3OXyAoG7vjVNCA",
    "durationSeconds": 904,
    "viewCount": 49183529,
    "language": "en",
    "languageName": "English - English",
    "isAutoGenerated": false,
    "isTranslated": false,
    "isLive": false,
    "availableLanguages": [{"code": "ar", "name": "Arabic", "kind": "manual"}, {"code": "en", "name": "English (auto-generated)", "kind": "asr"}, {"code": "en", "name": "English - English", "kind": "manual"}],
    "transcript": [
        {"start": 7.47, "duration": 2.899, "text": "This program is brought to you by Stanford University."},
        {"start": 10.47, "duration": 3.973, "text": "Please visit us at stanford.edu"}
    ],
    "segmentCount": 244,
    "wordCount": 2298,
    "error": null,
    "errorReason": null,
    "source": "https://www.youtube.com/watch?v=UF8uR6Z6KLc",
    "scrapedAt": "2026-10-05T09:12:44Z"
}
```

A video without captions looks like `{"videoId": "aqz-KE-bpKQ", "title": "Big Buck Bunny 60fps 4K", "transcript": null, "error": "no_captions", ...}`.

### Scheduling, webhooks and integrations

Run it on a schedule with a channel URL to keep a transcript archive current; a re-run with the same input resumes from its checkpoint and skips videos it already delivered. Add a webhook on `ACTOR.RUN.SUCCEEDED` to push the dataset to your pipeline, or use the Apify integrations for Google Sheets, Make, Zapier, n8n and LangChain / LlamaIndex loaders.

### Use with AI assistants (MCP)

Through the Apify MCP server any MCP-capable assistant (Claude, Cursor, custom agents) can call this actor as a tool: "get the transcript of this YouTube video and summarise it". Input and output are plain JSON, so no glue code is needed.

### FAQ

**Which videos have transcripts?** Any video with captions: uploaded subtitles or YouTube's automatic speech recognition (available for most spoken-word videos in major languages a few hours after upload). Music videos, silent clips and videos whose owner disabled captions return `error: no_captions`.

**Are auto-generated transcripts punctuated?** No. YouTube's ASR tracks have no punctuation or speaker labels; manual tracks keep whatever the uploader wrote. `isAutoGenerated` tells you which one you got.

**Can I translate?** `translateTo` asks YouTube for its machine translation of the chosen track. YouTube rate-limits that path heavily, so treat it as a bonus: when it refuses, the row carries the original language and `translationError: rate_limited`. For reliable translation, feed the original text to your own translation model.

**Does it work for Shorts, live streams and premieres?** Shorts yes (same captions system). Live streams and premieres have no captions until the video is processed after the stream; they return `error: live` or `no_captions`.

**How fast is it and are there limits?** About 2 requests and 0.3–0.5 s per video; with the default concurrency of 5, a 1,000-video channel takes a few minutes. Age-restricted and private videos cannot be read without signing in and are reported as `age_restricted` / `private`.

**Is this legal?** The actor reads only publicly available caption data that YouTube serves to any viewer. You are responsible for how you use the text (copyright on the spoken content stays with its owner).

# Actor input Schema

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

YouTube video URLs (`watch?v=`, `youtu.be/`, `/shorts/`, `/embed/`, `/live/`), bare 11-character video IDs, playlist URLs or IDs (`PL…`), and channel URLs (`/@handle`, `/channel/UC…`, `/c/…`, `/user/…`). Playlists and channels are expanded to their videos (newest first for channels) up to **Max videos**.

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

Caption language codes in order of preference, e.g. `en`, `es`, `de`, `pt-BR`, `zh-Hans`. `en` also matches `en-US` / `en-GB`. A manually created track is preferred over the auto-generated one in the same language.

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

When none of the preferred languages exists, return the video's default caption track instead of `error: language_not_available`. The row's `language` field tells you what you got.

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

Optional target language code (e.g. `en`). Uses YouTube's own caption translation. YouTube throttles translation requests heavily per IP, so when it refuses the row falls back to the original language with `translationError: rate_limited`.

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

`segments`: `transcript` is an array of `{start, duration, text}` (seconds). `text`: `transcript` is one joined string. `both`: `transcript` holds the segments and `transcriptText` the joined string.

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

Add title, channel name and id, duration, view count, thumbnail, keywords and description to every row (no extra request).

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

Upper bound on videos processed in one run, including videos expanded from playlists and channels. You pay only for videos that return a transcript.

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

Parallel videos (1–10). 5 processes roughly 5–8 videos per second without triggering YouTube's rate limit.

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

YouTube asks datacenter IPs, including Apify's own servers, to sign in (`bot_detected`). Residential proxies are on by default; keep them unless you supply your own clean IPs.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=UF8uR6Z6KLc",
    "https://youtu.be/dQw4w9WgXcQ",
    "https://www.youtube.com/shorts/-_aMgxyQo_8"
  ],
  "languages": [
    "en"
  ],
  "fallbackToAnyLanguage": true,
  "outputFormat": "segments",
  "includeMetadata": true,
  "maxVideos": 100,
  "concurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `transcripts` (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 = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=UF8uR6Z6KLc",
        "https://youtu.be/dQw4w9WgXcQ",
        "https://www.youtube.com/shorts/-_aMgxyQo_8"
    ],
    "languages": [
        "en"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

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

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

```

## MCP server setup

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