# YouTube Transcript Scraper: Captions, Timestamps, Channels (`ksvan/youtube-transcript-scraper`) Actor

Get the transcript of any YouTube video, Short, playlist or whole channel: full text plus timestamped segments, SRT, language choice, auto-translation and video metadata. Manual or auto-generated captions. Fast, no browser, no API key.

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

## Pricing

$2.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: Captions, Timestamps, Channels

Get the **transcript of any YouTube video** in seconds, or of a **whole playlist or channel** in one run. You get the full text, timestamped segments and optional SRT subtitles, plus video metadata. It works with manual and auto-generated captions in any language.

No YouTube API key, no browser, no login. You pay only for transcripts actually delivered; videos without captions and failed requests are never charged.

### What you can paste

- Video URLs: `youtube.com/watch?v=...`, `youtu.be/...`, `youtube.com/shorts/...`, `youtube.com/live/...`
- Plain 11-character video IDs: `dQw4w9WgXcQ`
- Playlist URLs: `youtube.com/playlist?list=...`
- Channel URLs: `youtube.com/@handle`, `youtube.com/channel/UC...` (newest videos first, optionally Shorts too)

Mix them freely in one run.

### What you get

| Field | Example |
|---|---|
| `videoId`, `url` | dQw4w9WgXcQ |
| `title`, `channelName`, `channelId`, `channelUrl` | video and channel info |
| `durationSeconds`, `viewCount`, `isLive`, `thumbnailUrl` | 213, 1700000000, false |
| `language`, `languageName`, `isAutoGenerated` | en, English, false |
| `availableLanguages` | every caption track the video has |
| `transcript` | the full text in one string |
| `wordCount` | 487 |
| `segments` | `[{ "start": 18.64, "duration": 3.24, "text": "We're no strangers to love" }, ...]` |
| `srt` | ready-to-save SRT subtitles (optional) |
| `error` | only when a video has no transcript or is unavailable (not charged) |

### Use cases

- **AI and LLM pipelines**: feed video content into summaries, RAG, chatbots and content repurposing.
- **Content creators and marketers**: turn videos into blog posts, newsletters, show notes and social posts; research what competitors say.
- **SEO and research**: analyse whole channels or playlists, find quotes and topics, build datasets.
- **Accessibility and subtitles**: download captions as SRT.

### How to use

1. Paste videos, playlists or channels into **Videos, playlists or channels**.
2. Set **Preferred languages** (for example `en`, or `es, en`). The first available language wins; if none is available, the video's default captions are used.
3. Leave **Allow auto-generated captions** on to cover videos without human-made subtitles.
4. Run. Each video becomes one dataset record.

#### Example input

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://www.youtube.com/@mkbhd"
  ],
  "languages": ["en"],
  "maxVideosPerChannel": 50,
  "outputSegments": true,
  "outputSrt": false
}
```

#### Example output

```json
{
  "videoId": "_0G4OG39XjI",
  "url": "https://www.youtube.com/watch?v=_0G4OG39XjI",
  "title": "WTF is a Googlebook?",
  "channelName": "Marques Brownlee",
  "durationSeconds": 852,
  "viewCount": 8444076,
  "language": "en",
  "languageName": "English",
  "isAutoGenerated": false,
  "wordCount": 2410,
  "transcript": "Okay, so Google is dropping a brand new category of computer, new operating system, ...",
  "segments": [
    { "start": 2.572, "duration": 0.83, "text": "Okay," },
    { "start": 3.484, "duration": 2.038, "text": "so Google is dropping a brand new category of computer," }
  ]
}
```

### Pricing

Pay per transcript delivered. Proxies and compute are included. Videos without a transcript, private or removed videos and failed requests cost nothing.

### Tips

- About half of all YouTube videos have only auto-generated captions, so keep **Allow auto-generated captions** on unless you need human-made subtitles only.
- Music videos and videos without speech often have no captions at all; they are returned with an `error` field and are not charged.
- For big channels, use **Max videos per channel / playlist** to control how far back you go.

### FAQ

**Do I need a YouTube API key?** No.

**Can it translate transcripts?** It returns the captions YouTube has for the video, in the language you pick from the available tracks. Machine translation is not included.

**Something broke?** Open an issue on the Issues tab and it will be fixed quickly.

# Actor input Schema

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

Any mix of video URLs (watch, youtu.be, Shorts, live), 11-character video IDs, playlist URLs and channel URLs (@handle, /channel/UC...).

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

Language codes in order of preference (en, es, de, pt-BR...). If none is available, the video's default caption track is used.

## `includeAutoGenerated` (type: `boolean`):

Use YouTube's automatic (speech recognition) captions when a video has no manual ones.

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

When both exist in the same language, take the human-made captions.

## `outputSegments` (type: `boolean`):

Include the segments array with start time, duration and text.

## `outputSrt` (type: `boolean`):

Also include the transcript as an SRT subtitle file string.

## `maxVideosPerChannel` (type: `integer`):

Newest videos first for channels.

## `includeShorts` (type: `boolean`):

For channel URLs, also take videos from the Shorts tab.

## `maxItems` (type: `integer`):

Stop after this many videos in total. 0 = no limit.

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

How many videos are processed at the same time.

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

Apify datacenter proxy works well.

## `maxRetries` (type: `integer`):

Retries with a fresh proxy IP before a video is reported as failed (failures are not charged).

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "languages": [
    "en"
  ],
  "includeAutoGenerated": true,
  "preferManualCaptions": true,
  "outputSegments": true,
  "outputSrt": false,
  "maxVideosPerChannel": 50,
  "includeShorts": false,
  "maxItems": 0,
  "maxConcurrency": 15,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "maxRetries": 6
}
```

# Actor output Schema

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

One record per video.

# 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": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ksvan/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": True },
}

# Run the Actor and wait for it to finish
run = client.actor("ksvan/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": true
  }
}' |
apify call ksvan/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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