# YouTube Transcript Scraper - Captions, Subtitles & Translation (`tonyginkleheim/youtube-transcript-scraper`) Actor

Get YouTube transcripts and subtitles as plain text, timestamped text or timed segments. Pick languages, prefer manual captions, or translate into any language YouTube supports. Videos without captions are not charged.

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

## Pricing

$4.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

### What this YouTube transcript scraper does

It downloads the transcript of any YouTube video that has captions and returns it as plain text, timestamped text or timed segments. It works with regular videos, Shorts and live replays, and you can paste URLs or video IDs.

You choose which languages you want in order of preference. You can also ask YouTube to translate the transcript into another language. Videos without captions are reported and not charged.

### What you get

- `text`: the full transcript as one block of text, ready for an LLM, a summary or search
- `segments`: every caption line with its start time and duration in seconds
- `timestampedText`: optional, each line prefixed with `[hh:mm:ss]`
- `language`, `isAutoGenerated` and `isTranslated`, so you know exactly what you got
- `availableLanguages`: every caption language the video has
- Video details: title, channel, channel ID, duration and view count

### Typical uses

- Feed video content into ChatGPT, Claude or a RAG pipeline
- Summarize podcasts, lectures and interviews
- Pull quotes and timestamps for clips and show notes
- Research what competitors or creators say across many videos

### Input

- Videos: URLs (watch, youtu.be, Shorts, embed, live) or 11-character IDs
- Preferred languages: for example `en`, then `es`. If none match, the first available track is used
- Prefer human-made captions: uploaded captions win over auto-generated ones when both exist
- Translate to: optional language code such as `fr` or `ja`

### Output example

Values are illustrative.

```json
{
  "videoId": "jNQXAC9IVRw",
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "title": "Me at the zoo",
  "channel": "jawed",
  "durationSeconds": 19,
  "language": "en",
  "isAutoGenerated": false,
  "isTranslated": false,
  "availableLanguages": ["de", "en", "es"],
  "text": "All right, so here we are, in front of the elephants ...",
  "segments": [
    { "start": 1.2, "duration": 3.4, "text": "All right, so here we are, in front of the elephants" }
  ],
  "status": "ok"
}
```

`status` is `ok`, `no_captions` or `unavailable` (private, deleted or region locked). Only `ok` rows are charged.

### Pricing

| Event | Charged when |
|---|---|
| `transcript` | a transcript was returned for a video |

### FAQ

#### Does it transcribe videos that have no captions?

No. It reads the captions YouTube already has, including auto-generated ones.

#### Why use residential proxies?

YouTube limits requests from data center IPs. The default residential proxy setting keeps the failure rate low, and each retry uses a new IP.

#### How fast is it?

About 8 videos are processed in parallel by default, and you can raise that to 30.

# Actor input Schema

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

Video URLs, Shorts URLs or 11-character video IDs.

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

Language codes in order of preference, e.g. en, es, de. If none match, the first available track is used.

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

Use uploaded captions over auto-generated ones when both exist.

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

Optional language code. YouTube translates the transcript, e.g. en, fr, ja.

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

Each caption line with start time and duration in seconds.

## `includeTimestampedText` (type: `boolean`):

Plain text with \[hh:mm:ss] before each line.

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

Parallel requests.

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

Each retry uses a new IP.

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

Proxy settings.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "languages": [
    "en"
  ],
  "preferManualCaptions": true,
  "includeSegments": true,
  "includeTimestampedText": false,
  "maxConcurrency": 8,
  "maxRetries": 6,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

All results as JSON

# 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"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("tonyginkleheim/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"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

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

```

## MCP server setup

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