# YouTube Transcript Scraper: Captions, SRT & Translation (`webify-lab/youtube-transcript-scraper`) Actor

YouTube transcripts in bulk: plain text, timestamped segments, 60-second chunks, SRT and VTT, with video metadata. Preferred languages, manual over auto captions, YouTube translation. Only charged when a transcript is delivered.

- **URL**: https://apify.com/webify-lab/youtube-transcript-scraper.md
- **Developed by:** [Batu T.](https://apify.com/webify-lab) (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

from $1.40 / 1,000 transcript scrapeds

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

## YouTube Transcript Scraper: Captions, Subtitles, SRT & Translation

Get the transcript of any YouTube video with captions as clean text, timestamped segments, SRT or VTT. Bulk-friendly: paste hundreds of video URLs. Built for low cost: requests go out directly and switch to a residential proxy only when YouTube starts blocking.

### Output per video

| field | meaning |
|---|---|
| `text` | the full transcript as plain text with paragraph breaks at pauses |
| `segments` | `start`, `duration` (seconds) and `text` per caption line |
| `chunks` | the transcript grouped into blocks of about 60 seconds, handy for LLMs and quotes with timestamps |
| `srt`, `vtt` | ready-to-use subtitle files |
| `languageCode`, `isGenerated`, `isTranslated` | which caption track was used |
| `availableLanguages` | every caption track the video offers |
| `title`, `channelName`, `channelId`, `durationSeconds`, `viewCount`, `publishDate`, `keywords`, `thumbnail` | video metadata |
| `wordCount`, `segmentCount` | size of the transcript |

### Languages and translation

- `languages`: preferred languages in order, for example `de`, `en`. Manual captions win over auto-generated ones in the same language. Add `*` to fall back to any language.
- `translateTo`: if none of your languages exists, YouTube's own machine translation into this language is used.

### Accepted inputs

Video IDs, watch URLs, youtu.be links, Shorts, live and embed URLs.

### Pricing

You pay per transcript delivered. Videos without captions, private or unavailable videos are not charged.

### Limits

Only videos that have captions (manual or auto-generated) can be transcribed. Age-restricted and members-only videos are not supported.

Not affiliated with YouTube or Google.

### FAQ

**What am I charged for?** One event per video with a delivered transcript. Error items (no captions, video not playable, invalid URL, blocked after retries) are not charged.

**Do I need a proxy?** Not usually. With the default `proxyStrategy` `auto` requests go out directly, and the run switches to the configured proxy (residential by default) only when YouTube blocks with HTTP 429 or a bot check. `direct` never uses a proxy, `proxy` always does.

**Do I need a YouTube login or API key?** No. The Actor reads public caption tracks and does not log in, so age-restricted and members-only videos are not supported.

**Which output formats can I get?** `segments` and `text` by default. Add `chunks`, `srt` or `vtt` in `outputFormats`; each format is a separate field on the same dataset item.

**How many videos can one run handle?** Up to `maxVideos` (default 10000) after duplicates are removed, with `concurrency` up to 20 videos in parallel (default 5).

### Use with AI agents (MCP)

This Actor works as a tool for Claude, ChatGPT, Cursor and other MCP clients through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp). Add only this Actor:

```
https://mcp.apify.com?tools=webify-lab/youtube-transcript-scraper
```

On first use the server signs you in with OAuth. Alternatively send the header `Authorization: Bearer <APIFY_TOKEN>`. Agents on the default Apify MCP setup can also find this Actor with `search-actors` and run it with `call-actor`. Pricing is the same as in Apify Console: you pay per result.

# Actor input Schema

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

YouTube video URLs or IDs (watch, youtu.be, Shorts, live, embed).

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

Language codes in order of preference, e.g. de, en. Add \* to accept any language. Empty takes the video's main track.

## `preferManual` (type: `boolean`):

Use human-made captions over auto-generated ones in the same language.

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

If none of the preferred languages exists, use YouTube's translation into this language (e.g. en).

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

What to include per video.

## `chunkSeconds` (type: `integer`):

Length of one block in the chunks format.

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

Title, channel, duration, views, publish date, keywords, thumbnail.

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

Videos processed at the same time.

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

Safety limit per run.

## `proxyStrategy` (type: `string`):

Automatic keeps costs low and switches to the proxy when YouTube blocks.

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

Used when YouTube blocks direct requests. Residential works best.

## `maxRetries` (type: `integer`):

Retries per request when blocked.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "languages": [],
  "preferManual": true,
  "translateTo": "",
  "outputFormats": [
    "text",
    "segments"
  ],
  "chunkSeconds": 60,
  "includeMetadata": true,
  "concurrency": 5,
  "maxVideos": 10000,
  "proxyStrategy": "auto",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "maxRetries": 4
}
```

# Actor output Schema

## `results` (type: `string`):

One item per video: videoId, url, title, channelName, channelId, durationSeconds, viewCount, publishDate, keywords, thumbnail, availableLanguages, language, languageCode, isGenerated, isTranslated, segmentCount, wordCount, text, segments, chunks, srt, vtt; or error.

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

// Run the Actor and wait for it to finish
const run = await client.actor("webify-lab/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"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("webify-lab/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"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call webify-lab/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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