# Youtube Transcript Scraper (`scraper-mind/youtube-transcript-scraper`) Actor

Extract YouTube video transcripts, captions & metadata instantly using our youtube transcript scraper.  Supports all URL types, smart proxy fallback, multi-language detection & JSON output. Fast, reliable & only $5/run—perfect for creators, researchers, and marketers.

- **URL**: https://apify.com/scraper-mind/youtube-transcript-scraper.md
- **Developed by:** [Scraper Mind](https://apify.com/scraper-mind) (community)
- **Categories:** Social media, Videos, Automation
- **Stats:** 18 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## YouTube Transcript Scraper

Extract transcripts, video details, and metadata from YouTube videos with high accuracy and reliability. This Apify actor supports bulk processing, multiple languages, and intelligent proxy management.

### Why Choose Us?

- **🔍 High Accuracy**: Uses yt-dlp for reliable video data extraction
- **⚡ Fast Processing**: Parallel processing with configurable workers
- **🌍 Multi-Language**: Support for transcripts in multiple languages
- **🛡️ Anti-Blocking**: Intelligent proxy management with automatic fallback
- **📊 Rich Metadata**: Extract comprehensive video and channel information
- **🔄 Retry Logic**: Robust error handling with configurable retries
- **💾 Live Saving**: Results saved immediately to prevent data loss

### Key Features

- **Bulk Processing**: Process multiple YouTube URLs simultaneously
- **Language Selection**: Choose preferred transcript language
- **Proxy Support**: Built-in proxy management with residential fallback
- **Rich Data**: Extract transcripts, video details, channel info, and metadata
- **Error Handling**: Comprehensive error handling and logging
- **Rate Limiting**: Configurable delays to avoid rate limiting
- **Parallel Execution**: Multi-threaded processing for faster results

### Input

#### Input Schema

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=Z4hVGCWH1Kc"
    },
    {
      "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    }
  ],
  "language": "en",
  "maxWorkers": 4,
  "requestDelay": 1,
  "maxRetries": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
````

#### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `startUrls` | Array | ✅ Yes | - | List of YouTube video URLs to process |
| `language` | String | ❌ No | "en" | Preferred language code for transcripts |
| `maxWorkers` | Integer | ❌ No | 4 | Number of parallel workers (1-10) |
| `requestDelay` | Integer | ❌ No | 1 | Base delay between requests in seconds |
| `maxRetries` | Integer | ❌ No | 3 | Number of retry attempts for failed requests |
| `proxyConfiguration` | Object | ❌ No | `{"useApifyProxy": false}` | Proxy configuration settings |

### Output

#### Output Schema

```json
{
  "url": "https://www.youtube.com/watch?v=Z4hVGCWH1Kc",
  "title": "Example Video Title",
  "length": "10:30",
  "channel_name": "Example Channel",
  "views": 1000000,
  "transcript": [
    {
      "start": "0.000",
      "dur": "2.500",
      "text": "Hello and welcome to this video."
    },
    {
      "start": "2.500",
      "dur": "3.200",
      "text": "Today we'll be discussing..."
    }
  ],
  "message": "Transcript loaded from subtitles:en",
  "success": true,
  "video_id": "Z4hVGCWH1Kc",
  "channel_url": "https://www.youtube.com/channel/UC...",
  "upload_date": "20231201",
  "description": "Video description text...",
  "tags": ["tag1", "tag2", "tag3"],
  "category": "Education",
  "like_count": 5000,
  "dislike_count": 100,
  "comment_count": 250
}
```

#### Output Fields

| Field | Type | Description |
|-------|------|-------------|
| `url` | String | Original YouTube video URL |
| `title` | String | Video title |
| `length` | String | Video duration in MM:SS format |
| `channel_name` | String | Channel name |
| `views` | Number | View count |
| `transcript` | Array | Array of transcript segments with timing |
| `message` | String | Status message about transcript extraction |
| `success` | Boolean | Whether processing was successful |
| `video_id` | String | YouTube video ID |
| `channel_url` | String | Channel URL |
| `upload_date` | String | Upload date (YYYYMMDD format) |
| `description` | String | Video description |
| `tags` | Array | Video tags |
| `category` | String | Video category |
| `like_count` | Number | Like count |
| `dislike_count` | Number | Dislike count |
| `comment_count` | Number | Comment count |

### 🚀 How to Use the Actor (via Apify Console)

1. **Log in** at https://console.apify.com and go to **Actors**
2. **Find** the `youtube-transcript-scraper` actor and click it
3. **Configure inputs**:
   - Add YouTube video URLs in the `startUrls` field
   - Set preferred language (optional)
   - Configure proxy settings if needed
   - Adjust processing parameters
4. **Run the actor** and monitor logs in real time
5. **Access results** in the OUTPUT tab
6. **Export results** to JSON or CSV format

### Best Use Cases

- **📚 Educational Content**: Extract transcripts from educational videos for study materials
- **🎬 Content Analysis**: Analyze video content and speech patterns
- **🌐 Translation**: Extract transcripts for translation services
- **📝 Documentation**: Create written records of video content
- **🔍 Research**: Analyze video content for research purposes
- **📊 SEO**: Extract keywords and content for SEO analysis
- **🎯 Accessibility**: Create accessible content from video transcripts

### Frequently Asked Questions

#### **Q: What types of YouTube URLs are supported?**

A: The actor supports standard YouTube watch URLs (`youtube.com/watch?v=...`) and shortened URLs (`youtu.be/...`).

#### **Q: Can I extract transcripts in different languages?**

A: Yes! Set the `language` parameter to your preferred language code (e.g., "es" for Spanish, "fr" for French). The actor will try to find transcripts in that language first, then fall back to available alternatives.

#### **Q: What happens if a video has no transcript?**

A: The actor will return a result with an empty transcript array and a message indicating that no transcript is available for that video.

#### **Q: How does the proxy fallback work?**

A: If you enable proxy and YouTube blocks the initial proxy, the actor automatically switches to a residential proxy and continues processing all remaining URLs with that proxy.

#### **Q: Can I process private or age-restricted videos?**

A: No, the actor can only process publicly available videos that don't require authentication.

#### **Q: What's the maximum number of URLs I can process?**

A: There's no strict limit, but we recommend processing up to 100 URLs per run for optimal performance and to avoid rate limiting.

#### **Q: How accurate are the transcripts?**

A: The actor extracts official YouTube subtitles and auto-generated captions. Accuracy depends on the quality of the original subtitles provided by the video creator.

#### **Q: Can I get timestamps with the transcript?**

A: Yes! Each transcript segment includes start time and duration information for precise timing.

### Support and Feedback

- **📧 Email**: support@apify.com
- **💬 Chat**: Available in the Apify Console
- **📖 Documentation**: https://docs.apify.com
- **🐛 Bug Reports**: Report issues through the Apify Console

### Cautions

⚠️ **Important Notes:**

- Data is collected only from **publicly available YouTube videos**
- No data is extracted from private, unlisted, or age-restricted content
- The end user is responsible for ensuring legal compliance
- Respect YouTube's Terms of Service and rate limits
- Use transcripts responsibly and respect copyright laws
- This tool is for educational and research purposes only

***

**Built with ❤️ by the Apify team**

# Actor input Schema

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

List one or more YouTube video URLs (e.g., https://www.youtube.com/watch?v=VIDEO\_ID) to extract transcripts from.

## `language` (type: `string`):

Preferred language code for transcripts (e.g., 'en' for English, 'es' for Spanish). Leave empty for auto-detection.

## `maxWorkers` (type: `integer`):

Number of parallel workers for processing URLs (1-10).

## `requestDelay` (type: `integer`):

Base delay between requests. Random 0-0.5s will be added automatically.

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

Number of retry attempts for failed requests (1-5).

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

Choose which proxies to use. If YouTube rejects the proxy, a residential proxy will be used as a fallback.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=Z4hVGCWH1Kc"
    }
  ],
  "language": "en",
  "maxWorkers": 4,
  "requestDelay": 1,
  "maxRetries": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.youtube.com/watch?v=Z4hVGCWH1Kc"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraper-mind/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 = {
    "startUrls": [{ "url": "https://www.youtube.com/watch?v=Z4hVGCWH1Kc" }],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("scraper-mind/youtube-transcript-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=Z4hVGCWH1Kc"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call scraper-mind/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scraper-mind/youtube-transcript-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Youtube Transcript Scraper",
        "description": "Extract YouTube video transcripts, captions & metadata instantly using our youtube transcript scraper.  Supports all URL types, smart proxy fallback, multi-language detection & JSON output. Fast, reliable & only $5/run—perfect for creators, researchers, and marketers.",
        "version": "0.1",
        "x-build-id": "SXxytDeHnJt2etpOZ"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scraper-mind~youtube-transcript-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scraper-mind-youtube-transcript-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/scraper-mind~youtube-transcript-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scraper-mind-youtube-transcript-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/scraper-mind~youtube-transcript-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scraper-mind-youtube-transcript-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "startUrls"
                ],
                "properties": {
                    "startUrls": {
                        "title": "YouTube Video URLs",
                        "type": "array",
                        "description": "List one or more YouTube video URLs (e.g., https://www.youtube.com/watch?v=VIDEO_ID) to extract transcripts from.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "language": {
                        "title": "Transcript Language",
                        "type": "string",
                        "description": "Preferred language code for transcripts (e.g., 'en' for English, 'es' for Spanish). Leave empty for auto-detection.",
                        "default": "en"
                    },
                    "maxWorkers": {
                        "title": "Maximum Workers",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Number of parallel workers for processing URLs (1-10).",
                        "default": 4
                    },
                    "requestDelay": {
                        "title": "Request Delay (seconds)",
                        "minimum": 0,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Base delay between requests. Random 0-0.5s will be added automatically.",
                        "default": 1
                    },
                    "maxRetries": {
                        "title": "Maximum Retries",
                        "minimum": 1,
                        "maximum": 5,
                        "type": "integer",
                        "description": "Number of retry attempts for failed requests (1-5).",
                        "default": 3
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Choose which proxies to use. If YouTube rejects the proxy, a residential proxy will be used as a fallback."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
