# YouTube Transcript Scraper: Bulk, SRT, Channels, Playlists (`mosaicked_sponge/youtube-transcript-scraper-api`) Actor

Get YouTube transcripts and subtitles for videos, Shorts, playlists, channels and search results. Timestamps, plain text, SRT/VTT, RAG chunks, any language or free auto-translation. Videos without captions are free. No API key.

- **URL**: https://apify.com/mosaicked_sponge/youtube-transcript-scraper-api.md
- **Developed by:** [Jason](https://apify.com/mosaicked_sponge) (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 $2.00 / 1,000 transcript delivereds

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: Bulk, SRT, Channels, Playlists

Get the transcript of any YouTube video, Short, playlist, channel or search result as clean JSON. No YouTube API key, no login, no cookies.
Built for AI agents, RAG pipelines, content repurposing, research and SEO.

![YouTube Transcript Scraper - sample output](https://api.apify.com/v2/key-value-stores/QpfrAb6wndEDB0tDd/records/output-Hipj3YOdnWxpP0HK4.png)

### What you get

For every video one row with:

- **Transcript text** (`transcript`), optional **timestamped segments** (`segments`: start, duration, text), optional **SRT** and **WebVTT**, optional **RAG chunks** (`chunks`: text with start/end seconds, sized to your setting).
- **Language details**: `language`, `isAutoGenerated`, `isTranslated`, `availableLanguages`, and a `note` if your language was not available.
- **Metadata**: title, channel, channelId, view count, duration, keywords, thumbnail, publish date, optional description.
- **Honest status** on every row: `ok`, `no_captions`, `unavailable`, `private`, `age_restricted`, `language_unavailable`, `invalid_url`, `blocked`, `skipped_time_limit`, `no_videos`. Only `ok` rows are charged.

### Inputs you can mix freely

- Video links (`watch`, `youtu.be`, `shorts`, `embed`, `live`)
- Playlist links
- Channel links (`@handle`, `/channel/UC...`, `/c/`, `/user/`) with a choice of Videos, Shorts or Past live streams tab, newest first
- YouTube search queries (top videos of each query)

Set `maxVideosPerSource` (default 10) and `maxVideos` (global cap) so you only pay for what you want. Duplicate videos across sources are processed once.

### Languages

- `languages`: ordered preference list, e.g. `["en","de"]`. Human-made captions are preferred over automatic ones (switchable).
- `translateTo`: use the native caption in that language if the video has one, otherwise YouTube's own caption translation.
- `anyLanguageFallback`: if none of your languages exist, get whatever the video has, flagged in the row, instead of nothing.

### Pricing (pay per event)

- **$2.00 per 1,000 transcripts delivered** (`transcript-fetched`, $0.002 each) plus a $0.00005 start fee.
- **Free**: videos without captions, private/removed/age-restricted videos, live recordings that are unavailable, invalid links, duplicates, and anything that fails.
- Your **max charge per run** is respected exactly: the Actor stops as soon as the next transcript would exceed it.
- **Platform usage is included.** You pay only the event prices above. Apify compute and the Residential proxy that YouTube requires are covered by the price; they are not billed to you on top.

### Speed and reliability (measured on the Apify platform)

- 100 videos from a channel in 71 s on 256 MB, 99 delivered, 1 correctly reported as having no captions.
- Default input (one TED talk) finishes in about 5 to 10 s.
- Spot-check on Oct 23, 2026: the transcript of "Me at the zoo" (the first YouTube video) matched the caption text shown on YouTube's own page word for word, including the sound cue.
- A 10-video mixed run (a Short without captions, music videos, talks, a 50,000-word course, a removed video and a duplicate) delivered 8 transcripts, charged exactly 8, and returned the other rows as free rows with a status.

### Limits you should know

- Only videos that have captions (manual or automatic) can be transcribed. This Actor reads YouTube's own captions; it does not run speech-to-text on audio.
- Private, age-restricted, members-only and region-locked videos return a free explanatory row.
- Very long videos (10+ hours) produce large rows; if the combined formats would exceed Apify's 9 MB item limit the heaviest extras are dropped and the row says so. Plain text is always kept.
- YouTube can change its internal API at any time. The Actor reports `blocked` (free) instead of returning bad data when YouTube refuses.
- Keep the default proxy setting (Apify Residential). With datacenter IPs or no proxy, YouTube refuses most requests from Apify servers (in our tests only 3 or 4 of 20 videos came back), and those rows are reported as free `blocked` rows.

### Example input

```json
{
  "startUrls": [{"url": "https://www.youtube.com/@TED/videos"}],
  "maxVideosPerSource": 25,
  "languages": ["en"],
  "includeSegments": false,
  "includeSrt": true,
  "chunkSizeChars": 1500
}
```

### Example output (shortened)

```json
{
  "videoId": "iG9CE55wbtY",
  "status": "ok",
  "title": "Do schools kill creativity? | Sir Ken Robinson | TED",
  "channelName": "TED",
  "language": "en", "isAutoGenerated": false, "isTranslated": false,
  "wordCount": 3170, "segmentCount": 427,
  "transcript": "Good morning. How are you?...",
  "segments": [{"start": 11.97, "duration": 1.5, "text": "Good morning."}],
  "publishDate": "2007-01-06"
}
```

### Using it with AI agents and automation

Output is plain JSON, so it plugs into LangChain, LlamaIndex, n8n, Make, Zapier or the Apify MCP server. Use `chunks` for embeddings and `segments` when you need to link back to a timestamp (`https://youtu.be/ID?t=SECONDS`).

### Legal

The Actor retrieves publicly available caption data that YouTube serves to any viewer. You are responsible for using transcripts in line with YouTube's Terms of Service, copyright law and privacy rules in your jurisdiction.

# Actor input Schema

## `startUrls` (type: `array`):

Paste video, Shorts, playlist or channel links (youtube.com/watch, youtu.be, /shorts, /playlist, /@handle, /channel/UC...). A bare 11-character video ID works too through the API. Channels and playlists are expanded into their videos.

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

Search YouTube and get transcripts for the top video results of each query.

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

How many videos to take from each channel, playlist or search query (newest first for channels).

## `maxVideos` (type: `integer`):

Hard cap on the number of videos processed in this run, across all links and searches.

## `channelTab` (type: `string`):

Which tab to read when a link points to a channel.

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

Language codes in order of preference, e.g. en, de, pt-BR. The first one that exists is used.

## `preferManualCaptions` (type: `boolean`):

Use captions uploaded by the creator when they exist, otherwise YouTube's automatic captions. Turn off to prefer automatic captions.

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

If none of your preferred languages exists, return whichever caption track the video has (flagged in the row) instead of an empty free row.

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

Language code such as es, de, fr, ja or pt-BR. If the video has no captions in that language, YouTube's own caption translation is used. Leave empty for no translation.

## `includeFullText` (type: `boolean`):

Add a 'transcript' field with the whole transcript as one string.

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

Add a 'segments' array: start (seconds), duration, text.

## `includeSrt` (type: `boolean`):

Add an 'srt' field.

## `includeVtt` (type: `boolean`):

Add a 'vtt' field.

## `chunkSizeChars` (type: `integer`):

Add a 'chunks' array of consecutive transcript pieces of about this many characters, each with start and end seconds. 1000 to 2000 suits most embedding pipelines.

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

Title, channel, views, duration, keywords, thumbnail and the list of available caption languages.

## `includePublishDate` (type: `boolean`):

Adds the publish date (one extra request per video; turn off for the fastest runs).

## `includeDescription` (type: `boolean`):

Add the video description text.

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

YouTube blocks most datacenter IPs, so the default is Apify Residential proxy (about 20 KB per video, roughly $0.0002 per video billed by Apify on top of the event price). If residential is not available on your plan the Actor falls back to the datacenter proxy, which fails on a large share of videos.

## `tryDirectFirst` (type: `boolean`):

Only useful when running outside Apify or from a clean IP. On the Apify platform YouTube blocks direct connections, so leave this off.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/@TED/videos"
    }
  ],
  "searchQueries": [
    "python web scraping tutorial"
  ],
  "maxVideosPerSource": 10,
  "maxVideos": 0,
  "channelTab": "videos",
  "languages": [
    "en"
  ],
  "preferManualCaptions": true,
  "anyLanguageFallback": true,
  "translateTo": "",
  "includeFullText": true,
  "includeSegments": true,
  "includeSrt": false,
  "includeVtt": false,
  "chunkSizeChars": 0,
  "includeMetadata": true,
  "includePublishDate": true,
  "includeDescription": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "tryDirectFirst": false
}
```

# Actor output Schema

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

One row per video: metadata plus the transcript in the formats you chose. Rows without a transcript are free and explain why.

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

OUTPUT record: counts, status per type, network stats.

# 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 = {
    "startUrls": [
        {
            "url": "https://www.youtube.com/watch?v=iG9CE55wbtY"
        }
    ],
    "languages": [
        "en"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("mosaicked_sponge/youtube-transcript-scraper-api").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 = {
    "startUrls": [{ "url": "https://www.youtube.com/watch?v=iG9CE55wbtY" }],
    "languages": ["en"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

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

```

## MCP server setup

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

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/Hipj3YOdnWxpP0HK4/builds/wjnec81W8Xx3H6Afv/openapi.json
