# 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
- **Features:** Limited permissions
- **Stats:** 8 total users, 1 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/actors/running/actors-in-store.md#pay-per-event

## 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 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(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 '{
  "urls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ]
}' |
apify call tropical_prune/youtube-transcript-pro --silent --output-dataset

```

## MCP server setup

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

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/BxVGOFyNp0RvnP7pK/builds/kS68UcMhcjsYYMCED/openapi.json
