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

Apify actor that extracts transcripts from YouTube videos

- **URL**: https://apify.com/actorify/youtube-transcript-scraper.md
- **Developed by:** [fanio zilla](https://apify.com/actorify) (community)
- **Categories:** AI, SEO tools, Automation
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.30 / 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.

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/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.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/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

### What does YouTube Transcript Scraper do?

**YouTube Transcript Scraper** extracts **transcripts and subtitles from YouTube videos** at scale. Give it a list of video URLs and it returns the full caption text for each one — either as **timestamped segments** or as **plain text** — ready to feed into your LLM, search index, or analytics pipeline.

It is a fast, lightweight alternative to browser-based scrapers: instead of launching a headless browser, it calls YouTube's caption APIs directly over HTTP, so it can process thousands of videos quickly and cheaply. Think of it as a **YouTube transcript API** you can call on demand, schedule, or wire up to webhooks.

> Target site: [youtube.com](https://www.youtube.com)

### Why use YouTube Transcript Scraper?

Video is where the information is — but it's hard to search, summarize, or analyze until you have the text. Common use cases:

- 🤖 **Feed LLMs and RAG pipelines** — turn video content into searchable text for summarization, Q&A, and knowledge bases.
- 🔎 **Build searchable archives** — index the spoken content of lectures, podcasts, webinars, and product demos.
- ✍️ **Repurpose content** — generate blog posts, articles, social snippets, and show notes from video.
- 🌐 **Translation & accessibility** — pull captions across languages for translation or captioning workflows.
- 📊 **Research & monitoring** — analyze what creators and competitors are saying across channels.

Why this Actor over a DIY script:

- **No browser, no bloat** — pure HTTP via `got-scraping` with TLS fingerprinting, so it's fast and avoids bot detection.
- **Concurrent and resilient** — processes up to 5 videos in parallel; one failing URL never breaks the run.
- **Proxy rotation built in** — uses Apify's residential proxies to dodge rate limits.
- **Runs anywhere** — schedule it, trigger it via API/webhooks, or integrate it with [Zapier](https://apify.com/integrations), Make, n8n, LangChain, and thousands of other tools.

### What data can YouTube Transcript Scraper extract?

Each input video produces one dataset item with its transcript(s):

| Field | Type | Description |
|---|---|---|
| `id` | string | YouTube video ID |
| `url` | string | Canonical video URL |
| `input` | string | The original URL you provided |
| `transcripts` | array | One entry per language; empty `[]` if no captions exist |
| `transcripts[].language` | string | Display name, e.g. `English`, `English (auto-generated)`, `Spanish` |
| `transcripts[].content` | array \| string | Timestamped segments (timestamp mode) **or** a single text string (text mode) |

Each **timestamp segment** contains:

| Field | Type | Description |
|---|---|---|
| `startMs` | number | Start time in milliseconds |
| `endMs` | number | End time in milliseconds |
| `startTime` | string | Human-readable start (e.g. `0:18`, `15:29`) |
| `text` | string | Caption text for that segment |

### How to extract transcripts from YouTube

1. **Sign up for free** on [Apify](https://apify.com) and open [YouTube Transcript Scraper](https://apify.com) in the Console.
2. **Add your video URLs** to the `urls` field (one per line). It accepts standard, `youtu.be`, Shorts, and embed URLs.
3. **Pick your options** — output format (timestamps vs. plain text), whether to include auto-generated English, and whether to include non-English languages.
4. **Click Start** and wait a few seconds. Results stream into the dataset as each video completes.
5. **Download** your transcripts as JSON, CSV, Excel, or HTML from the dataset, or pull them via API.

> No code required — but everything is also available through the [Apify API](https://docs.apify.com/api/v2) for programmatic access.

### How much will it cost?

This Actor is **priced per compute unit (CU)** and, because it uses lightweight HTTP requests instead of a browser, it's extremely efficient — a single compute unit can process a large batch of videos.

- **Free trial** — every new Apify account gets a $5 usage credit on the Free plan, plenty to try it out.
- **Starter ($49/mo)** and **higher plans** include monthly platform usage and unlock higher concurrency for bigger jobs.
- For the exact rates and included usage, see the **Pricing** tab on the Actor page.

Cost scales with the number and length of videos, not with a per-result fee — so long playlists stay cheap.

### Input

You can configure everything from the **Input** tab in the Console. See the input tab for the full, live schema. The main fields:

| Field | Type | Default | Description |
|---|---|---|---|
| `urls` | string[] | *(required)* | YouTube video URLs to process |
| `outputFormat` | `timestamp` \| `text` | `timestamp` | Timestamped segments, or plain concatenated text |
| `includeEnglishAG` | boolean | `true` | Include auto-generated English captions when manual ones are missing |
| `includeNonEnglish` | boolean | `true` | Extract all available languages, not just English |
| `proxyConfiguration` | object | Residential proxy | **Residential proxy required** — YouTube blocks datacenter IPs. Defaults to `groups: ["RESIDENTIAL"]`. |

Minimal input example:

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://youtu.be/dQw4w9WgXcQ"
  ],
  "outputFormat": "timestamp",
  "includeEnglishAG": true,
  "includeNonEnglish": false
}
````

### Output

You can download the dataset in various formats such as **JSON, HTML, CSV, or Excel**. Here's a simplified example with `outputFormat: "timestamp"`:

```json
[
  {
    "id": "aircAruvnKk",
    "url": "https://www.youtube.com/watch?v=aircAruvnKk",
    "input": "https://www.youtube.com/watch?v=aircAruvnKk",
    "transcripts": [
      {
        "language": "English",
        "content": [
          { "startMs": 291, "endMs": 3374, "startTime": "0:00", "text": "Hi, welcome." },
          { "startMs": 3374, "endMs": 6800, "startTime": "0:03", "text": "In this video we'll explore..." }
        ]
      }
    ]
  }
]
```

And the same video with `outputFormat: "text"`:

```json
[
  {
    "id": "aircAruvnKk",
    "url": "https://www.youtube.com/watch?v=aircAruvnKk",
    "input": "https://www.youtube.com/watch?v=aircAruvnKk",
    "transcripts": [
      {
        "language": "English",
        "content": "Hi, welcome. In this video we'll explore..."
      }
    ]
  }
]
```

### Tips & advanced options

- **Going plain-text for LLMs?** Set `outputFormat` to `text` to get one clean string per language — ideal for passing to GPT/Claude or embedding models.
- **Only want English?** Turn off `includeNonEnglish` to skip noisy multi-language output.
- **Trim costs on huge batches** — the Actor deduplicates nothing by design (it matches the original tool's behavior), so pass each URL only once if you don't want repeats.
- **Use a residential proxy.** YouTube serves a "sign in to confirm you're not a bot" wall to datacenter IPs, which returns empty transcripts. The Actor defaults to a residential proxy (`groups: ["RESIDENTIAL"]`) — keep it on. Residential proxy usage is the main cost driver for this Actor.
- **Automate it.** Schedule recurring runs for playlists/channels, or trigger runs via the API and pipe results straight to your storage or AI pipeline.

### FAQ, disclaimers, and support

**Is this an official YouTube API?**
No. It reads the public caption data YouTube serves to its web player. It is an unofficial alternative for cases where the official [YouTube Data API](https://developers.google.com/youtube) doesn't expose transcripts.

**Do I get timestamps?**
Yes — in `timestamp` mode every segment includes millisecond start/end plus a human-readable `startTime`.

**What if a video has no captions?**
The Actor still returns a result for it, with an empty `transcripts` array, so your pipeline never breaks mid-batch.

**Legal / scraping disclaimer**

> Our Actors are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our Actors, when used for ethical purposes by Apify users, are safe. However, you should be aware that your results could contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers. This Actor should be used in compliance with YouTube's Terms of Service.

**Need help or have feedback?** Use the **Issues** tab on the Actor page to report bugs or request features, and the **API** tab for programmatic access.

# Actor input Schema

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

List of YouTube video URLs to extract transcripts from.

## `includeEnglishAG` (type: `boolean`):

If true, extracts auto-generated English captions if manual ones are unavailable.

## `includeNonEnglish` (type: `boolean`):

If true, extracts all available languages instead of just English.

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

Format of the transcript content.

## `proxyConfiguration` (type: `object`):

Apify proxy configuration. YouTube blocks datacenter IPs with a 'sign in' wall, so a residential proxy (groups: RESIDENTIAL) is required for reliable results.

## Actor input object example

```json
{
  "includeEnglishAG": true,
  "includeNonEnglish": true,
  "outputFormat": "timestamp",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "groups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Transcript results — one dataset item per input video. See the dataset schema for per-field details (video id, url, transcripts\[].language, transcripts\[].content).

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("actorify/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 = {}

# Run the Actor and wait for it to finish
run = client.actor("actorify/youtube-transcript-scraper").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 '{}' |
apify call actorify/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Transcript Scraper",
        "description": "Apify actor that extracts transcripts from YouTube videos",
        "version": "0.1",
        "x-build-id": "8c3Pm3rTvkmH3tT9m"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/actorify~youtube-transcript-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-actorify-youtube-transcript-scraper",
                "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/actorify~youtube-transcript-scraper/runs": {
            "post": {
                "operationId": "runs-sync-actorify-youtube-transcript-scraper",
                "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/actorify~youtube-transcript-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-actorify-youtube-transcript-scraper",
                "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",
                        "type": "array",
                        "description": "List of YouTube video URLs to extract transcripts from.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "includeEnglishAG": {
                        "title": "Include auto-generated English",
                        "type": "boolean",
                        "description": "If true, extracts auto-generated English captions if manual ones are unavailable.",
                        "default": true
                    },
                    "includeNonEnglish": {
                        "title": "Include non-English transcripts",
                        "type": "boolean",
                        "description": "If true, extracts all available languages instead of just English.",
                        "default": true
                    },
                    "outputFormat": {
                        "title": "Output format",
                        "enum": [
                            "timestamp",
                            "text"
                        ],
                        "type": "string",
                        "description": "Format of the transcript content.",
                        "default": "timestamp"
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify proxy configuration. YouTube blocks datacenter IPs with a 'sign in' wall, so a residential proxy (groups: RESIDENTIAL) is required for reliable results.",
                        "default": {
                            "useApifyProxy": true,
                            "groups": [
                                "RESIDENTIAL"
                            ]
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
