# YouTube Transcript Scraper (`clearrun/youtube-transcript`) Actor

Transcripts for any YouTube video with timestamps, language selection, auto-generated caption fallback and video metadata (title, channel, duration, views). Paste URLs or IDs, get clean text and timed segments. Cheap and fast, no browser.

- **URL**: https://apify.com/clearrun/youtube-transcript.md
- **Developed by:** [Clearrun Data](https://apify.com/clearrun) (community)
- **Categories:** Videos, AI, Agents
- **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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## YouTube Transcript Scraper

Get the transcript of any YouTube video as clean text plus timed segments, in the language you choose, with
automatic-caption fallback and the video's metadata. No browser, so runs finish in seconds and cost a fraction of
a cent per video.

### What you get

```json
{
  "videoId": "jNQXAC9IVRw",
  "url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
  "title": "Me at the zoo",
  "channel": "jawed",
  "durationSeconds": 19,
  "viewCount": 351829000,
  "language": "en",
  "isAutoGenerated": false,
  "availableLanguages": [{ "code": "en", "name": "English", "auto": false }],
  "wordCount": 47,
  "transcript": "All right, so here we are in front of the elephants ...",
  "segments": [{ "start": 0.0, "duration": 2.4, "text": "All right, so here we are" }, ...],
  "error": null
}
```

### Input

| Field | Default | Notes |
|---|---|---|
| `videos` | — | Watch, youtu.be, Shorts or embed URLs, or bare 11-character IDs |
| `language` | `en` | ISO code; falls back to the closest available track |
| `allowAutoGenerated` | `true` | Use YouTube's automatic captions if no manual transcript exists |
| `includeSegments` | `true` | Timed segments as well as plain text |
| `proxyConfiguration` | Apify datacenter | Blocked videos are retried through residential proxies automatically |

### Pricing

Pay per transcript delivered. Videos without captions, private or removed videos are free and recorded with an
`error` explaining why, so you can filter them out.

#### Speed & cost

About 30–60 seconds for 100 results; a 100-result run costs roughly $0.40 in events plus about $0.01–0.05 of
platform usage.

### Typical uses

- Feeding video content into summarisers, RAG pipelines and AI agents
- Subtitles, quotes and research notes
- Monitoring channels for keywords

### Use from an AI agent

Available through the Apify MCP server: "Get the transcript of this YouTube video and summarise it."

### Support

Open an issue on the Issues tab with the video URL and run ID. Issues are answered within one working day.

# Actor input Schema

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

YouTube video URLs (watch, youtu.be, shorts, embed) or bare 11-character IDs, one per line.

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

ISO code such as en, es, de, fr, pt, ja. Falls back to the next available track if not found.

## `allowAutoGenerated` (type: `boolean`):

Use YouTube's automatic captions when no manual transcript exists in the preferred language.

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

Return the transcript as an array of {start, duration, text} segments as well as plain text.

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

Apify datacenter proxies work for most videos and keep costs low; videos that hit YouTube's bot check are retried through residential proxies automatically.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "language": "en",
  "allowAutoGenerated": true,
  "includeSegments": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One record per video: transcript text, timed segments and metadata

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

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,clearrun/youtube-transcript"
        }
    }
}

```

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/rSA3sWyb3nYrdRLP5/builds/QR0ExK9CEM4VC6BgF/openapi.json
