# YouTube Transcript Scraper - AI-Ready, Bulk & Fast (`prevailing_glow/youtube-transcript-ai`) Actor

Get YouTube transcripts in bulk from videos, channels, playlists or search: any language, auto-generated & translated captions, SRT/VTT, RAG chunks.

- **URL**: https://apify.com/prevailing_glow/youtube-transcript-ai.md
- **Developed by:** [Dave West](https://apify.com/prevailing_glow) (community)
- **Categories:** Videos, AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.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 - AI-Ready, Bulk & Fast

Get **YouTube transcripts in bulk** from video URLs, whole **channels**, **playlists** or a **YouTube search**, in **any language**: uploaded captions, **auto-generated captions** and **YouTube's own translations**. Every transcript comes as clean **plain text**, **timestamped segments**, **SRT**, **WebVTT** or **Markdown**, ready for LLMs, plus optional **RAG chunks** with start/end timestamps and a link to the exact moment in the video.

Each video is one flat row with the transcript and its **metadata**: title, channel, publish date, duration, views, likes, category, tags, description, chapters and thumbnail. No YouTube API key, no login, no browser.

**$5 per 1,000 transcripts.** Videos without captions, private or deleted videos and failed requests are free.

### What you get

| | Copy-paste from YouTube | This Actor |
|---|---|---|
| Input | one video at a time | video URLs/IDs, channels (`@handle`, `/channel/UC...`), playlists, search queries, mixed |
| Languages | whatever the player shows | your preferred languages in order, then auto-generated, then YouTube's translation, then the original language |
| Formats | wall of text | plain text with paragraphs, timestamped segments, SRT, VTT, Markdown with chapter headings and timestamp links |
| RAG | - | chunks by tokens or characters, with overlap, cut on caption boundaries, each with `start`, `end` and a `&t=` link |
| Metadata | - | title, channel, publish date, duration, views, likes, category, tags, description, chapters, thumbnail, live/short flags |
| No captions | - | clear free row with the reason; optional AI transcription with your own Gemini key |
| Scale | - | 5 videos in parallel, sticky proxy sessions, retries, consent-page handling |

### Use cases

- **Chat with videos / RAG**: feed lectures, podcasts, conference talks or a whole channel into a vector database. Chunks keep their timestamps so answers can link to the exact second.
- **Summaries and research**: summarize keynotes, earnings calls or interviews with an LLM; compare what creators say about a topic.
- **Content repurposing**: turn videos into blog posts, newsletters, show notes or social posts. Markdown output has chapter headings.
- **Subtitles**: download SRT/VTT files in your language, including YouTube's translations.
- **SEO and market research**: what does a channel or a search result page talk about? Keywords, topics, tags and view counts in one table.
- **Datasets**: build speech/text datasets from public videos (check the creators' rights first).

### Quick start

1. Paste video URLs under **Video URLs or IDs**, and/or channels, playlists or a search query.
2. Pick your **preferred languages** (e.g. `en`, `de`) and the **formats** you need.
3. For RAG, set **RAG chunks** to `rows` (one dataset row per chunk) or `inline`.
4. Run, then download the dataset as JSON, CSV or Excel (views: Overview, Transcripts, Metadata, RAG chunks).

Leave everything empty for a **free preview** of one TED talk.

### Input example

```json
{
    "videoUrls": ["https://www.youtube.com/watch?v=8jPQjjsBbIc", "https://youtu.be/o8NiE3XMPrM", "RGOj5yH7evk"],
    "channelUrls": ["@TED"],
    "playlistUrls": [],
    "searchQueries": ["vector database explained"],
    "maxVideosPerSource": 20,
    "preferredLanguages": ["en"],
    "outputFormats": ["text", "segments", "srt"],
    "chunking": "rows",
    "chunkSize": 500,
    "chunkOverlap": 50,
    "chunkUnit": "tokens"
}
```

- **Sources**: `videoUrls` accepts watch, `youtu.be`, Shorts, embed and live URLs or bare 11-character IDs. `channelUrls` accepts `https://www.youtube.com/@handle`, `@handle`, `/channel/UC...`, `/c/...` and `/user/...`. `playlistUrls` accepts playlist URLs or IDs. `searchQueries` returns the top videos for each query. Duplicates are removed.
- **Limits**: `maxVideosPerSource` (default 20, newest first for channels), `channelVideoType` (`videos`, `shorts`, `live` or `all`), `maxTotalVideos` (default 1,000).
- **Languages**: `preferredLanguages` in order of preference (`en`, `en-GB`, `pt-BR`...). `allowAutoGenerated` (default on), `translateIfMissing` (default on: uses YouTube's machine translation when the video has captions in another language), `anyLanguageFallback` (default on: otherwise returns the original language).
- **Formats** (`outputFormats`): `text`, `segments`, `srt`, `vtt`, `markdown`.
- **RAG chunks** (`chunking`): `off`, `inline` (array in the video row), `rows` (separate `recordType: "chunk"` rows) or `both`. `chunkSize` and `chunkOverlap` in `tokens` (≈ 4 characters) or `chars`.
- **Metadata**: `includeMetadata` (default on) adds description, chapters, tags, likes and category.
- **AI transcription** (optional, default off, needs your own Gemini API key): see below.
- **Proxy**: see "Proxies and blocking".

### Output

One row per video. Real example (October 2026, shortened):

```json
{
  "recordType": "video",
  "videoId": "8jPQjjsBbIc",
  "url": "https://www.youtube.com/watch?v=8jPQjjsBbIc",
  "status": "ok",
  "hasTranscript": true,
  "errorReason": null,
  "title": "How to stay calm when you know you'll be stressed | Daniel Levitin | TED",
  "channelName": "TED",
  "channelId": "UCAuUUnT6oDeKwE6v1NGQxug",
  "channelUrl": "https://www.youtube.com/@TED",
  "publishDate": "2015-11-23T08:58:55-08:00",
  "durationSeconds": 740,
  "duration": "12:20",
  "viewCount": 19999346,
  "likeCount": 268643,
  "category": "Science & Technology",
  "tags": ["TED Talk", "TED Talks", "Neuroscience (Field Of Study)", "stress"],
  "thumbnailUrl": "https://i.ytimg.com/vi_webp/8jPQjjsBbIc/sddefault.webp",
  "isLive": false,
  "isShort": false,
  "language": "en",
  "languageName": "English",
  "captionType": "manual",
  "translatedFrom": null,
  "languageMatched": true,
  "availableLanguages": [{ "code": "ar", "name": "Arabic", "autoGenerated": false }, "..."],
  "segmentCount": 260,
  "wordCount": 2232,
  "tokenEstimate": 3095,
  "transcriptText": "A few years ago, I broke into my own house. I had just driven home, it was around midnight in the dead of Montreal winter...",
  "segments": [{ "start": 13.24, "end": 15.8, "text": "A few years ago, I broke into my own house." }, "..."],
  "srt": "1\n00:00:13,240 --> 00:00:15,800\nA few years ago, I broke into my own house.\n\n2\n...",
  "chunkCount": 13,
  "description": "Visit http://TED.com to get our entire library of TED Talks...",
  "chapters": [],
  "chargedEvents": ["transcript"]
}
```

A chunk row (`chunking: "rows"`, 300 tokens):

```json
{
  "recordType": "chunk",
  "videoId": "8jPQjjsBbIc",
  "title": "How to stay calm when you know you'll be stressed | Daniel Levitin | TED",
  "channelName": "TED",
  "language": "en",
  "chunkIndex": 0,
  "chunkCount": 13,
  "text": "A few years ago, I broke into my own house. I had just driven home...",
  "start": 13.24,
  "end": 81.336,
  "url": "https://www.youtube.com/watch?v=8jPQjjsBbIc&t=13s",
  "tokenEstimate": 291
}
```

- `status`: `ok`, `no_captions`, `private`, `unavailable` (deleted or region-blocked), `age_restricted`, `members_only`, `live_or_upcoming`, `blocked` (YouTube kept refusing the request after retries) or `error`. Every non-`ok` row has a readable `errorReason` and is **not charged**.
- `captionType`: `manual` (uploaded by the creator), `auto-generated`, `translated` (YouTube's machine translation; `translatedFrom` says from which language) or `ai-transcription`.
- `languageMatched`: false when none of your preferred languages was available and the original language was returned instead.
- Times are in seconds. `chapters` come from the description timestamps. Email addresses and phone numbers in descriptions are replaced by `[email removed]` / `[phone removed]`.
- Channels, playlists or searches that cannot be read get a free `recordType: "source"` row with the reason.

The key-value store record `SUMMARY` has the totals: videos by status, success rate, caption types, languages, AI transcription stats, sources, charges, and network usage (requests, retries, blocked responses, MB per proxy type and KB per video).

### AI transcription for videos without captions (optional, bring your own key)

Some videos have no captions at all (common for new uploads, music-heavy videos and some languages). Turn on **Transcribe videos without captions with AI** and paste **your own Gemini API key** (free to create in [Google AI Studio](https://aistudio.google.com/)) to transcribe them with **Google Gemini**. Gemini listens to the public video directly: nothing is downloaded on our side, and it takes 10-30 s per video. If Gemini cannot read the video, the Actor tries to download the audio track and send it to Gemini instead.

- **Your key is required.** Without a key the option does nothing and those videos stay free `no_captions` rows (the run shows a warning).
- **No AI charge from this Actor**: only the normal transcript event ($0.005) applies when AI produced a transcript. Google bills your key directly, at about $0.001-0.002 per audio minute with `gemini-3.5-flash-lite` on the paid tier. On Google's free tier, rate limits and Google's terms apply.
- The key field is a secret input: stored encrypted, used only for your run, never logged or written to the output.
- The result has `captionType: "ai-transcription"`, the detected language and sentence-level timestamps (accurate to about a second).
- Only videos up to `aiMaxVideoMinutes` (default 30) are transcribed, so a long livestream cannot run up your Gemini bill.
- Failures (no speech, refused video) are free.
- Captions from YouTube are always preferred: AI only runs when a video has no captions in any language.

### Proxies and blocking

YouTube blocks most datacenter IPs for transcripts. In our tests on Apify (October 2026, 85 videos each): **residential proxy 100% success**, datacenter proxy 0%, no proxy 4%. So the default is **Apify Residential proxy, used only for the small player and caption requests** (about 45-55 KB per video); channel/playlist listing and metadata go through cheaper datacenter proxies. The Actor uses sticky sessions, rotates them when YouTube shows a bot check or HTTP 429, sets the consent cookie so EU consent pages never appear, and retries with backoff.

You can choose your own proxy in **Proxy configuration** (datacenter, specific groups or your own proxy URLs). With a datacenter proxy, **Residential fallback** (default on) retries only the blocked caption requests through residential.

### Speed

About **1.4 videos per second** with the default 5 in parallel: 85 videos from 5 sources in 60 s on Apify (256 MB), 51 videos in 16 s from a residential connection. Long videos are not slower: a transcript is a few kilobytes. AI transcription adds 10-30 s per video (2 at a time).

### Pricing

Pay per event, no subscription:

| Event | Price | When |
|---|---|---|
| Transcript (`transcript`) | **$0.005** | per video returned with a transcript (any format, chunks and metadata included; also for AI transcriptions made with your own Gemini key) |

- 1,000 transcripts: **$5**. A channel's 20 newest videos: $0.10. That is the only charge: no AI fees, no proxy fees.
- **Free**: videos without captions, private, deleted or blocked videos, failed AI transcriptions, source errors, and the preview run with empty input.
- The run never exceeds your **maximum total charge per run**: before each video the remaining budget is checked, and the run stops cleanly when it is reached (`skippedBudget` in SUMMARY).

### Limitations

- **Only public videos.** Private, members-only and age-restricted videos (which need a login) are returned as free rows with that status.
- **Translations** are YouTube's own machine translations and only exist for videos with captions in some language. YouTube occasionally refuses translation requests; the Actor then returns the original language with a note.
- **Auto-generated captions** have no punctuation in some languages and can contain recognition errors.
- **Search** returns YouTube's ranking for an anonymous user in the US, not your personal results. Channel listings are newest first.
- **Comments, subscriber lists and contact data are not collected.** Emails and phone numbers in descriptions are removed.
- **AI transcription** needs your own Gemini API key, is limited to `aiMaxVideoMinutes` and depends on Gemini accepting the video; music-only videos return "no speech".
- YouTube changes its internals from time to time. The Actor uses YouTube's public player endpoints and is maintained against those changes.

### FAQ

**Do I need a YouTube API key?** No. The Actor reads the same public caption tracks the YouTube player uses.

**Why is a video `no_captions` when YouTube shows a transcript button?** Very new videos can take hours before auto-generated captions appear. Re-run later, or turn on AI transcription with your own Gemini key.

**Which language do I get?** The first of your preferred languages that exists (uploaded before auto-generated), then a YouTube translation into your first language, then the original language. `language`, `captionType`, `translatedFrom` and `languageMatched` tell you what you got, and `availableLanguages` lists all tracks.

**How big should RAG chunks be?** 300-800 tokens with 10-15% overlap works well for most embedding models. Chunks never cut a caption line in half, and each chunk has its own timestamp link.

**Can I run it on a schedule or via API?** Yes: schedule it in the Console (e.g. a channel's newest videos every day), call it via the API, or connect it to Make, Zapier, n8n, LangChain or LlamaIndex.

**Is it legal?** The Actor only reads publicly available captions and metadata, no personal data. Transcripts are the creators' content: check copyright and YouTube's terms for your use case.

### Support

Missing a format, a field or a language case? Open an issue on the Actor's Issues tab with the video URL and what you expected.

This Actor is not affiliated with or endorsed by YouTube or Google.

# Actor input Schema

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

YouTube video links (watch, youtu.be, shorts, embed, live) or 11-character video IDs, one per line. Each video with a transcript is one billable <b>transcript</b> event.

## `channelUrls` (type: `array`):

Channels as <code>@handle</code>, <code>https://www.youtube.com/@handle</code>, <code>/channel/UC...</code>, <code>/c/name</code> or <code>/user/name</code>. The newest uploads are scraped, up to <b>Max videos per channel / playlist / search</b>.

## `playlistUrls` (type: `array`):

Playlist links (<code>https://www.youtube.com/playlist?list=PL...</code>) or playlist IDs. Videos are taken in playlist order.

## `searchQueries` (type: `array`):

YouTube searches (videos only, YouTube's relevance order), one per line. Up to <b>Max videos per channel / playlist / search</b> results each.

## `maxVideosPerSource` (type: `integer`):

How many videos to take from each channel, playlist and search query.

## `channelVideoType` (type: `string`):

Which uploads to take from channels: regular videos (default), Shorts, past live streams, or all uploads.

## `maxTotalVideos` (type: `integer`):

Upper limit on videos per run over all inputs (duplicates are removed).

## `preferredLanguages` (type: `array`):

Language codes in order of preference, e.g. <code>en</code>, <code>de</code>, <code>pt-BR</code>. Uploaded (human) captions are preferred over auto-generated ones. Leave empty to get each video's original language.

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

Use YouTube's automatic (speech recognition) captions when no uploaded captions exist in a preferred language.

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

If a video has no captions in your preferred language, ask YouTube to machine-translate an existing track into it (where YouTube offers translation). Marked as <code>captionType: translated</code>.

## `anyLanguageFallback` (type: `boolean`):

If nothing matches (and no translation is possible), return the captions in the video's own language instead of a no-captions row. <code>languageMatched</code> is false on such rows.

## `outputFormats` (type: `array`):

Which transcript fields each video row gets. Plain text has paragraph breaks; segments have start/end times in seconds; markdown has chapter headings and timestamp links.

## `chunking` (type: `string`):

Split each transcript into chunks for embeddings / retrieval. Chunks follow caption boundaries, carry start/end timestamps and a link to the exact moment. <b>Separate rows</b> gives one dataset row per chunk (ready for vector-database loaders); chunk rows are free.

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

Maximum chunk size in the unit below (default 500 tokens).

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

Overlap between consecutive chunks, in whole captions up to this size (at most half the chunk size).

## `chunkUnit` (type: `string`):

Tokens are estimated (~4 characters per token, 1 per CJK character), close to OpenAI / Gemini tokenizers.

## `includeMetadata` (type: `boolean`):

Publish date, description, chapters, tags, category and likes. Title, channel, duration, views and thumbnail are always included.

## `aiTranscriptionFallback` (type: `boolean`):

Bring your own key: needs your Gemini API key in the field below (without it this option does nothing). For public videos that have no captions at all, Google Gemini transcribes the speech (it reads the public video directly; if that fails, the audio is downloaded and sent). Not charged by this Actor: only the normal transcript event applies, and Google bills your key. Off by default.

## `aiMaxVideoMinutes` (type: `integer`):

Longer videos without captions are skipped (free row).

## `geminiApiKey` (type: `string`):

Required for AI transcription. Create a key in Google AI Studio (aistudio.google.com). Google bills your key directly (about $0.001-0.002 per audio minute with gemini-3.5-flash-lite on the paid tier); this Actor adds no AI charge. Stored encrypted, used only for your run, never logged or written to the output.

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

YouTube blocks most cloud IPs for captions (tested: residential 100% success, datacenter 0%). Residential proxies are used only for the small player and caption requests (~50 KB per video, never for audio); listing and metadata use datacenter. If residential proxies are not available, datacenter proxies with retries are used.

## `residentialFallback` (type: `boolean`):

Only when the proxy above is datacenter: caption requests that stay blocked after retries are retried once more through Apify RESIDENTIAL proxy (if your account has it). Never used for listing or audio.

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

Videos processed at the same time.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=8jPQjjsBbIc",
    "https://www.youtube.com/watch?v=o8NiE3XMPrM",
    "https://www.youtube.com/watch?v=RGOj5yH7evk"
  ],
  "maxVideosPerSource": 20,
  "channelVideoType": "videos",
  "maxTotalVideos": 1000,
  "preferredLanguages": [
    "en"
  ],
  "allowAutoGenerated": true,
  "translateIfMissing": true,
  "anyLanguageFallback": true,
  "outputFormats": [
    "text",
    "segments"
  ],
  "chunking": "off",
  "chunkSize": 500,
  "chunkOverlap": 50,
  "chunkUnit": "tokens",
  "includeMetadata": true,
  "aiTranscriptionFallback": false,
  "aiMaxVideoMinutes": 30,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "residentialFallback": true,
  "maxConcurrency": 5
}
```

# Actor output Schema

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

One row per video: status, language, caption type, size.

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

Full rows incl. transcript formats, chunks and metadata.

## `summary` (type: `string`):

Counts by status, success rate, charges, proxy usage.

# 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=8jPQjjsBbIc",
        "https://www.youtube.com/watch?v=o8NiE3XMPrM",
        "https://www.youtube.com/watch?v=RGOj5yH7evk"
    ],
    "preferredLanguages": [
        "en"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("prevailing_glow/youtube-transcript-ai").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=8jPQjjsBbIc",
        "https://www.youtube.com/watch?v=o8NiE3XMPrM",
        "https://www.youtube.com/watch?v=RGOj5yH7evk",
    ],
    "preferredLanguages": ["en"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("prevailing_glow/youtube-transcript-ai").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=8jPQjjsBbIc",
    "https://www.youtube.com/watch?v=o8NiE3XMPrM",
    "https://www.youtube.com/watch?v=RGOj5yH7evk"
  ],
  "preferredLanguages": [
    "en"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call prevailing_glow/youtube-transcript-ai --silent --output-dataset

```

## MCP server setup

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

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/hs4xUbLQILN5dMpam/builds/FccuRuApk8joA4Ivp/openapi.json
