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

Get YouTube video transcripts as clean text and timestamped segments, in bulk. Pick caption languages, auto-translate, and feed summaries, RAG pipelines or AI agents. Pay only per transcript delivered; videos without captions are free.

- **URL**: https://apify.com/damilo/youtube-transcript-scraper.md
- **Developed by:** [Imad](https://apify.com/damilo) (community)
- **Categories:** AI, Social media, Developer tools
- **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

Turn any list of YouTube videos into clean transcripts — plain text **and** timestamped segments — in one run. Pick the caption language, let YouTube auto-translate, process hundreds of videos at once, and pay only for the transcripts you actually receive. Built for AI summaries, RAG pipelines, content repurposing, subtitles and research.

### What does the YouTube Transcript Scraper do?

Paste YouTube URLs or video IDs and the actor fetches each video's captions — human-made or auto-generated — straight from YouTube, without downloading video or audio. For every video you get the full transcript as text, the same transcript as `segments` with start times and durations, the caption language, whether it was auto-generated, the list of all available caption languages, and the video's title, channel and duration.

- 🎯 **Bulk** — hundreds of videos per run, processed in parallel (`maxConcurrency`).
- 🌍 **Language control** — preferred languages in priority order (`en`, `en-US`, `es`, …), human-made captions preferred over auto-generated, optional fallback to any available language.
- 🔁 **Translation** — ask for YouTube's automatic translation of the chosen track (`translateTo: "fr"`).
- ⏱ **Timestamps** — `segments` with `start`, `duration` and `text`, ready for subtitle files, clip search or chaptering.
- 💸 **Fair pricing** — videos without captions (or private/unavailable ones) are returned as `found: false` rows and are **not charged**.
- 🤖 **Agent-ready** — JSON output with a documented schema, callable through the Apify API, Make, Zapier, n8n or an AI agent via Apify's MCP server.

#### What data does the scraper return?

| Field | Description |
| --- | --- |
| `videoId`, `url` | Video ID and canonical watch URL |
| `title`, `channel`, `channelId`, `durationSeconds` | Video metadata |
| `found` | `true` when a transcript was delivered |
| `language`, `languageName`, `isGenerated` | Caption track used and whether it is auto-generated |
| `translatedTo` | Language code when `translateTo` was applied, else `null` |
| `transcript` | The full transcript as one plain-text string |
| `wordCount`, `segmentCount` | Size of the transcript |
| `segments` | Array of `{ "start", "duration", "text" }` (seconds), when `includeSegments` is on |
| `availableLanguages` | Every caption track YouTube offers for the video: `{ "code", "name", "isGenerated" }` |
| `warning` | Caveat on a delivered transcript, e.g. the requested translation was refused by YouTube and the original language was returned (`null` otherwise) |
| `error` | Why no transcript was delivered (`null` on success) |

### How to get a YouTube transcript — step by step

1. Click **Try for free** (a free Apify account takes a minute).
2. Paste your video URLs or IDs into **YouTube video URLs or IDs**, one per line. Watch URLs, `youtu.be` links, Shorts, embeds and bare IDs all work.
3. Optionally set **Preferred caption languages** (default `en`) and **Translate to**.
4. Click **Start**. Results appear in the **Dataset** tab; export them as JSON, CSV, Excel or XML, or fetch them via the API.

### How much does it cost to scrape YouTube transcripts?

**$4 per 1,000 transcripts** ($0.004 each), charged per transcript delivered. Videos with no captions, private or removed videos cost nothing. Apify's free plan includes $5 of monthly usage, enough for roughly 1,000 transcripts per month at no cost — no credit card needed to try.

### Input example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://youtu.be/jNQXAC9IVRw",
    "dQw4w9WgXcQ"
  ],
  "languages": ["en"],
  "translateTo": "",
  "includeSegments": true
}
```

### Output example

```json
{
  "videoId": "aircAruvnKk",
  "url": "https://www.youtube.com/watch?v=aircAruvnKk",
  "title": "But what is a neural network? | Deep learning chapter 1",
  "channel": "3Blue1Brown",
  "channelId": "UCYO_jab_esuFRV4b17AJtAw",
  "durationSeconds": 1120,
  "found": true,
  "language": "en",
  "languageName": "English",
  "isGenerated": false,
  "translatedTo": null,
  "transcript": "This is a 3. It's sloppily written and rendered at an extremely low resolution of 28 by 28 pixels …",
  "wordCount": 3357,
  "segmentCount": 286,
  "segments": [
    { "start": 4.22, "duration": 1.18, "text": "This is a 3." },
    { "start": 5.4, "duration": 2.3, "text": "It's sloppily written and rendered at an extremely low resolution of 28 by 28 pixels" }
  ],
  "availableLanguages": [
    { "code": "en", "name": "English", "isGenerated": false },
    { "code": "es", "name": "Spanish", "isGenerated": false }
  ],
  "error": null
}
```

A video without captions is returned as `{ "videoId": "…", "found": false, "error": "No captions available for this video", … }` — and is not charged.

### What can you build with YouTube transcripts?

- **AI summaries and chat with videos** — feed transcripts to Claude, GPT or an open model; `segments` let the model cite timestamps.
- **RAG and knowledge bases** — index channels, courses and conference talks for retrieval.
- **Content repurposing** — turn videos into blog posts, newsletters, social posts or SEO articles.
- **Subtitles and accessibility** — generate `.srt`/`.vtt` files from `segments`.
- **Research and monitoring** — search what is said across many videos, track mentions of brands, products or topics.
- **Language learning** — original captions plus `translateTo` for parallel texts.

### Use it as a tool for AI agents

Through [Apify's MCP server](https://apify.com/actors/mcp-server), agents can call this actor with a list of videos and receive transcripts in a stable JSON schema — no browser automation, no audio transcription delay, and the `found`/`error` fields make failures explicit instead of hallucinated.

### FAQ

#### Does it work with auto-generated captions?

Yes. If a video only has YouTube's automatic captions, you get those and the row says `isGenerated: true`. When both exist, human-made captions win by default (`preferManual`).

#### Which languages are supported?

Every caption track YouTube offers for the video — `availableLanguages` lists them. Use `languages` to set your preference order; `translateTo` returns YouTube's automatic translation for translatable tracks. YouTube rate-limits translations much harder than plain captions: if it refuses one, you still get the original-language transcript, with the reason in `warning`, and you are charged once as usual.

#### Why is a transcript missing for some videos?

The video has no captions at all, is private, removed or age-restricted, or YouTube temporarily refused the request. The `error` field says which. Missing transcripts are never charged. Playlist and channel URLs are not supported yet — list the video URLs (our Google Search scraper with `site:youtube.com` queries is a quick way to collect them).

#### Does it download the video or audio?

No. Only the caption data is fetched, so runs finish in seconds and no copyrighted media is copied. For videos without captions, pair it with a speech-to-text service.

#### Is scraping YouTube transcripts legal?

Captions are publicly available data, and this actor only reads what YouTube serves to any viewer. You are responsible for how you use the content — respect copyright and YouTube's terms of service, and do not republish full transcripts you do not have rights to.

#### Can I get SRT or VTT subtitles?

Yes — export the dataset as JSON and convert `segments` (start and duration in seconds) to SRT/VTT; a few lines of code or any subtitle tool will do.

### More data tools by damilo

- [Google Search Results Scraper](https://apify.com/damilo/google-search-apify) — find videos, articles and competitors for any keyword (`site:youtube.com` queries work great with this actor).
- [Google Autocomplete Scraper](https://apify.com/damilo/google-autocomplete-apify) — keyword ideas and search intent for your video and content research.
- [Google Images Scraper](https://apify.com/damilo/google-images-scraper) — image results with full-size URLs for thumbnails and visual research.
- [Google Maps Scraper](https://apify.com/damilo/google-maps-scraper) — local business data for lead generation.
- [Google Shopping Scraper](https://apify.com/damilo/google-shopping-apify), [Amazon Search Scraper](https://apify.com/damilo/amazon-search-scraper), [eBay Search Scraper](https://apify.com/damilo/ebay-search-apify) — product and price data.
- [Y Combinator Scraper](https://apify.com/damilo/y-combinator-scraper-apify) — startups, founders and jobs.
- [FDA Acronyms & Abbreviations Database](https://apify.com/damilo/fda-acronyms-abbreviations) — free regulatory acronym lookup.

### Support

Questions, missing features (playlists, channels, SRT export) or a video that should have worked? Use the **Issues** tab — it's answered quickly. If the actor saved you time, a ⭐⭐⭐⭐⭐ review helps other people find it.

# Actor input Schema

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

One per line. Accepts watch URLs, youtu.be links, Shorts, embed and live URLs, or bare 11-character video IDs.

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

Language codes in order of preference, e.g. en, en-US, es, de. The first available one wins.

## `fallbackToAnyLanguage` (type: `boolean`):

If none of the preferred languages exists for a video, return the first available caption track instead of skipping the video.

## `preferManual` (type: `boolean`):

When both a human-made and an auto-generated track exist in the chosen language, use the human-made one.

## `translateTo` (type: `string`):

Optional, best effort. Return YouTube's automatic translation of the chosen track into this language, e.g. fr, es, de, ja. YouTube rate-limits translations heavily; when it refuses, the original-language transcript is returned with a warning. Leave empty for the original language.

## `includeSegments` (type: `boolean`):

Add a segments array (start, duration, text) to every row in addition to the plain transcript text.

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

How many videos to process at the same time.

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

Apify Proxy is used by default. If YouTube blocks datacenter IPs, the actor automatically retries through residential proxies.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://youtu.be/jNQXAC9IVRw"
  ],
  "languages": [
    "en"
  ],
  "fallbackToAnyLanguage": true,
  "preferManual": true,
  "includeSegments": true,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One row per video with transcript, segments, language, title, channel, duration, found flag and error (if any).

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

// Run the Actor and wait for it to finish
const run = await client.actor("damilo/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=aircAruvnKk",
        "https://youtu.be/jNQXAC9IVRw",
    ],
    "languages": ["en"],
    "proxyConfiguration": { "useApifyProxy": True },
}

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

```

## MCP server setup

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