# YouTube Transcript Scraper (Multiple Language) (`dead00/youtube-transcript-scraper-multiple-language`) Actor

A powerful actor that extracts transcripts/captions from YouTube videos with built-in translation support for 100+ languages.

- **URL**: https://apify.com/dead00/youtube-transcript-scraper-multiple-language.md
- **Developed by:** [Dead](https://apify.com/dead00) (community)
- **Categories:** Videos, Developer tools, AI
- **Security:** Limited permissions
- **Stats:** 4 total users, 0 monthly users, 96.8% 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

A powerful actor that extracts transcripts/captions from YouTube videos with built-in translation support for 100+ languages.

### 🌟 Features

- **Extract YouTube Transcripts**: Get captions/subtitles from any YouTube video
- **Multi-Language Translation**: Translate transcripts to 100+ languages using free Google Translate
- **Batch Processing**: Process multiple videos in a single run
- **Smart Caption Selection**: Automatically finds the best available captions
- **Multiple Output Formats**: Get results in JSON or plain text format
- **Proxy Support**: Built-in Apify proxy support to avoid IP blocking
- **Fast Translation**: Optimized batch translation for speed (5-10x faster than individual translation)
- **Progress Tracking**: Clean progress indicators to monitor translation status

### 📋 Input

The actor accepts the following input parameters:

#### Required Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `videos` | Array of strings | List of YouTube video URLs or video IDs |

#### Optional Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `translate_to` | String | `""` (none) | Target language code for translation (e.g., "en", "es", "hi"). Leave empty for original language |
| `output_format` | String | `"json"` | Output format: `"json"` (structured) or `"txt"` (plain text) |
| `proxyConfiguration` | Object | Residential proxy enabled | Proxy settings for YouTube requests |
| `delay_seconds` | Integer | `2` | Delay in seconds between processing videos (0-60) |

### 🚀 Usage

#### Input Example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/jNQXAC9IVRw",
    "dQw4w9WgXcQ"
  ],
  "translate_to": "en",
  "output_format": "json",
  "delay_seconds": 2
}
```

#### Output Example (JSON Format)

```json
{
  "video_id": "dQw4w9WgXcQ",
  "video_url": "https://youtube.com/watch?v=dQw4w9WgXcQ",
  "transcript": [
    {
      "text": "We're no strangers to love",
      "start": 0.0,
      "duration": 3.5
    },
    {
      "text": "You know the rules and so do I",
      "start": 3.5,
      "duration": 4.2
    }
  ],
  "output_format": "json",
  "metadata": {
    "available_languages": [
      {
        "language": "English",
        "code": "en",
        "type": "auto-generated"
      }
    ],
    "selected_language": "en",
    "translated_to": "es",
    "translation_attempted": true,
    "translation_success": true,
    "translation_method": "Google Translate (deep-translator)"
  },
  "status": "success"
}
```

#### Output Example (Text Format)

```json
{
  "video_id": "dQw4w9WgXcQ",
  "video_url": "https://youtube.com/watch?v=dQw4w9WgXcQ",
  "transcript": "We're no strangers to love\nYou know the rules and so do I\nA full commitment's what I'm thinking of...",
  "output_format": "txt",
  "metadata": { ... },
  "status": "success"
}
```

#### And 80+ more languages!

\[See full language list in the input schema]

### 🔧 How It Works

1. **Video Processing**: The actor extracts video IDs from URLs or accepts direct video IDs
2. **Caption Discovery**: Searches for available captions/transcripts in the video
3. **Caption Retrieval**: Fetches the best available caption (auto-generated or manual)
4. **Translation** (if enabled): Translates captions using Google Translate API
   - Uses batch translation for speed (20 segments per batch)
   - Progress tracking at 10%, 25%, 50%, 75%, 90%, 100%
   - Fallback to individual translation if batch fails
5. **Output Formatting**: Returns data in JSON or text format

### ⚡ Performance

- **Without Translation**: ~1-2 seconds per video
- **With Translation**:
  - Small videos (50-100 segments): ~5-10 seconds
  - Medium videos (500-1000 segments): ~30-60 seconds
  - Large videos (2000+ segments): ~2-3 minutes

**Optimization**: Batch translation makes it **5-10x faster** than translating individual segments!

### 🛡️ Proxy Configuration

#### Recommended Settings (Default)

```json
{
  "useApifyProxy": true,
  "apifyProxyGroups": ["RESIDENTIAL"],
  "apifyProxyCountry": "US"
}
```

**Why use proxies?**

- YouTube may block IP addresses making too many requests
- Residential proxies are recommended to avoid detection
- The actor rotates proxies between videos automatically

### 📊 Use Cases

- **Content Analysis**: Analyze video content at scale
- **Accessibility**: Create captions for videos that don't have them
- **Translation**: Translate video content to reach global audiences
- **Research**: Extract data from educational or documentary videos
- **SEO**: Generate text content from video for search optimization
- **Subtitles**: Create subtitle files for videos
- **Data Mining**: Extract information from video tutorials or courses

### ⚠️ Limitations

1. **Caption Availability**: Videos must have captions/subtitles available (auto-generated or manual)
2. **Translation Quality**: Uses Google Translate - quality varies by language pair
3. **Rate Limiting**: Free Google Translate may have rate limits for heavy usage
4. **Video Access**: Cannot access private or age-restricted videos
5. **Disabled Captions**: Some videos have captions disabled by the creator

### 🐛 Error Handling

The actor handles various error cases:

| Error | Reason | Solution |
|-------|--------|----------|
| "Transcripts disabled" | Video creator disabled captions | Try another video |
| "Video unavailable" | Video is private/deleted | Check video URL |
| "No transcripts available" | No captions exist for this video | YouTube may add auto-captions later |
| "Translation failed" | Translation service error | Original captions will be returned |

### 💡 Tips for Best Results

1. **Use Residential Proxies**: Prevents IP blocking from YouTube
2. **Add Delay Between Videos**: Set `delay_seconds` to 2-5 for better reliability
3. **Batch Processing**: Process multiple videos in one run for efficiency
4. **Check Metadata**: The output includes info about available languages and translation status
5. **JSON Format**: Use JSON format if you need timestamps and structured data
6. **Text Format**: Use text format for simple transcript reading

# Actor input Schema

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

List of YouTube video URLs or video IDs to scrape transcripts from

## `output_format` (type: `string`):

Format for the transcript output

## `translate_to` (type: `string`):

Select a language to translate captions to. Leave as 'None' to get captions in their original language.

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

Select proxies to use for YouTube requests. Residential proxies are highly recommended to avoid YouTube IP blocking.

## `delay_seconds` (type: `integer`):

Delay in seconds between processing videos to avoid rate limiting

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/jNQXAC9IVRw",
    "dQw4w9WgXcQ"
  ],
  "output_format": "txt",
  "translate_to": "",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  },
  "delay_seconds": 2
}
```

# Actor output Schema

## `overview` (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 = {
    "videos": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("dead00/youtube-transcript-scraper-multiple-language").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"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("dead00/youtube-transcript-scraper-multiple-language").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"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call dead00/youtube-transcript-scraper-multiple-language --silent --output-dataset

```

## MCP server setup

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

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/428FuIvhGjg4dJ9ag/builds/NKlpb8sVtVUMQJKcg/openapi.json
