# YouTube Transcripts & Subtitles Scraper (`wyle/youtube-transcripts-scraper`) Actor

Fetch YouTube video transcripts, timestamped caption segments, SRT subtitles, and available languages from any video URL or ID cleanly for AI/RAG pipelines and content analysis.

- **URL**: https://apify.com/wyle/youtube-transcripts-scraper.md
- **Developed by:** [Willy Lengkong](https://apify.com/wyle) (community)
- **Categories:** Videos, AI, Automation
- **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 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Transcripts & Subtitles Scraper

Extract clean YouTube transcripts, timestamped caption segments, ready-to-use SRT subtitles, and video metadata in a single fast run. Supports individual videos, Shorts, live streams, and full playlists without a browser or YouTube account.

### Modes

| Mode | Input | What you get |
|---|---|---|
| **Single & Batch Videos** | `videoUrlsOrIds` (`watch?v=`, `youtu.be/`, `/shorts/`, `/live/`, `/embed/`, or 11-char IDs) | Full plain-text transcript, timestamped cues, SRT subtitles, available languages, and video metadata |
| **Playlist Expansion** | `videoUrlsOrIds` (`youtube.com/playlist?list=...`) + `maxVideosPerPlaylist` | Transcripts and metadata for up to `maxVideosPerPlaylist` videos in the playlist |
| **Caption Translation** | `translateTo` (target ISO language code) | Server-translated transcript in your target language when native captions exist |

### Supported Coverage

- **Output Formats**: Full plain-text `transcriptText`, timestamped `segments[]` (`text`, `startSeconds`, `durationSeconds`, `endSeconds`), and SubRip `transcriptSrt`, plus `segmentCount`, `isAutoGenerated`, `isTranslated`, and `availableLanguages`.
- **Supported Links**: `youtube.com/watch?v=...`, `youtu.be/...`, `youtube.com/shorts/...`, `youtube.com/live/...`, `youtube.com/embed/...`, `youtube.com/playlist?list=...`, and bare 11-character video IDs.
- **Video Metadata**: `videoId`, `url`, `title`, `channelName`, `channelId`, `durationSeconds`, `viewCount`, `language`, `languageName`, `status`, and `error`.

### Output Options & Proxy Tips

- **Language & Track Priority**: `languages` accepts an ordered list of preferred codes (e.g. `["en", "id"]`); if none match, the first available caption track is used. Manual human captions are preferred over auto-generated captions by default (`preferAutoGenerated: false`).
- **Lean Output & Rate Limits**: Disable `includeTimestamps` or `includeSrt` when you only need `transcriptText` for AI/RAG pipelines. Keep `maxConcurrency` moderate (default `4`), especially when using `translateTo`, which is subject to YouTube rate limits.
- **Proxy Recommendations**: Direct connections work well for small and medium batches. For bulk playlists, large video lists, or frequent translations, enable Apify Proxy (`RESIDENTIAL` default when enabled) via `proxyConfiguration`.

### Use Cases

1. **AI & RAG Knowledge Ingestion**: Feed clean, plain-text transcripts and video metadata from tutorials, talks, and playlists directly into vector databases and LLMs.
2. **Content Repurposing & Summaries**: Turn long-form YouTube videos into blog posts, newsletters, show notes, and social threads using timestamped quotes.
3. **Subtitle Localization & Editing**: Export ready-to-use `transcriptSrt` files or request translated caption tracks for editing workflows.
4. **Course & Lecture Indexing**: Build searchable archives across entire YouTube playlists with exact `startSeconds` and `endSeconds` jump links.

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `videoUrlsOrIds` | `array` | `["https://www.youtube.com/watch?v=dQw4w9WgXcQ"]` | YouTube watch URLs, Shorts URLs, `youtu.be` links, playlist URLs, or 11-character video IDs. |
| `languages` | `array` | `["en"]` | Ordered list of preferred caption language codes; falls back to the first available track if none match. |
| `preferAutoGenerated` | `boolean` | `false` | Prefer auto-generated captions over manual human captions when both exist for the same language. |
| `includeTimestamps` | `boolean` | `true` | Include per-cue timestamp segments (`text`, `startSeconds`, `durationSeconds`, `endSeconds`). |
| `includeSrt` | `boolean` | `true` | Include a formatted SRT subtitle string (`transcriptSrt`) in each output item. |
| `translateTo` | `string` | `""` | Optional target ISO language code (e.g. `"es"`, `"id"`) to request caption translation. |
| `maxVideosPerPlaylist` | `integer` | `25` | Maximum number of videos to extract per playlist URL (`1`–`200`). |
| `maxConcurrency` | `integer` | `4` | Maximum number of videos processed concurrently (`1`–`15`). |
| `proxyConfiguration` | `object` | `{"useApifyProxy": false}` | Apify Proxy configuration. Enable Apify Proxy (`RESIDENTIAL` default) for bulk runs or translations. |

### Sample Output

```json
{
  "videoId": "jNQXAC9IVRw",
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "title": "Me at the zoo",
  "channelName": "jawed",
  "channelId": "UC4QobU6STFB0P71PMvOGN5A",
  "durationSeconds": 19,
  "viewCount": 448317182,
  "language": "en",
  "languageName": "English",
  "isAutoGenerated": false,
  "isTranslated": false,
  "availableLanguages": [
    "en",
    "de"
  ],
  "segmentCount": 6,
  "transcriptText": "All right, so here we are, in front of the elephants the cool thing about these guys is that they have really... really really long trunks and that's cool (baaaaaaaaaaahhh!!) and that's pretty much all there is to say",
  "transcriptSrt": "1\n00:00:01,200 --> 00:00:03,360\nAll right, so here we are, in front of the elephants\n\n2\n00:00:05,318 --> 00:00:07,974\nthe cool thing about these guys is that they have really...\n\n3\n00:00:07,974 --> 00:00:12,616\nreally really long trunks\n\n4\n00:00:12,616 --> 00:00:14,367\nand that's cool\n\n5\n00:00:14,421 --> 00:00:15,733\n(baaaaaaaaaaahhh!!)\n\n6\n00:00:16,881 --> 00:00:18,881\nand that's pretty much all there is to say",
  "segments": [
    {
      "text": "All right, so here we are, in front of the elephants",
      "startSeconds": 1.2,
      "durationSeconds": 2.16,
      "endSeconds": 3.36
    },
    {
      "text": "the cool thing about these guys is that they have really...",
      "startSeconds": 5.318,
      "durationSeconds": 2.656,
      "endSeconds": 7.974
    },
    {
      "text": "really really long trunks",
      "startSeconds": 7.974,
      "durationSeconds": 4.642,
      "endSeconds": 12.616
    },
    {
      "text": "and that's cool",
      "startSeconds": 12.616,
      "durationSeconds": 1.751,
      "endSeconds": 14.367
    },
    {
      "text": "(baaaaaaaaaaahhh!!)",
      "startSeconds": 14.421,
      "durationSeconds": 1.312,
      "endSeconds": 15.733
    },
    {
      "text": "and that's pretty much all there is to say",
      "startSeconds": 16.881,
      "durationSeconds": 2.0,
      "endSeconds": 18.881
    }
  ],
  "status": "ok",
  "error": "",
  "scrapedAt": "2026-11-12T10:59:43.326071+00:00"
}
```

# Actor input Schema

## `videoUrlsOrIds` (type: `array`):

List of YouTube watch URLs, Shorts URLs, youtu.be links, Playlist URLs (youtube.com/playlist?list=...), or 11-character video IDs.

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

Ordered list of preferred caption language codes (for example: \['en', 'id']). Picks the first matching track; falls back to the first available track if none match.

## `preferAutoGenerated` (type: `boolean`):

When disabled (default), manual human captions are preferred over auto-generated captions when both exist for the same language.

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

Include per-cue timestamp segments (text, startSeconds, durationSeconds, endSeconds) in each output item.

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

Include a ready-to-use SRT formatted subtitle string in each output item.

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

Optional ISO language code (for example 'es' or 'id') to request YouTube server-side translation if native captions exist in another language (subject to YouTube rate limits).

## `maxVideosPerPlaylist` (type: `integer`):

Maximum number of videos to extract when a YouTube playlist URL is provided.

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

Maximum number of videos processed concurrently (keep moderate to avoid YouTube rate limits).

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

Apify Proxy configuration. Direct works for small/medium runs; enable Apify Proxy (RESIDENTIAL default) for heavy bulk batches or translations.

## Actor input object example

```json
{
  "videoUrlsOrIds": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "languages": [
    "en"
  ],
  "preferAutoGenerated": false,
  "includeTimestamps": true,
  "includeSrt": true,
  "translateTo": "",
  "maxVideosPerPlaylist": 25,
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "videoUrlsOrIds": [
        "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
    ],
    "languages": [
        "en"
    ],
    "translateTo": ""
};

// Run the Actor and wait for it to finish
const run = await client.actor("wyle/youtube-transcripts-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 = {
    "videoUrlsOrIds": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
    "languages": ["en"],
    "translateTo": "",
}

# Run the Actor and wait for it to finish
run = client.actor("wyle/youtube-transcripts-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 '{
  "videoUrlsOrIds": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "languages": [
    "en"
  ],
  "translateTo": ""
}' |
apify call wyle/youtube-transcripts-scraper --silent --output-dataset

```

## MCP server setup

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