# YouTube Transcript Scraper: Videos, Channels & Playlists (`onibaku/youtube-transcripts`) Actor

YouTube transcript scraper: get the transcript of any YouTube video as clean text or timestamped segments, ready for AI, RAG and content repurposing. Paste video URLs, or a channel or playlist for all its videos. Manual or auto-generated captions, language choice, optional translation.

- **URL**: https://apify.com/onibaku/youtube-transcripts.md
- **Developed by:** [Onibaku](https://apify.com/onibaku) (community)
- **Categories:** Videos, AI, Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 transcript returneds

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: Videos, Channels & Playlists

Get the **YouTube transcript of any video** as clean plain text, or as timestamped segments. Paste video URLs, or a
**channel or playlist to get the transcripts of all its videos**, and get one row per video with the title, channel,
publish date, length, language and the full transcript, ready to drop into an LLM, a vector database or a
spreadsheet.

It reads the captions YouTube itself shows under the video: the creator's own subtitles where there are any, and
YouTube's auto-generated captions otherwise. No video or audio is downloaded and nothing is re-transcribed, so it's
fast and cheap: a 15-minute talk takes about a second.

### What it's for

- **AI and RAG:** feed a channel's back catalogue into a knowledge base or a custom GPT, or let an agent read a
  video before answering a question about it (see MCP below).
- **Content repurposing:** turn videos and podcasts into blog posts, newsletters, threads, show notes and quotes.
- **Research:** search what was actually said across hundreds of talks, lectures, interviews or earnings calls.
- **Subtitles and chapters:** timestamped segments link each line to the exact second of the video.
- **Competitor and brand monitoring:** pull the latest uploads of a set of channels on a schedule.

### Input

| Field | What it does |
| --- | --- |
| `videos` | Video URLs or IDs: `watch?v=` links, `youtu.be` links, Shorts, embeds, live links or the bare 11-character ID. |
| `channels` | Channel URLs, `@handles` or `UC...` channel IDs. Gets the channel's newest uploads. |
| `playlists` | Playlist URLs or IDs. |
| `maxVideosPerChannel` | How many videos to take from each channel or playlist (default 50). |
| `language` | Preferred language code, e.g. `en`, `en-GB`, `es`, `de` (default `en`). Leave empty for each video's own language. |
| `translate` | When the video has no captions in your language, ask YouTube to machine-translate them. |
| `includeTimestamps` | Adds `segments`: every caption line with its start time and duration in seconds. |
| `maxResults` | Stop after this many videos in total (default 1,000). |
| `proxyConfiguration` | Residential proxy by default. Leave it as it is (see Good to know). |

**How the language is chosen:** human-made captions in your language first, then YouTube's auto-generated ones. If
the video has neither, you get the transcript in the video's original language and a `warning` saying so, unless
`translate` is on.

**Three talks, as plain text:**

```json
{
    "videos": [
        "https://www.youtube.com/watch?v=arj7oStGLkU",
        "https://youtu.be/UF8uR6Z6KLc",
        "8S0FDjFBj8o"
    ]
}
```

**The latest 100 videos of two channels, with timestamps:**

```json
{
    "channels": ["@TED", "https://www.youtube.com/@veritasium"],
    "maxVideosPerChannel": 100,
    "includeTimestamps": true
}
```

**A playlist in Spanish, translated where needed:**

```json
{
    "playlists": ["https://www.youtube.com/playlist?list=PL..."],
    "language": "es",
    "translate": true
}
```

### Output

One row per video:

```json
{
    "videoId": "arj7oStGLkU",
    "url": "https://www.youtube.com/watch?v=arj7oStGLkU",
    "title": "Inside the Mind of a Master Procrastinator | Tim Urban | TED",
    "channelName": "TED",
    "channelId": "UCAuUUnT6oDeKwE6v1NGQxug",
    "publishedAt": "2016-04-06T16:59:35.000Z",
    "durationSeconds": 844,
    "language": "en",
    "isAutoGenerated": false,
    "isTranslated": false,
    "availableLanguages": [
        { "code": "ar", "name": "Arabic", "isAutoGenerated": false },
        { "code": "en", "name": "English", "isAutoGenerated": false },
        { "code": "en", "name": "English (auto-generated)", "isAutoGenerated": true }
    ],
    "transcript": "So in college, I was a government major, which means I had to write a lot of papers. Now, when a normal student writes a paper...",
    "segments": [
        { "start": 12.645, "duration": 1.37, "text": "So in college," },
        { "start": 15.349, "duration": 1.564, "text": "I was a government major," }
    ],
    "wordCount": 2277,
    "warning": null,
    "error": null
}
```

`segments` is only there when `includeTimestamps` is on. Videos that have no transcript (no captions at all,
private, removed, age-restricted or members-only) still get a row, with `transcript` empty and the reason in
`error`, so you can see what happened to every video you asked for.

### Pricing

**$0.0015 per transcript returned**, plus a token $0.00005 per run. 1,000 transcripts cost $1.50, proxy included.
Videos without a transcript, and videos that fail, cost nothing.

### Good to know

- **Proxy:** YouTube blocks most cloud servers, so the actor goes through Apify's residential proxy by default.
  That's included in the price; just leave the setting alone. If YouTube still blocks a request, the actor retries
  from a few different IPs before giving up on that video (which then isn't charged).
- Auto-generated captions have no punctuation in some languages, and their lines overlap slightly in time, as they
  do on YouTube.
- YouTube rations machine translation heavily. With `translate` on, some videos may come back in their original
  language, with a `warning`.
- For channels you get the newest uploads first, including Shorts and past live streams.
- Only public videos and captions anyone can see without signing in. Age-restricted and members-only videos are
  skipped with an error.

### Use it from Claude, ChatGPT or Cursor (MCP)

AI assistants can call this actor as a tool through Apify's MCP server, so they can read any YouTube video you
point them at. Add this server URL to your MCP client and sign in with your Apify account when prompted:

```
https://mcp.apify.com?tools=onibaku/youtube-transcripts
```

### Data source

The captions YouTube publishes with each public video, the same ones you see when you press CC or open "Show
transcript" on youtube.com, read logged out. Every row's `url` links to the video.

Questions or feature requests? Open an issue on the actor's Issues tab or email admin@onibaku.co.uk.

# Actor input Schema

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

Video URLs or IDs, e.g. https://www.youtube.com/watch?v=jNQXAC9IVRw, https://youtu.be/jNQXAC9IVRw, a /shorts/ link or just jNQXAC9IVRw.

## `channels` (type: `array`):

Channel URLs, @handles or channel IDs, e.g. https://www.youtube.com/@TED, @veritasium or UCAuUUnT6oDeKwE6v1NGQxug. Gets the newest uploads first, up to the limit below.

## `playlists` (type: `array`):

Playlist URLs or IDs, e.g. https://www.youtube.com/playlist?list=PL... .

## `maxVideosPerChannel` (type: `integer`):

For channels this is the newest N uploads (Shorts and past live streams included).

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

Preferred transcript language code, e.g. en, en-GB, es, de. Human-made captions are used first, then auto-generated ones. If the video has neither in this language you get its original language (with a warning), unless you turn on translation. Leave empty for each video's original language.

## `translate` (type: `boolean`):

Uses YouTube's own machine translation of the captions. YouTube rations translations heavily, so some videos may come back in their original language with a warning.

## `includeTimestamps` (type: `boolean`):

Adds a segments list of { start, duration, text } (in seconds) next to the plain transcript. Handy for subtitles, chapters and linking to the exact moment.

## `maxResults` (type: `integer`):

Stop after this many videos in total.

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

YouTube blocks most datacentre IPs, so residential proxy is the default and recommended. The proxy traffic is included in the price.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw",
    "https://www.youtube.com/watch?v=arj7oStGLkU",
    "https://youtu.be/UF8uR6Z6KLc"
  ],
  "maxVideosPerChannel": 50,
  "language": "en",
  "translate": false,
  "includeTimestamps": false,
  "maxResults": 1000,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `results` (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 = {
    "videos": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw",
        "https://www.youtube.com/watch?v=arj7oStGLkU",
        "https://youtu.be/UF8uR6Z6KLc"
    ],
    "language": "en",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("onibaku/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",
        "https://www.youtube.com/watch?v=arj7oStGLkU",
        "https://youtu.be/UF8uR6Z6KLc",
    ],
    "language": "en",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("onibaku/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",
    "https://www.youtube.com/watch?v=arj7oStGLkU",
    "https://youtu.be/UF8uR6Z6KLc"
  ],
  "language": "en",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call onibaku/youtube-transcripts --silent --output-dataset

```

## MCP server setup

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