# YouTube Transcript Scraper (`seasoned_seaurchin/youtube-transcript`) Actor

Fast YouTube transcript & subtitles extractor. Pay only for successfully extracted transcripts ($0.005 per video).

- **URL**: https://apify.com/seasoned_seaurchin/youtube-transcript.md
- **Developed by:** [Z Michael](https://apify.com/seasoned_seaurchin) (community)
- **Categories:** AI, Videos
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 transcripts

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 Scraper

Extract transcripts & subtitles from any YouTube video — fast, reliable, and priced per success.

**$0.005 per successfully extracted transcript.** If a video has no captions or extraction fails, you are not charged.

### Features

- ⚡ **Fast**: pure HTTP extraction — ~1 second per video, no browser overhead
- 💬 **Manual & auto-generated captions** (ASR) in 100+ languages
- 🕒 **Timestamped segments** or plain text — your choice
- 🔗 **Flexible input**: watch URLs, `youtu.be` links, Shorts links, or bare video IDs
- 📋 **Metadata included**: title, channel, duration, view count, available languages
- 🌍 **Language selection**: pick any available caption language per run

### Output

Each video produces one dataset item:

```json
{
    "videoId": "aircAruvnKk",
    "url": "https://www.youtube.com/watch?v=aircAruvnKk",
    "title": "But what is a neural network? | Deep learning chapter 1",
    "channel": "3Blue1Brown",
    "durationSec": 1137,
    "viewCount": 19000000,
    "language": "en",
    "isAutoGenerated": false,
    "availableLanguages": ["en", "es", "pt", "fr"],
    "transcript": "This is a 3. It's sloppily written ...",
    "transcriptChars": 18430,
    "segmentCount": 286,
    "segments": [
        { "start": 0.0, "dur": 4.2, "text": "This is a 3." }
    ]
}
```

Set `includeSegments: false` to skip the `segments` array for large batches.

### Usage

1. Add one or more YouTube video URLs (or bare video IDs).
2. Pick your preferred `language` (falls back to the closest match).
3. Run — you get one item per video.

### Pricing

Pay Per Event: **$0.005 per transcript** — charged only when a transcript is successfully extracted. Videos without captions, private/unavailable videos, and failed extractions cost nothing.

### Notes

- Live streams without captions and videos with captions disabled by the creator cannot be extracted.
- Large batches run sequentially (~1s per video); a 1,000-video list finishes in ~20 minutes.

### Related Actors

Working with YouTube data? These cover the rest of the stack — same engine, no API key, pay per result:

- **[YouTube Comments Scraper](https://apify.com/seasoned_seaurchin/youtube-comments-scraper)** — comments, authors, likes, reply counts, timestamps
- **[YouTube Search Scraper](https://apify.com/seasoned_seaurchin/youtube-search-scraper)** — keyword to video results with views and publish dates
- **[YouTube Channel Videos Scraper](https://apify.com/seasoned_seaurchin/youtube-channel-videos-scraper)** — recent uploads from any channel

# Actor input Schema

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

YouTube video URLs or 11-character video IDs. Accepts watch URLs, youtu.be links, Shorts links and bare IDs.

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

Preferred caption language code, e.g. en, de, ja, pt, es, zh-Hans. Falls back to the closest match or the first available track.

## `includeSegments` (type: `boolean`):

Include the timestamped segment array in the output. Set to false to save bandwidth for large batches.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "aircAruvnKk"
  ],
  "language": "en",
  "includeSegments": true
}
```

# Actor output Schema

## `transcripts` (type: `string`):

Extracted transcripts with video metadata.

# 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",
        "aircAruvnKk"
    ],
    "language": "en"
};

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

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

```

## MCP server setup

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

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/9lScl5uNQLZdd0J0U/builds/shcYmbJOBEllqXa0H/openapi.json
