# YouTube Transcript Pro (`tropical_prune/youtube-transcript-pro`) Actor

CAPABILITIES: extract\_transcript, extract\_subtitles, batch\_playlist, batch\_channel. FORMATS: json, srt, vtt, text, markdown. INPUT: YouTube URLs. OUTPUT: timestamped segments, plain text, metadata. LANGUAGES: auto-detect. NO\_API\_KEY. PPE: $0.002/video.

- **URL**: https://apify.com/tropical\_prune/youtube-transcript-pro.md
- **Developed by:** [Bado](https://apify.com/tropical_prune) (community)
- **Categories:** Videos, Social media
- **Stats:** 9 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 video processeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## 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 Pro

Extract transcripts, subtitles, and captions from YouTube videos, playlists, and channels.

### Capabilities

| Capability | Description |
|------------|-------------|
| `extract_transcript` | Extract full transcript from any YouTube video URL |
| `extract_subtitles` | Get SRT/VTT subtitle files ready for video players |
| `batch_playlist` | Process all videos in a YouTube playlist in one run |
| `batch_channel` | Process recent videos from a YouTube channel |
| `auto_language` | Auto-detect caption language, or specify preferred |
| `multi_format` | Output as JSON, SRT, VTT, plain text, or markdown |

### Input Schema

```json
{
  "urls": ["string"],           // YouTube video, playlist, or channel URLs (REQUIRED)
  "outputFormat": "string",     // "json" | "text" | "srt" | "vtt" | "markdown" (default: "json")
  "language": "string",         // ISO 639-1 code e.g. "en", "pt", "es" (default: auto-detect)
  "includeAutoGenerated": true, // Fall back to auto-generated captions (default: true)
  "maxVideos": 50               // Max videos per playlist/channel (default: 50)
}
````

### Output Schema

Each item in the output dataset contains:

```json
{
  "videoId": "string",          // YouTube video ID (11 chars)
  "videoUrl": "string",         // Full YouTube URL
  "title": "string",           // Video title
  "channelName": "string",     // Channel name
  "duration": "string",        // "MM:SS" or "HH:MM:SS"
  "viewCount": "integer",      // View count at time of extraction
  "uploadDate": "string",      // ISO date
  "language": "string",        // Detected caption language code
  "captionType": "string",     // "manual" | "auto-generated"
  "transcript": "string",      // Formatted transcript (format depends on outputFormat)
  "segments": [                // Array of timestamped segments
    {
      "text": "string",        // Segment text
      "offset": "integer",     // Start time in milliseconds
      "duration": "integer"    // Duration in milliseconds
    }
  ],
  "plainText": "string",       // Full concatenated text without timestamps
  "wordCount": "integer",      // Total word count
  "error": "string"            // Error message if extraction failed (null on success)
}
```

### Accepted URL Formats

```
https://www.youtube.com/watch?v=VIDEO_ID       → single video
https://youtu.be/VIDEO_ID                       → short URL
https://www.youtube.com/shorts/VIDEO_ID         → YouTube Shorts
https://www.youtube.com/playlist?list=LIST_ID   → full playlist
https://www.youtube.com/@ChannelName            → channel (recent videos)
https://www.youtube.com/channel/CHANNEL_ID      → channel by ID
```

### Output Format Details

| Format | Use Case | Structure |
|--------|----------|-----------|
| `json` | API consumption, data pipelines | Full structured object with segments array |
| `text` | LLM input, summarization, RAG | Plain concatenated text, no timestamps |
| `srt` | Video editing, subtitle files | Standard SubRip format with sequence numbers |
| `vtt` | Web players, HTML5 video | WebVTT format with WEBVTT header |
| `markdown` | Blog posts, documentation | Paragraphs grouped by 60s intervals with timestamp headers |

### Pricing

Model: `PAY_PER_EVENT`
Event: `video-processed` — charged per video with transcript successfully extracted.
Price: `$0.002` per video.
Failed videos (no captions available) are not charged.

### Cost Estimation

| Volume | Cost | Approx. Time |
|--------|------|-------------|
| 1 video | $0.002 | ~3s |
| 10 videos | $0.02 | ~30s |
| 100 videos | $0.20 | ~3min |
| 1,000 videos | $2.00 | ~20min |
| Full playlist (50) | $0.10 | ~2min |

### Integration Examples

#### API Call

```bash
curl -X POST "https://api.apify.com/v2/acts/tropical_prune~youtube-transcript-pro/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"], "outputFormat": "text"}'
```

#### Apify Client (JavaScript)

```javascript
const { ApifyClient } = require('apify-client');
const client = new ApifyClient({ token: 'YOUR_TOKEN' });

const run = await client.actor('tropical_prune/youtube-transcript-pro').call({
    urls: ['https://www.youtube.com/watch?v=dQw4w9WgXcQ'],
    outputFormat: 'json'
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].plainText);
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("tropical_prune/youtube-transcript-pro").call(run_input={
    "urls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
    "outputFormat": "text"
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["plainText"])
```

### Technical Details

- No browser required — uses direct HTTP with YouTube InnerTube API
- Residential proxy for reliable access from any IP
- Graceful error handling — failed videos get error field, processing continues
- Prefers manual captions over auto-generated when both available
- Auto-generated caption accuracy: ~85-95% for English

### Limitations

- Public videos only (no private/unlisted)
- Requires captions to exist on the video (manual or auto-generated)
- Rate limited by YouTube's caption API
- Channel extraction limited to videos visible on the channel page

### FAQ

**No captions on video?** → Actor reports error for that video, continues with the rest. Not charged.

**Private videos?** → Not supported. Public videos only.

**Which languages?** → All languages YouTube supports for captions. Use `language` field for preference.

**Accuracy of auto-generated?** → YouTube's ASR is ~85-95% for English, varies for other languages.

**Playlist limit?** → Set `maxVideos` to control. Default 50, no hard upper limit.

# Actor input Schema

## `urls` (type: `array`):

YouTube video URLs, playlist URLs, or channel URLs. Supports mixing different types.

## `outputFormat` (type: `string`):

Format for the transcript output.

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

ISO language code (e.g., 'en', 'pt', 'es'). Leave empty for auto-detection (prefers manual captions over auto-generated).

## `includeAutoGenerated` (type: `boolean`):

Fall back to auto-generated captions if manual captions are not available.

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

Maximum number of videos to process from a playlist or channel.

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "outputFormat": "json",
  "language": "",
  "includeAutoGenerated": true,
  "maxVideos": 50
}
```

# Actor output Schema

## `videoId` (type: `string`):

YouTube video ID.

## `videoUrl` (type: `string`):

Full YouTube URL of the video.

## `title` (type: `string`):

Video title.

## `channelName` (type: `string`):

YouTube channel name.

## `duration` (type: `string`):

Video duration (e.g. 12:34).

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

Detected caption language code (ISO 639-1).

## `transcript` (type: `string`):

Formatted transcript with timestamps.

## `plainText` (type: `string`):

Full concatenated transcript text without timestamps.

## `wordCount` (type: `string`):

Total word count of the transcript.

# 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 = {
    "urls": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tropical_prune/youtube-transcript-pro").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 = { "urls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"] }

# Run the Actor and wait for it to finish
run = client.actor("tropical_prune/youtube-transcript-pro").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 '{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ]
}' |
apify call tropical_prune/youtube-transcript-pro --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Transcript Pro",
        "description": "CAPABILITIES: extract_transcript, extract_subtitles, batch_playlist, batch_channel. FORMATS: json, srt, vtt, text, markdown. INPUT: YouTube URLs. OUTPUT: timestamped segments, plain text, metadata. LANGUAGES: auto-detect. NO_API_KEY. PPE: $0.002/video.",
        "version": "0.1",
        "x-build-id": "kS68UcMhcjsYYMCED"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/tropical_prune~youtube-transcript-pro/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-tropical_prune-youtube-transcript-pro",
                "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/tropical_prune~youtube-transcript-pro/runs": {
            "post": {
                "operationId": "runs-sync-tropical_prune-youtube-transcript-pro",
                "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/tropical_prune~youtube-transcript-pro/run-sync": {
            "post": {
                "operationId": "run-sync-tropical_prune-youtube-transcript-pro",
                "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": [
                    "urls"
                ],
                "properties": {
                    "urls": {
                        "title": "YouTube URLs",
                        "minItems": 1,
                        "type": "array",
                        "description": "YouTube video URLs, playlist URLs, or channel URLs. Supports mixing different types.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "outputFormat": {
                        "title": "Output Format",
                        "enum": [
                            "json",
                            "text",
                            "srt",
                            "vtt",
                            "markdown"
                        ],
                        "type": "string",
                        "description": "Format for the transcript output.",
                        "default": "json"
                    },
                    "language": {
                        "title": "Preferred Language",
                        "type": "string",
                        "description": "ISO language code (e.g., 'en', 'pt', 'es'). Leave empty for auto-detection (prefers manual captions over auto-generated).",
                        "default": ""
                    },
                    "includeAutoGenerated": {
                        "title": "Include Auto-Generated Captions",
                        "type": "boolean",
                        "description": "Fall back to auto-generated captions if manual captions are not available.",
                        "default": true
                    },
                    "maxVideos": {
                        "title": "Max Videos per Playlist/Channel",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of videos to process from a playlist or channel.",
                        "default": 50
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
