# YouTube Transcript Scraper - Subtitles to Text for AI (`blues_akg/youtube-transcript-scraper`) Actor

Get YouTube video transcripts in bulk: plain text, timestamped segments and AI-ready chunks for RAG. Pick your language, fall back to auto-generated captions, and get video details like channel, views and publish date. $4 per 1,000 transcripts.

- **URL**: https://apify.com/blues\_akg/youtube-transcript-scraper.md
- **Developed by:** [Atakan Kerem GOCER](https://apify.com/blues_akg) (community)
- **Categories:** AI, Videos, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $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

## YouTube Transcript Scraper - Subtitles to Text for AI

Turn YouTube videos into text. Paste a list of video URLs and get the full transcript of each one — as plain text, as timestamped segments, and optionally as ready-to-embed chunks for AI and RAG pipelines — together with the video's title, channel, length, views and publish date.

- **Bulk**: thousands of videos per run, fetched in parallel
- **Language choice**: ask for `en, de, tr` in order of preference, with an experimental machine-translation option
- **Built for AI**: one switch splits the transcript into overlapping chunks, each with its start time
- **Honest billing**: videos with no captions are reported separately and never charged

### Who uses it

- **AI and RAG pipelines** — feed video knowledge into a vector database
- **Content teams** — repurpose videos into articles, summaries and newsletters
- **Researchers** — analyse what is said across hundreds of videos
- **SEO** — turn talks and tutorials into indexable text

### Example output

```json
{
  "videoId": "aircAruvnKk",
  "url": "https://www.youtube.com/watch?v=aircAruvnKk",
  "title": "But what is a neural network? | Deep learning chapter 1",
  "channel": "3Blue1Brown",
  "language": "en",
  "isAutoGenerated": false,
  "isTranslated": false,
  "characterCount": 18430,
  "segmentCount": 286,
  "transcript": "This is a 3. It's sloppily written and rendered at an extremely low resolution…",
  "channelId": "UCYO_jab_esuFRV4b17AJtAw",
  "durationSeconds": 1120,
  "viewCount": 24390646,
  "publishedAt": "2017-10-05T08:11:25-07:00",
  "category": "Education",
  "availableLanguages": ["ar", "de", "en", "es", "fr", "hi", "tr"],
  "segments": [
    { "start": 4.2, "duration": 1.8, "text": "This is a 3." }
  ],
  "chunks": [
    { "start": 4.2, "end": 112.7, "text": "This is a 3. It's sloppily written…" }
  ]
}
```

### Input

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://youtu.be/jNQXAC9IVRw",
    "dQw4w9WgXcQ"
  ],
  "languages": ["en"],
  "chunkSize": 1000,
  "chunkOverlap": 200
}
```

| Field | What it does |
|---|---|
| `videos` | Watch, youtu.be, Shorts, embed or live URLs, or bare 11-character IDs. |
| `languages` | Preferred caption languages in order. Empty means the language spoken in the video. |
| `allowAutoGenerated` | Accept YouTube's speech-recognition captions. On by default — most videos have nothing else. |
| `translateIfMissing` | Ask YouTube to machine-translate when your language is not available. Experimental; see the notes. |
| `includeTimestamps` | Every caption line with its start time and duration. |
| `includeVideoDetails` | Channel, length, views, publish date, category, keywords, description. |
| `chunkSize`, `chunkOverlap` | Split the transcript into overlapping blocks for embedding. 0 disables it. |

### Pricing

| Event | Price |
|---|---|
| Transcript returned | **$0.004** |
| Actor start | $0.00005 per run |

**$4 per 1,000 transcripts**, residential proxies included. A video with no captions in your language costs nothing — it is listed under *Videos without a transcript* with the reason and the languages that do exist. Set **Maximum cost per run** to cap your spend.

### Notes and limits

- **Captions must exist.** This reads the subtitles YouTube already has; it does not transcribe audio. If a video has no captions at all, no charge is made.
- **Auto-generated captions have no punctuation** and misheard words are common. `isAutoGenerated` tells you which kind you got, so you can filter.
- **Proxies are on by default.** YouTube answers datacenter IPs with a "sign in to confirm you're not a bot" page, so runs use rotating residential proxies. The cost is included in the price above.
- **Translation is experimental.** It is YouTube's own machine translation, and at the moment YouTube refuses most such requests (in our tests, all of them). Captions that already exist in your language are unaffected. A refused translation is reported with the reason and not charged; `isTranslated` marks the rows that did get translated. If you need a guaranteed translation, take the original transcript and translate it yourself.
- **Private, deleted, members-only and age-restricted videos** cannot be read, and are reported with the reason.
- **Live streams** only have captions once the recording is processed.

### FAQ

**Can I hand a channel or playlist URL to it?**
Not yet — it takes individual videos. Pair it with a channel scraper to get the video list first, then feed the IDs here.

**Which languages can I ask for?**
Any language the video has captions in; `availableLanguages` in each row shows what existed. With `translateIfMissing` on, YouTube is asked to translate into your first language; see the note on translation above.

**Can I use it from my own code or an AI agent?**
Yes. The API tab has JavaScript, Python and cURL snippets, and the MCP tab exposes it to AI agents.

**Something is wrong or missing.**
Open an issue on the Issues tab with the video URL.

# Actor input Schema

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

One per line. Full URLs (watch, youtu.be, shorts, embed) or bare 11-character video IDs.

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

Two-letter codes in order of preference, for example en, de, tr. Leave empty to take the video's own captions.

## `allowAutoGenerated` (type: `boolean`):

Most videos have no human-written captions. Turn this off to accept only authored subtitles.

## `translateIfMissing` (type: `boolean`):

If none of your preferred languages exists, ask YouTube to machine-translate an available track into the first one. Experimental: YouTube currently refuses most translation requests; a refused video is reported and not charged.

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

Adds every caption line with its start time and duration in seconds.

## `includeVideoDetails` (type: `boolean`):

Adds channel, length, views, publish date, category, keywords and description. Needs one extra request per video.

## `chunkSize` (type: `integer`):

0 means no chunking. Set e.g. 1000 to also get the transcript split into overlapping blocks, each with its start time, ready to embed.

## `chunkOverlap` (type: `integer`):

How much text each chunk repeats from the previous one, so a sentence split across chunks is not lost.

## `maxConcurrency` (type: `integer`):

Lower this if YouTube starts refusing requests.

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

YouTube blocks datacenter IPs with a "sign in to confirm you're not a bot" page, so rotating residential proxies are on by default. They are included in the price.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://youtu.be/jNQXAC9IVRw"
  ],
  "languages": [
    "en"
  ],
  "allowAutoGenerated": true,
  "translateIfMissing": false,
  "includeTimestamps": true,
  "includeVideoDetails": true,
  "chunkSize": 0,
  "chunkOverlap": 200,
  "maxConcurrency": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Full transcript text, timestamped segments, optional AI-ready chunks, and the video's title, channel, length, views and publish date.

## `failedInputs` (type: `string`):

Videos that were unavailable or had no captions, with the reason. These are not charged.

# 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=aircAruvnKk",
        "https://youtu.be/jNQXAC9IVRw"
    ],
    "languages": [
        "en"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

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

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

```

## MCP server setup

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