# YouTube Transcript Scraper - $1/1000 Transcripts (`scrapeunblocker/youtube-transcript-scraper`) Actor

Extract YouTube video transcripts as JSON: timestamped segments plus clean plaintext, with available caption languages and the video title, channel and duration. Pass video URLs or ids, pick a language, and get subtitles ready for LLM/RAG pipelines. No API key. Powered by ScrapeUnblocker.

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

## Pricing

from $1.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

Extract **YouTube video transcripts** as clean, structured JSON - timestamped segments plus joined plaintext, with the available caption languages and the video's title, channel and duration. Pass video URLs or ids; no YouTube API key.

Powered by [ScrapeUnblocker](https://scrapeunblocker.com)'s anti-bot bypass - no proxies or CAPTCHA setup.

### What you get per video

- **Segments** - each with `start`, `dur` (seconds) and `text`
- **text** - the full transcript as one joined string, ready to feed an LLM
- **availableLanguages** - every caption track (code + name + auto-generated flag)
- **language** / **isAutoGenerated** - the track that was returned
- **Video metadata** - `title`, `author`, `channelId`, `lengthSeconds`, `viewCount`

### Features

- **Batch** - pass many videos in one run; one dataset item per video.
- **Language choice** - request a specific caption language with `lang` (a prefix like `en` matches `en-US`), or take the default track.
- **Manual or auto captions** - human-written subtitles when present, auto-generated otherwise, flagged with `isAutoGenerated`.
- **Two output shapes** - timestamped `segments` for subtitles/alignment, or plain `text` for summarisation.

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `videos` | array | **required** | Watch URLs, `youtu.be` / `shorts` links, or 11-char video ids. |
| `lang` | string | - | Preferred caption language code, e.g. `en`. Blank = default track. |
| `format` | select | segments | `segments` (with timestamps) or `text` (plain). |
| `proxy_country` | string | - | Exit-IP country (ISO-2). Blank = a US exit (recommended). |

### Example output (one dataset item)

```json
{
  "videoId": "dQw4w9WgXcQ",
  "title": "Rick Astley - Never Gonna Give You Up (Official Video)",
  "author": "Rick Astley",
  "lengthSeconds": 213,
  "language": "en",
  "languageName": "English",
  "isAutoGenerated": false,
  "availableLanguages": [
    { "languageCode": "en", "name": "English", "isAutoGenerated": false },
    { "languageCode": "de-DE", "name": "German (Germany)", "isAutoGenerated": false }
  ],
  "segmentCount": 62,
  "segments": [
    { "start": 8.46, "dur": 4.2, "text": "We're no strangers to love" },
    { "start": 12.66, "dur": 3.0, "text": "You know the rules and so do I" }
  ],
  "text": "We're no strangers to love You know the rules and so do I ..."
}
```

### Use cases

- **LLM / RAG pipelines** - turn videos into text for summarisation, Q\&A and embeddings.
- **Subtitles & captions** - export timestamped segments to SRT/VTT or align to audio.
- **Content analysis** - keyword, topic and sentiment analysis over spoken content.
- **Accessibility & search** - make video libraries readable and full-text searchable.

### Pricing

$1 per 1,000 transcripts - one transcript = one processed video. Videos whose transcript could not be fetched are listed in the run's `ERRORS` record (key-value store) and are not billed.

***

Built on [ScrapeUnblocker](https://scrapeunblocker.com). Questions? [docs.scrapeunblocker.com](https://docs.scrapeunblocker.com)

# Actor input Schema

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

One or more YouTube videos to transcribe. Each entry is a watch URL, a youtu.be / shorts link, or an 11-character video id.

## `lang` (type: `string`):

Preferred caption language code, e.g. 'en'. Leave blank for the video's default/first track. A prefix like 'en' matches 'en-US'.

## `format` (type: `string`):

Return timestamped segments, or only the joined plaintext.

## `proxy_country` (type: `string`):

Exit-IP country (ISO-2) for the watch page. Leave blank for a US exit (recommended for YouTube).

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  ],
  "format": "segments"
}
```

# Actor output Schema

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

Collected transcripts

## `errors` (type: `string`):

Inputs that returned no data, with the reason (not billed)

# 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("scrapeunblocker/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("scrapeunblocker/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 scrapeunblocker/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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