# 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:** 17 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/actors/running/actors-in-store.md#rental-actors

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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**: scrapermindapi@gmail.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
  }
}
```

# Actor output Schema

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

Records produced by Youtube Transcript Scraper, stored in the run's default dataset.

# 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(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 '{
  "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": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scraper-mind/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/NmktanyB3YlBTTTCT/builds/1TxAKpqWh2ogVsLyT/openapi.json
