# YouTube Transcript Scraper - Captions, Timestamps, Any Language (`centorprat/youtube-transcript-scraper`) Actor

Get YouTube video transcripts (captions) with timestamps by video URL, for a channel's latest videos or for search results: full text, segments, language (human or auto), translation, plus title, channel, views, duration. No API key, no login.

- **URL**: https://apify.com/centorprat/youtube-transcript-scraper.md
- **Developed by:** [Centor Prat](https://apify.com/centorprat) (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

from $1.70 / 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.
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 Transcript Scraper - Captions, Timestamps, Any Language

**Get the transcript of any YouTube video** (captions: uploaded or auto-generated) as clean text, as timestamped
lines and as segments with start time and duration. Give **video URLs** (watch, youtu.be, Shorts, live), or **channels**
(transcripts of their latest videos) or **search queries** (transcripts of the top results). No API key, no login, no
browser, no YouTube account.

Each row also has the video's **title, channel, channel ID, duration, views, publish date, category, description and
keywords**, the list of **available caption languages**, and flags for auto-generated captions and translation.

- **Languages**: give your preferred languages in order (`["es", "en"]`); human captions are preferred over
  auto-generated ones; it falls back to the video's own language and tells you (`requestedLanguageMissing`).
- **Translation**: `translateTo: "es"` uses YouTube's machine translation when YouTube allows it.
- **Reliable on servers**: when YouTube asks a server IP to "sign in", the video is retried from fresh Apify Proxy IPs
  automatically.

### 📥 Input

| Field | Meaning |
|---|---|
| `videos` | video URLs or IDs |
| `channels`, `maxVideosPerChannel` | transcripts of a channel's latest videos |
| `searchQueries`, `maxVideosPerSearch` | transcripts of search results |
| `languages`, `translateTo`, `preferManual` | language choice |
| `includeTimestamps`, `includeSegments` | output shape |

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

### 📤 Output (one video, shortened)

```json
{ "videoId": "jNQXAC9IVRw", "title": "Me at the zoo", "channel": "jawed", "durationSeconds": 19, "views": 380000000,
  "publishDate": "2005-04-23", "language": "en", "isAutoGenerated": false, "wordCount": 39,
  "transcript": "All right, so here we are, in front of the elephants ...",
  "transcriptWithTimestamps": "[0:01] All right, so here we are, in front of the elephants\n[0:05] the cool thing about these guys ...",
  "segments": [{"start": 1.2, "duration": 2.16, "text": "All right, so here we are, in front of the elephants"}],
  "availableLanguages": [{"code": "en", "name": "English", "autoGenerated": false}] }
```

### 💡 Uses

- **AI and RAG**: feed video knowledge into LLMs, chatbots and search; summarize channels.
- **Content repurposing**: turn videos into blog posts, newsletters, threads and show notes.
- **Research and monitoring**: what creators and competitors say, searchable and quotable with timestamps.
- **SEO and accessibility**: text versions of your own videos.

### 💰 Pricing

Pay per transcript returned (`transcript` event). Videos without captions, private or invalid videos are free.

### 🤖 API / agents

```bash
curl -X POST "https://api.apify.com/v2/acts/centorprat~youtube-transcript-scraper/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
     -H "Content-Type: application/json" -d '{"videos": ["https://youtu.be/jNQXAC9IVRw"]}'
```

MCP: `https://mcp.apify.com/?tools=actors,docs,centorprat/youtube-transcript-scraper`

### ❓ FAQ

- **API key or login?** No.
- **Videos without captions?** You get a `no_transcript` row and are not charged.
- **Large runs?** Keep Apify Proxy on; Residential proxy is the most reliable for thousands of videos.

# Actor input Schema

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

Video URLs or IDs (watch, youtu.be, Shorts, live links all work), one per line.

## `channels` (type: `array`):

Channel URLs, @handles or channel IDs: transcripts of their latest videos.

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

Latest N videos of each channel.

## `searchQueries` (type: `array`):

YouTube searches: transcripts of the top results.

## `maxVideosPerSearch` (type: `integer`):

Top N videos of each search.

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

Language codes in order of preference, e.g. \["en"], \["es", "en"]. Falls back to the video's own language.

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

Language code for YouTube's machine translation, e.g. "es". If YouTube refuses, the original transcript is returned (translationUnavailable: true).

## `preferManual` (type: `boolean`):

Use uploaded (human) captions before auto-generated ones when both exist.

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

Also return the transcript as "\[m:ss] line" text.

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

Also return each caption segment with start time and duration (seconds).

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

YouTube asks some server IPs to sign in. When that happens the actor retries the video from fresh Apify Proxy IPs (datacenter by default; Residential is the most reliable for big runs).

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "maxVideosPerChannel": 10,
  "maxVideosPerSearch": 10,
  "languages": [
    "en"
  ],
  "preferManual": true,
  "includeTimestamps": true,
  "includeSegments": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `transcripts` (type: `string`):

One row per video: transcript text, timestamped text, segments, language, auto-generated flag, plus title, channel, duration, views, publish date, description, keywords.

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

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

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

```

## MCP server setup

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