# YouTube Transcript Scraper: Captions, Timestamps, Translate (`tali-works/youtube-transcript-scraper`) Actor

Get YouTube video transcripts in bulk: full text, timestamped segments, any caption language or auto-translation, plus title, channel, views and length. Pay only for videos that have a transcript. $3 per 1,000 videos.

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

## Pricing

Pay per event

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 Captions, Timestamps & Translation

Download **YouTube transcripts in bulk**: the **full transcript text**, **timestamped segments** (start, duration, text) and an optional **\[m:ss] timestamped transcript**, in **any available caption language** or **auto-translated** into another one. Video metadata (title, channel, views, length, keywords, description, thumbnail) is included. Works with watch, youtu.be, Shorts, embed and live URLs or plain video IDs. **$3 per 1,000 transcripts, and you're never charged for videos without captions.**

### Why this scraper

- **Cheaper:** $3 per 1,000 videos versus $5–$10 for the most popular transcript Actors.
- **Fair billing:** private, deleted or caption-less videos are still returned with a clear `error`, but **not charged**.
- **Language control:** pick a preferred language, prefer human captions or auto-generated ones, or translate with `translateTo`.
- **AI-ready output:** clean text for LLMs, summarisation, RAG, SEO and content repurposing; segments for subtitles and search.
- **Robust:** retries, alternate YouTube clients and automatic session rotation when YouTube rate-limits.

### Input

| Field | Description |
|---|---|
| `videos` | YouTube URLs or IDs. |
| `language` | Preferred caption language (default `en`). |
| `preferManualCaptions` | Prefer human captions over auto-generated (default on). |
| `translateTo` | Auto-translate into this language code. |
| `includeSegments` | Timestamped segments array (default on). |
| `includeTimestampedText` | `[m:ss] text` lines (default off). |
| `includeMetadata` | Video metadata (default on). |
| `maxVideos` | Cost cap. |

```json
{ "videos": ["https://www.youtube.com/watch?v=dQw4w9WgXcQ", "https://youtu.be/aircAruvnKk"], "language": "en", "includeTimestampedText": true }
```

### Output

```json
{
  "videoId": "dQw4w9WgXcQ", "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
  "channelName": "Rick Astley", "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw", "viewCount": 1826381078, "lengthSeconds": 213,
  "language": "en", "isAutoGenerated": false, "isTranslated": false,
  "availableLanguages": ["de-DE", "en", "en (auto)", "es-419", "ja", "pt-BR"],
  "transcript": "[♪♪♪] ♪ We're no strangers to love ♪ ♪ You know the rules and so do I ♪ ...",
  "wordCount": 487, "segmentCount": 61,
  "segments": [{"start": 1.36, "duration": 1.68, "text": "[♪♪♪]"}, {"start": 18.64, "duration": 3.24, "text": "♪ We're no strangers to love ♪"}],
  "timestampedTranscript": "[0:01] [♪♪♪]\n[0:18] ♪ We're no strangers to love ♪\n...",
  "error": null
}
```

### Pricing

**$3.00 per 1,000 transcripts** ($0.003 each), plus $0.00005 per run start. Videos without a transcript cost nothing.

### Notes

- Only videos with captions (uploaded or auto-generated) have transcripts. Live streams in progress, private, age-restricted or deleted videos return an `error`.
- Transcripts belong to their creators; respect copyright when reusing them.

# Actor input Schema

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

YouTube video URLs (watch, youtu.be, shorts, embed, live) or 11-character video IDs.

## `language` (type: `string`):

Caption language to pick when several exist (e.g. en, es, de, pt-BR). Falls back to the best available track.

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

Prefer uploaded captions over YouTube's auto-generated ones when both exist.

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

Optional: language code to auto-translate the transcript into via YouTube (e.g. en, fr).

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

Add the segments array (start, duration, text).

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

Add a ready-to-read transcript with \[m:ss] timestamps on every line.

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

Title, channel, views, length, keywords, description, thumbnail.

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

Process at most this many videos, to control cost.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "language": "en",
  "preferManualCaptions": true,
  "includeSegments": true,
  "includeTimestampedText": false,
  "includeMetadata": true
}
```

# Actor output Schema

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

All results in the default dataset.

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

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tali-works/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/0ZT5O2aQy4DNb0E8b/builds/8W0fOUgXnaj7NIfwA/openapi.json
