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

Get full transcripts (subtitles) of YouTube videos in any available language, with timestamps or as plain text, plus video title, channel and metadata. Ready for summaries, LLM and RAG pipelines.

- **URL**: https://apify.com/flash_kpi/youtube-transcript-scraper.md
- **Developed by:** [YEVHEN VDOVIN](https://apify.com/flash_kpi) (community)
- **Categories:** Videos, AI, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 transcript scrapeds

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

Get the transcript (subtitles / captions) of any YouTube video — as timestamped segments and as plain text. Works with regular videos, Shorts, live recordings, playlists and whole channels. No browser, no YouTube API key, no login.

**You pay only for videos that actually returned a transcript.** Videos without captions, private or deleted videos are reported in the dataset with an `error` field and are not charged.

### What you can do with it

- Feed video transcripts to an LLM: summaries, RAG, content repurposing, SEO articles
- Analyse what a channel talks about — give a channel URL and get transcripts of its latest videos
- Build subtitle datasets in a chosen language
- Monitor competitors, podcasts and interviews

### Input

| Field | Description |
|---|---|
| `videos` | Video URLs or IDs (`watch?v=`, `youtu.be/`, `/shorts/`, `/embed/`, `/live/`), playlist URLs, channel URLs or `@handles` |
| `languages` | Preferred languages in order, e.g. `["en", "es"]`. Manual captions are preferred over auto-generated. If none match, the default track is returned |
| `includeTimestamps` | Include the `segments` array (default `true`) |
| `includeMetadata` | Add publish date, category and description (default `true`) |
| `maxVideosPerList` | How many videos to take from each playlist / channel (default 50) |
| `proxyConfiguration` | Optional. The scraper picks a working route itself |

```json
{
  "videos": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ", "https://www.youtube.com/@TED"],
  "languages": ["en"],
  "maxVideosPerList": 20
}
```

### Output

One item per video:

```json
{
  "videoId": "dQw4w9WgXcQ",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "channel": "Rick Astley",
  "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
  "durationSeconds": 213,
  "viewCount": 1700000000,
  "publishedAt": "2009-10-24T23:57:33-07:00",
  "category": "Music",
  "language": "en",
  "isAutoGenerated": false,
  "availableLanguages": [{ "code": "en", "name": "English", "isAutoGenerated": false }],
  "segmentCount": 61,
  "segments": [{ "start": 18.64, "duration": 3.24, "text": "♪ We're no strangers to love ♪" }],
  "text": "♪ We're no strangers to love ♪ ♪ You know the rules and so do I ♪ ...",
  "scrapedAt": "2026-10-08T12:00:00+00:00"
}
```

If a transcript cannot be returned, the item contains `error` (for example `No captions available for this video.` or `Video unavailable: Private video`) and is free.

### Notes

- Age-restricted and members-only videos need a signed-in account and are not supported.
- Machine translation of captions is not offered: YouTube's translation endpoint refuses automated requests. The transcript is returned in the best matching original language.

# Actor input Schema

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

One per line: a video URL or ID (watch, youtu.be, Shorts, embed, live), a playlist URL, or a channel URL / @handle. Playlists and channels are expanded into their videos.

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

Language codes in order of preference, e.g. en, es, de. Manually created captions are preferred over auto-generated ones. If none of these languages exist, the video's default caption track is returned.

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

Add the segments array (start, duration, text) to every item. Turn off to get only the plain text.

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

One extra small request per video. Title, channel, duration and view count are always included.

## `maxVideosPerList` (type: `integer`):

How many videos to take from each playlist or channel (channels: newest first).

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

How many videos are processed in parallel.

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

Optional. By default the scraper starts without a proxy and switches to Apify Proxy automatically when YouTube starts blocking.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "languages": [
    "en"
  ],
  "includeTimestamps": true,
  "includeMetadata": true,
  "maxVideosPerList": 50,
  "maxConcurrency": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One item per video and language.

# 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=dQw4w9WgXcQ"
    ],
    "languages": [
        "en"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("flash_kpi/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=dQw4w9WgXcQ"],
    "languages": ["en"],
    "proxyConfiguration": { "useApifyProxy": False },
}

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

```

## MCP server setup

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