# YouTube Transcript Scraper: video captions as text (`bepolabs/youtube-transcripts`) Actor

Paste any URL; each row holds channel, language, the full transcript and timestamped segments.

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

## Pricing

$4.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

### 📝 What is YouTube Transcripts?

Built on the captions YouTube already shows, each transcript arrives with its title, whether it came from a human or the speech recogniser, one combined string and start-plus-duration chunks. Manual tracks win over generated ones, regional codes such as pt-BR match pt, and a closing self-check names anything that failed.

- **AI and LLMs**: feed transcripts to summaries, RAG and question answering
- **Research**: search what was said in interviews, talks and lectures
- **Content repurposing**: turn videos into articles, newsletters and show notes
- **Accessibility and subtitles**: reuse timed segments as the basis of subtitle files

![YouTube Transcripts: Full text and timed segments of the captions of any YouTube video, ready for summaries, search and LLMs.](https://api.apify.com/v2/key-value-stores/wdeAWGooHdIhvFgSY/records/youtube-transcripts-hero.png)

#### ✨ Why use this Actor?

- ✅ **Text and timing**: one `text` field for reading plus `segments` with start and duration for quoting or subtitles
- ✅ **Right captions**: manual captions first, automatic as fallback, `autoGenerated` tells which
- ✅ **Any link shape**: watch, youtu.be, shorts and embed URLs or bare 11-character ids, up to 50 per run
- ✅ **Keeps going**: retries with backoff; a video without captions gets a clear `error` row instead of stopping the run
- ✅ **Pay for results**: failed videos are not charged

### 📦 What data can you get with YouTube Transcripts?

| | | |
|---|---|---|
| 🎬 Video id and URL | 🏷️ Title and channel | 🌍 Caption language |
| 🤖 Automatic or manual captions | 📄 Full text | ⏱️ Timed segments |

> Private, unavailable or uncaptioned videos return a row with an `error` field and no text.

### 🚀 How to use YouTube Transcripts

YouTube Transcripts works in a few clicks, no coding needed:

1. [Create a free Apify account](https://console.apify.com/sign-up) (the free plan includes 5 USD of monthly credit).
2. Open [YouTube Transcripts](https://apify.com/bepolabs/youtube-transcripts) and click **Try for free**.
3. Paste the video URLs or ids and choose the caption language (default English).
4. Click **Start** and wait for the run to finish (most runs take seconds).
5. Download your data as JSON, CSV, Excel, XML or HTML, or send it straight to Google Sheets, Make, Zapier or your AI agent.

![How YouTube Transcripts works](https://api.apify.com/v2/key-value-stores/wdeAWGooHdIhvFgSY/records/youtube-transcripts-workflow.png)

### ⬇️ Input

Enter the videos; language and retry count have defaults (English, 4).

##### Videos

Up to 50 per run, as URLs or 11-character ids.

##### Language

A language code such as `en`, `de` or `pt`. If the video has no track in it, the error row lists the languages that are available.

| Field | Type | What it does | Default |
|---|---|---|---|
| **Videos** (`videos`) | array | One to 50 video URLs (watch, youtu.be, shorts, embed) or 11-character video ids. | `["https://www.youtube.com/watch?v=jNQXAC` |
| **Language** (`language`) | string | Caption language code such as en or de. | `"en"` |
| **Maximum retries** (`maxRetries`) | integer | Retries per request with exponential backoff. | `4` |

![YouTube Transcripts input form](https://api.apify.com/v2/key-value-stores/wdeAWGooHdIhvFgSY/records/youtube-transcripts-input.png)

#### Input example

```json
{
    "videos": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw"
    ]
}
```

### ⬆️ Output

Every video becomes one row with metadata, the full text and the timed segments.

![YouTube Transcripts output table](https://api.apify.com/v2/key-value-stores/wdeAWGooHdIhvFgSY/records/youtube-transcripts-output.png)

#### Output example

One row of the dataset (example shape; the text is the video's own caption):

```json
{
    "videoId": "jNQXAC9IVRw",
    "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "title": "Me at the zoo",
    "channel": "jawed",
    "language": "en",
    "autoGenerated": false,
    "text": "All right, so here we are in front of the elephants ...",
    "segments": [
        {
            "start": 1.2,
            "duration": 2.16,
            "text": "All right, so here we are"
        }
    ]
}
```

View the results as a table or JSON in the Output tab and download them as JSON, CSV, Excel, XML, HTML or RSS, all fields or only those you pick.

### 💰 How much does YouTube Transcripts cost?

YouTube Transcripts is priced **per event**: **3 USD per 1,000 transcripts** (0.003 USD each), with no monthly rental. Videos that fail are not charged.

| You get | You pay |
|---|---|
| 100 transcripts | 0.3 USD |
| 1,000 transcripts | 3 USD |
| 10,000 transcripts | 30 USD |
| 100,000 transcripts | 300 USD |

💡 Apify's free plan gives you 5 USD of credit every month, enough for about **1,666 transcripts** at no cost. Set a spending limit per run and the Actor stops there.

### ⚖️ YouTube Transcripts vs. the alternatives

| | YouTube Transcripts | Copy from the YouTube page | Subtitle downloaders |
|---|---|---|---|
| **Many videos in one run** | ✅ | ❌ | varies |
| **Timed segments as JSON** | ✅ | ❌ | varies |
| **Export, schedule, API and MCP** | ✅ | ❌ | varies |
| **Failed videos free** | ✅ | n/a | varies |

### 🔌 Integrations, API and MCP

#### Connect YouTube Transcripts to your AI agent (MCP)

Give Claude, ChatGPT, Cursor or any MCP client direct access to YouTube Transcripts through the [Apify MCP server](https://mcp.apify.com). Add this URL to its settings:

```text
https://mcp.apify.com/?actors=bepolabs/youtube-transcripts
```

For Claude Desktop, add it under `mcpServers` in `claude_desktop_config.json`:

```json
{
    "mcpServers": {
        "youtube-transcripts": {
            "command": "npx",
            "args": [
                "-y",
                "@apify/actors-mcp-server",
                "--actors",
                "bepolabs/youtube-transcripts"
            ],
            "env": {
                "APIFY_TOKEN": "<your Apify API token>"
            }
        }
    }
}
```

Then just ask: *"Get the transcripts of these 5 YouTube videos and summarise each in three bullet points."*

#### Run it from your code

Python (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("bepolabs/youtube-transcripts").call(run_input={"videos":["https://www.youtube.com/watch?v=jNQXAC9IVRw"]})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

JavaScript (`npm install apify-client`):

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

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('bepolabs/youtube-transcripts').call({"videos":["https://www.youtube.com/watch?v=jNQXAC9IVRw"]});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### No-code integrations

Send results to **Google Sheets, Slack, Airtable, HubSpot, Make, Zapier, n8n** and more from the Integrations tab, start runs on a **schedule**, or trigger your own endpoint with a **webhook** when a run finishes. The [Apify API](https://docs.apify.com/api/v2) gives you full control over runs and datasets.

### ❓ FAQ

##### Which videos work?

Public videos with manual or automatic captions. Uncaptioned ones return an `error` row.

##### Can I get another language?

Set `language`. Only tracks the video already has are returned; the error row lists them.

##### Do you transcribe audio?

No, this reads the existing captions. For your own recordings use our Audio and Video Transcriber.

##### Is it legal to use YouTube Transcripts?

The Actor reads the publicly available caption track of videos you name, as a viewer's browser does. Transcripts remain the work of their creators: check the licence and your local law before republishing them.

##### What if something is missing or does not work?

Open an issue on the **Issues** tab; we read each one and reply. Feature requests are welcome too.

### 💬 Your feedback

Tell us what YouTube Transcripts should add on the **Issues** tab or leave a review; your notes decide what we work on next.

### 🔗 Related Actors

| Actor | What it does |
|---|---|
| 🎙️ [Audio and Video Transcriber](https://apify.com/bepolabs/media-transcriber) | Whisper transcripts of audio and video files: full text, timed segments, SRT and WebVTT. No API key. |
| 🔤 [Image OCR](https://apify.com/bepolabs/image-ocr) | Extract text from images in 29 languages: plain text, clean Markdown and every word with its pixel box and confidence. |
| 🦋 [Bluesky Posts](https://apify.com/bepolabs/bluesky-posts) | Bluesky posts for any search or handle with text, date, author, likes, reposts, replies, links and hashtags. No login. |
| 🟧 [Hacker News Search](https://apify.com/bepolabs/hacker-news) | Hacker News stories, comments, Ask HN, Show HN and jobs for any search, with points, comment count, date and text. |
| 📄 [PDF to Text and Markdown](https://apify.com/bepolabs/pdf-to-text) | PDFs to clean text and Markdown, per page, per document or as RAG chunks, with columns in reading order and headers and footers removed. |
| 🎙️ [Podcast Episodes](https://apify.com/bepolabs/podcast-episodes) | Search terms, Apple Podcasts ids or RSS feeds to every show and its episodes, with audio links, dates and durations. |
| 📰 [RSS Feed Reader](https://apify.com/bepolabs/rss-reader) | Any RSS, Atom or JSON feed, or just a website URL, to one clean list of articles, with full text on request. |
| 🕰️ [Wayback Machine Scraper](https://apify.com/bepolabs/wayback-snapshots) | The archive history of any URL or domain: first and last seen, every capture, and the page text of old versions. |

# Changelog

This Actor's version history is a separate document: https://apify.com/bepolabs/youtube-transcripts/changelog.md

# Actor input Schema

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

One to 50 video URLs (watch, youtu.be, shorts, embed) or 11-character video ids.

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

Caption language code such as en or de. A manual track is preferred over an automatic one.

## `maxRetries` (type: `integer`):

Retries per request with exponential backoff.

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

YouTube asks datacenter IPs to confirm they are not a bot, so Apify Proxy (residential group, on by default) gives each retry a new IP.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "language": "en",
  "maxRetries": 4,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Dataset items, one row per result, in the overview table view.

# 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=jNQXAC9IVRw"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("bepolabs/youtube-transcripts").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=jNQXAC9IVRw"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("bepolabs/youtube-transcripts").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=jNQXAC9IVRw"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call bepolabs/youtube-transcripts --silent --output-dataset

```

## MCP server setup

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

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/ZZgen2bVhE5O0pr4f/builds/RcnmBv1q5oTPtAxl0/openapi.json
