# YouTube Transcript Scraper - Videos & Whole Channels (`criatolabs/youtube-transcript-scraper`) Actor

Get transcripts/captions of YouTube videos or entire channels as clean text, timed segments or SRT. Language preference, auto-captions and translation. No API key, no Actor fee.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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: videos and whole channels, text, segments and SRT

Get the transcript of any YouTube video, or of a channel's latest videos, as **clean text**, **timed segments** or a **ready-made SRT** subtitle file. You choose your preferred languages, and can use YouTube's auto-captions or its built-in translation.

There's **no Actor fee**: you only pay Apify platform usage. In our test that was **about $0.45 per 1,000 transcripts**, residential proxy included. You also don't need an API key.

### What you get

- 📝 **The full transcript as one clean string**, ready for summarization, RAG or embeddings
- ⏱️ **Timed segments** (`start`, `duration`, `text`) and an optional **SRT** subtitle file
- 🌍 **Language preference**: manual captions first, then auto-generated, then any available language (each step is configurable)
- 🔁 **Translation** of the captions into any language, using YouTube's own machine translation
- 📺 **Whole channels**: give a @handle and get transcripts of its latest videos
- 📊 **Video details** with every transcript: title, channel, length, **exact view count** and every caption language available
- ✅ **A clear status for every video**: `OK`, `NO_TRANSCRIPT`, `NO_MATCHING_LANGUAGE`, `AGE_RESTRICTED`, `VIDEO_UNAVAILABLE`, `LIVE_STREAM`, `EMPTY_TRANSCRIPT` or `FAILED`

### Tested at scale

**40 transcripts out of 40 videos** came back in **106 seconds**, from single videos plus two whole channels. That used **$0.018** of platform usage.

### Use cases

- **AI and RAG:** turn a channel into a searchable knowledge base.
- **Content repurposing:** turn videos into blog posts, newsletters, threads or chapters.
- **Research and monitoring:** analyze what creators, competitors or experts actually say.
- **Subtitles:** download SRT files, optionally translated.

### Input

```json
{
  "videoUrls": ["https://www.youtube.com/watch?v=aircAruvnKk", "jNQXAC9IVRw"],
  "channels": ["@kurzgesagt"],
  "maxVideosPerChannel": 20,
  "preferredLanguages": ["en", "pt"],
  "allowAutoGenerated": true,
  "fallbackToAnyLanguage": true,
  "translateTo": "",
  "includeSegments": true,
  "includeSrt": false
}
```

### Output

```json
{
  "videoId": "aircAruvnKk",
  "title": "But what is a neural network? | Deep learning chapter 1",
  "channelName": "3Blue1Brown",
  "lengthSeconds": 1120,
  "viewCount": 25097073,
  "status": "OK",
  "languageCode": "en",
  "isAutoGenerated": false,
  "isTranslated": false,
  "wordCount": 3357,
  "text": "This is a 3. It's sloppily written and rendered at an extremely low resolution of 28x28...",
  "segments": [
    {
      "start": 4.22,
      "duration": 1.18,
      "text": "This is a 3."
    }
  ],
  "availableLanguages": [
    {
      "languageCode": "ar",
      "language": "Arabic",
      "isAutoGenerated": false
    },
    {
      "languageCode": "bn",
      "language": "Bangla",
      "isAutoGenerated": false
    }
  ]
}
```

### Why residential proxy?

YouTube shows a "confirm you're not a bot" check to caption requests from cloud and datacenter IPs. That's why the Actor uses Apify residential proxy by default and rotates IPs automatically. Responses are small, so the proxy costs fractions of a cent per video.

### Pricing

This Actor has no fee of its own: you pay only Apify platform usage, meaning compute and residential proxy. In our test, 40 transcripts cost $0.018.

### More YouTube and trends tools from Criato Labs

- [YouTube Channel & Video Scraper](https://apify.com/criatolabs/youtube-channel-scraper): channel profiles, videos, Shorts and keyword search
- [YouTube Comments Scraper](https://apify.com/criatolabs/youtube-comments-scraper): comments and replies
- [Google Trends Batch Scraper](https://apify.com/criatolabs/google-trends-batch-scraper): including YouTube Search trends

### FAQ

**What if a video has no captions?** You'll get a row with `status: NO_TRANSCRIPT`. Videos without speech, or whose creator turned off auto-captions, have none.

**Does it transcribe audio itself (Whisper)?** No. It returns YouTube's own captions, manual or auto-generated, which covers the vast majority of spoken videos.

**Can I get transcripts in another language?** Yes. Set `translateTo` (for example `en`) to use YouTube's machine translation of the original captions.

# Actor input Schema

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

YouTube video, Shorts or youtu.be links, or 11-character video IDs. One per line.

## `channels` (type: `array`):

Channel URLs, @handles or IDs. Fetches transcripts of the channel's latest videos.

## `maxVideosPerChannel` (type: `integer`):

Newest videos first.

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

Language codes in order of preference (en, pt, es...). Manual captions are preferred over auto-generated ones.

## `allowAutoGenerated` (type: `boolean`):

Use YouTube's automatic (speech recognition) captions when no manual captions exist.

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

If none of the preferred languages exist, return the transcript in whatever language is available.

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

Language code for YouTube's own machine translation of the captions, e.g. 'en' or 'pt'. Leave empty for the original.

## `includeSegments` (type: `boolean`):

Each caption line with its start time and duration (in addition to the full text).

## `includeSrt` (type: `boolean`):

Adds an 'srt' field with ready-to-use subtitle file content.

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

YouTube blocks caption requests from datacenter IPs, so residential proxy is the default. IPs rotate automatically.

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

How many videos are processed at the same time.

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

Attempts on a new IP when YouTube shows a bot check.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "maxVideosPerChannel": 20,
  "preferredLanguages": [
    "en"
  ],
  "allowAutoGenerated": true,
  "fallbackToAnyLanguage": true,
  "includeSegments": true,
  "includeSrt": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "maxConcurrency": 5,
  "maxRetries": 6
}
```

# Actor output Schema

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

One item per video, with status OK or the reason a transcript was not available.

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

Counts by status, blocks handled and data transferred.

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

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

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

```

## MCP server setup

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