# YouTube Transcript Scraper — Captions & Subtitles API (`jarvis-duo-studio/youtube-transcript-scraper`) Actor

Bulk YouTube transcripts (captions/subtitles) with optional timestamps and language selection. Pay per result.

- **URL**: https://apify.com/jarvis-duo-studio/youtube-transcript-scraper.md
- **Developed by:** [Jarvis Studio](https://apify.com/jarvis-duo-studio) (community)
- **Categories:** Videos, Social media
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $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 & Subtitles API

Extract **full YouTube transcripts** (a.k.a. captions or subtitles) from any public video in one API call. Paste video URLs or IDs, get clean text — with optional timestamps, language selection and video metadata. Built for bulk: thousands of videos per run.

### Why this YouTube transcript extractor

- **Bulk transcripts** — pass hundreds or thousands of video URLs/IDs; one dataset item per video.
- **Any caption track** — picks your preferred language (`en`, `es`, `it`, `pt-BR`…), falls back to English then to the first available track. Works with manual **and** auto-generated (ASR) subtitles.
- **Timestamps optional** — enable `includeTimestamps` to get a `segments` array with `start`/`duration` for every caption line, ready for SRT/VTT conversion.
- **Video metadata included** — title, channel, views, duration, auto-generated flag on every item.
- **No proxy needed to start** — runs on free datacenter IPs and automatically rotates to a residential proxy when YouTube rate-limits the address.
- **Pay per result** — you only pay for transcripts actually delivered. Failed videos are logged, never charged.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `videoUrls` | array | required | YouTube URLs (watch, youtu.be, shorts) or 11-char video IDs |
| `language` | string | `en` | Preferred caption language code; falls back gracefully |
| `includeTimestamps` | boolean | `false` | Add `segments` with per-line start/duration |
| `maxItems` | integer | `1000` | Hard cap on transcripts for the run |
| `proxyConfiguration` | object | off | Optional explicit proxy settings |

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=UF8uR6Z6KLc",
    "dQw4w9WgXcQ"
  ],
  "language": "en",
  "includeTimestamps": true
}
```

### Output

One dataset item per video:

```json
{
  "type": "transcript",
  "videoId": "UF8uR6Z6KLc",
  "url": "https://youtube.com/watch?v=UF8uR6Z6KLc",
  "title": "Steve Jobs' 2005 Stanford Commencement Address",
  "author": "Stanford",
  "channelId": "UC-EnprmCZ3OXyAoG7vjVNCA",
  "durationSeconds": 912,
  "views": 45000000,
  "language": "en",
  "isAutoGenerated": false,
  "text": "Thank you. I'm honored to be with you today...",
  "chars": 14230,
  "segments": [{ "start": 0.0, "duration": 4.2, "text": "Thank you." }],
  "scrapedAt": "2026-11-26T10:00:00.000Z"
}
```

Export as JSON, CSV, XLSX or stream via the Apify API — drop the dataset into your RAG pipeline, LLM context, content repurposing or research workflow.

### Typical use cases

- **LLM / RAG pipelines** — feed video knowledge into embeddings and agents.
- **Content repurposing** — turn videos into blog posts, newsletters, tweets.
- **SEO & competitor research** — analyze what channels actually say at scale.
- **Accessibility & archiving** — keep subtitle records of your own uploads.
- **Language learning datasets** — paired transcripts with timestamps.

### FAQ

**A video has no captions — what happens?**
The item is skipped and logged; you are not charged for it.

**Does it work on YouTube Shorts and music videos?**
Yes — any public video with a caption track, auto-generated included.

**Can I get other languages than the original?**
We fetch the caption tracks YouTube actually provides for the video (original + any contributed/auto-translated tracks exposed on the track list).

**Is this allowed?**
The actor reads public caption data already served to every viewer's browser. You are responsible for respecting YouTube's Terms of Service and the copyright of the underlying content.

### Reliability

The scraper talks to YouTube's own player endpoints through mobile clients — no headless browser, so it's fast and cheap. When an IP gets rate-limited, it rotates proxy addresses automatically instead of failing your run.

### Pricing

Pay-per-event: a few tenths of a cent per transcript plus a negligible run-start fee. One thousand transcripts cost about **$2** — see the Pricing tab for the exact current rates. There is no monthly minimum.

# Actor input Schema

## `videoUrls` (type: `array`):

YouTube video URLs (watch, youtu.be, shorts) or 11-character video ids. One dataset item per video.

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

Preferred caption language code (en, es, it, pt-BR...). Falls back to English, then to the first available track.

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

Add a segments array with start/duration (seconds) for every caption line.

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

Stop after this many transcripts in total.

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

Optional. Runs without a proxy by default and switches to a residential proxy on its own when YouTube refuses the IP.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.youtube.com/watch?v=UF8uR6Z6KLc"
  ],
  "language": "en",
  "includeTimestamps": false,
  "maxItems": 1000,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Dataset items collected by this run.

# 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 = {
    "videoUrls": [
        "https://www.youtube.com/watch?v=UF8uR6Z6KLc"
    ],
    "language": "en"
};

// Run the Actor and wait for it to finish
const run = await client.actor("jarvis-duo-studio/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 = {
    "videoUrls": ["https://www.youtube.com/watch?v=UF8uR6Z6KLc"],
    "language": "en",
}

# Run the Actor and wait for it to finish
run = client.actor("jarvis-duo-studio/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 '{
  "videoUrls": [
    "https://www.youtube.com/watch?v=UF8uR6Z6KLc"
  ],
  "language": "en"
}' |
apify call jarvis-duo-studio/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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