# YouTube Transcript Scraper – JSON, SRT, VTT, Plain Text (`scraperhive/youtube-transcript-scraper`) Actor

Extract YouTube video transcripts, subtitles, and captions in multiple formats with precise timestamps.
Plain Text · JSON · SRT · WebVTT · 20+ Languages · Batch Processing · Auto + Manual Captions

- **URL**: https://apify.com/scraperhive/youtube-transcript-scraper.md
- **Developed by:** [Mubeen Ali](https://apify.com/scraperhive) (community)
- **Categories:** Automation, Developer tools, Social media
- **Features:** Limited permissions
- **Stats:** 117 total users, 12 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $8.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Extractor — Subtitles, Captions, SRT, VTT, JSON

Scrap YouTube video transcripts, subtitles, and captions in multiple formats with precise timestamps. Perfect for content creators, researchers, developers, and accessibility professionals who need reliable transcript data from YouTube videos.

### 📋 Overview

Extract YouTube video transcripts, subtitles, and captions in multiple formats with precise timestamps.
Plain Text · JSON · SRT · WebVTT · 20+ Languages · Batch Processing · Auto + Manual Captions.

### 📋 What Is This Actor?

**YouTube Transcript Extractor** is an Apify Actor that scrapes YouTube video transcripts, subtitles, and captions directly — no YouTube API key required. It supports every major output format (Plain Text, JSON, SRT, WebVTT), 20+ languages, and batch processing of multiple videos in a single run.

Whether you need transcripts for AI training data, content repurposing, accessibility compliance, SEO optimization, research, or video editing — this is the fastest and most flexible YouTube caption scraper on Apify.

### ✨ Key Features

| Feature | Details |
|---|---|
| **Output Formats** | Plain Text, JSON, SRT (SubRip), WebVTT |
| **Language Support** | 20+ languages: English, Hindi, Spanish, Chinese, French, German, Arabic, Portuguese, and more |
| **Timestamp Precision** | Start time, end time, and duration per segment |
| **Batch Processing** | Process multiple YouTube videos in a single run |
| **Caption Priority** | Fetches manually created transcripts first; falls back to auto-generated captions |
| **Flexible Input** | Accepts YouTube video URLs (all formats) or raw video IDs |
| **Clean Output** | Strips HTML tags and formatting artifacts automatically |
| **Segment Indexing** | Every segment is numbered for easy navigation and reference |

### 🎯 Who Is This For?

- **Content Creators** — Repurpose video scripts into blog posts, newsletters, or social media threads
- **AI & ML Engineers** — Build training datasets from YouTube video transcripts at scale
- **Researchers & Academics** — Analyze video content, run NLP, sentiment analysis, or topic modeling
- **SEO Professionals** — Extract transcripts to add keyword-rich text to video landing pages
- **Accessibility Professionals** — Generate captions and subtitles compliant with WCAG/ADA standards
- **Journalists & Fact-Checkers** — Quickly search and quote spoken content from YouTube videos
- **Developers** — Integrate YouTube transcript data into apps, bots, and pipelines via the Apify API

### 📥 Input Configuration

Configure the actor using the following input parameters:

#### Required Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `videoUrls` | Array | **Required.** List of YouTube video URLs or video IDs to process |

#### Optional Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `languages` | Array | `["en"]` | Preferred language codes for transcripts (e.g., `["en", "hi", "es"]`) |
| `outputFormat` | String | `"text"` | Output format: `"text"`, `"json"`, `"webvtt"`, or `"srt"` |
| `preserveFormatting` | Boolean | `false` | Preserve HTML formatting tags in transcript (only for WebVTT/JSON formats) |

#### Supported URL Formats

The actor accepts YouTube videos in multiple URL formats:

- Standard: `https://www.youtube.com/watch?v=VIDEO_ID`
- Short: `https://youtu.be/VIDEO_ID`
- Direct ID: `VIDEO_ID` (11-character alphanumeric code)

### 🌐 Supported Languages

English · Hindi · Spanish · Chinese (Simplified) · French · German · Arabic · Portuguese · Russian · Japanese · Korean · Italian · Dutch · Turkish · Polish · Swedish · Danish · Norwegian · Finnish · Indonesian · and more.

Pass a standard BCP-47 language code (e.g., `en`, `hi`, `es`, `zh`, `fr`, `de`, `ar`) in the `language` input field.

### 🚀 How to Use

#### Option 1: Run on Apify Console (No Code)

1. Go to [YouTube Transcript Extractor on Apify](https://apify.com/scraperhive/youtube-transcript-extractor)
2. Click **Try for free**
3. Paste your YouTube URLs into the input
4. Select your language and output format
5. Click **Start** and download your transcript

#### Option 2: Run via Apify API

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/scraperhive~youtube-transcript-extractor/runs" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
    "language": "en",
    "outputFormat": "json"
  }'
```

#### Option 3: Run via Apify Python Client

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run_input = {
    "videoUrls": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
    "language": "en",
    "outputFormat": "json",
}

run = client.actor("scraperhive/youtube-transcript-extractor").call(run_input=run_input)

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

#### Option 4: Run via Apify JavaScript Client

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('scraperhive/youtube-transcript-extractor').call({
  videoUrls: ['https://www.youtube.com/watch?v=dQw4w9WgXcQ'],
  language: 'en',
  outputFormat: 'srt',
});

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

### 💡 Use Case Examples

#### 1. Generate AI Training Data from YouTube

Extract thousands of transcripts at scale for LLM fine-tuning, speech recognition training, or semantic search indexing.

```json
{
  "videoUrls": ["VIDEO_URL_1", "VIDEO_URL_2", "VIDEO_URL_3"],
  "language": "en",
  "outputFormat": "json"
}
```

#### 2. Create SRT Subtitle Files for Video Editing

Download SRT caption files compatible with Premiere Pro, DaVinci Resolve, Final Cut, and any subtitle editor.

```json
{
  "videoUrls": ["https://www.youtube.com/watch?v=VIDEO_ID"],
  "language": "es",
  "outputFormat": "srt"
}
```

#### 3. Extract Transcripts in Hindi or Other Languages

Get transcripts directly in your target language without translation overhead.

```json
{
  "videoUrls": ["https://www.youtube.com/watch?v=VIDEO_ID"],
  "language": "hi",
  "outputFormat": "text"
}
```

#### 4. Batch Process a List of Videos

Provide an array of URLs to extract transcripts from multiple videos in one run.

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=ID_1",
    "https://www.youtube.com/watch?v=ID_2",
    "https://www.youtube.com/watch?v=ID_3"
  ],
  "outputFormat": "vtt"
}
```

### ⚖️ YouTube Transcript Extractor vs Competitors

| Feature | This Actor | Basic Scrapers |
|---|---|---|
| Output: Plain Text | ✅ | ✅ |
| Output: JSON with timestamps | ✅ | ⚠️ Partial |
| Output: SRT | ✅ | ❌ |
| Output: WebVTT | ✅ | ❌ |
| Segment-level timestamps | ✅ (start + end + duration) | ⚠️ Start only |
| 20+ language support | ✅ | ⚠️ English only |
| Batch multi-video processing | ✅ | ⚠️ Limited |
| Manual caption priority | ✅ | ❌ |
| Clean HTML-stripped output | ✅ | ⚠️ Raw HTML artifacts |
| Segment index numbering | ✅ | ❌ |

### 📤 Output Structure

Each successfully processed video generates a structured result containing transcript data, metadata, and segments.

#### Output Fields

| Field                      | Type         | Description                                                      |
| -------------------------- | ------------ | ---------------------------------------------------------------- |
| `format`                   | String       | The output format used (`"text"`, `"json"`, `"webvtt"`, `"srt"`) |
| `metadata`                 | Object       | Video and transcript metadata                                    |
| `metadata.videoId`         | String       | YouTube video ID                                                 |
| `metadata.videoUrl`        | String       | Full YouTube video URL                                           |
| `metadata.language`        | String       | Language code of the transcript                                  |
| `metadata.isAutoGenerated` | Boolean      | Whether the transcript is auto-generated or manual               |
| `transcript`               | String/Array | Formatted transcript (format depends on `outputFormat`)          |
| `segments`                 | Array        | Array of transcript segments with timestamps                     |
| `success`                  | Boolean      | Always `true` for successful extractions                         |

#### Segment Structure

Each segment in the `segments` array contains:

| Field      | Type   | Description                                 |
| ---------- | ------ | ------------------------------------------- |
| `index`    | Number | Sequential segment number (starting from 1) |
| `text`     | String | Transcript text for this segment            |
| `start`    | Number | Start time in seconds                       |
| `end`      | Number | End time in seconds                         |
| `duration` | Number | Duration of the segment in seconds          |

### 💰 Pricing

**Pay-per-Result Model** — with automatic discounts for paid Apify plans

| Apify Plan | Price per 1,000 results | Price per result |
|------------|------------------------|-----------------|
| Free       | $10.00                 | $0.0100         |
| Bronze     | $9.50                  | $0.0095         |
| Silver     | $9.00                  | $0.0090         |
| Gold       | $8.50                  | $0.0085         |

- ✅ You are charged **only for successful transcript extractions**
- ❌ Failed videos (no captions, private, unavailable, rate-limited) are **not charged**
- 📊 Each successfully processed video which has transcripts counts as **one result**
- 🎯 Discounts are applied **automatically** based on your Apify subscription plan

### ❓ Frequently Asked Questions (FAQ)

**Q: Which YouTube video formats are supported?**
A: Standard YouTube URLs, short `youtu.be` URLs, and direct 11-character video IDs are supported.

**Q: Can I extract transcripts from private, unlisted, or age-restricted videos?**
A: No. Only publicly available videos with enabled captions can be processed.

**Q: What happens if a video has no captions available?**
A: The extraction fails gracefully and you are **not charged** for that video.

**Q: What is the difference between manual and auto-generated transcripts?**
A: Manual transcripts are uploaded by the creator and are usually more accurate. Auto-generated transcripts are created by YouTube and may contain errors. The actor prioritizes manual transcripts.

**Q: Which output format should I use?**
A: Text for reading and SEO, JSON for APIs and AI workflows, SRT for video editing, and WebVTT for web video players.

**Q: Does this actor download or store YouTube videos?**
A: No. It only extracts publicly available transcript and caption data.

**Note**: This actor complies with YouTube's Terms of Service. Users are responsible for ensuring their usage respects copyright laws and content ownership rights.

# Actor input Schema

## `videoUrls` (type: `array`):

List of YouTube video URLs or video IDs. Supports formats: \[URL] \[URL] or direct video ID

## `languages` (type: `array`):

Select desired languages. The actor will try to find transcripts in these languages.

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

Format for the transcript output

## `preserveFormatting` (type: `boolean`):

Preserve line breaks and formatting in the transcript (if available)

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "languages": [
    "en",
    "tr",
    "it"
  ],
  "outputFormat": "json",
  "preserveFormatting": false
}
```

# Actor output Schema

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

No description

# 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 = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=qwI3ApgCQ_E"
    ],
    "languages": [
        "en"
    ],
    "outputFormat": "json",
    "preserveFormatting": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraperhive/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 = {
    "videoUrls": ["https://www.youtube.com/watch?v=qwI3ApgCQ_E"],
    "languages": ["en"],
    "outputFormat": "json",
    "preserveFormatting": False,
}

# Run the Actor and wait for it to finish
run = client.actor("scraperhive/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 '{
  "videoUrls": [
    "https://www.youtube.com/watch?v=qwI3ApgCQ_E"
  ],
  "languages": [
    "en"
  ],
  "outputFormat": "json",
  "preserveFormatting": false
}' |
apify call scraperhive/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scraperhive/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/Kx2PJ4RRo8Xpin5XQ/builds/NkwLx4zkhR8Cv40UK/openapi.json
