# YouTube Transcript Extractor — Clean Text, Timestamps & SRT (`eliai/youtube-transcript-clean`) Actor

Extract clean, deduplicated YouTube video transcripts: readable paragraphs, per-line timestamps, and SRT. Batch URLs, auto or manual captions, original-language preference. $0.004 per transcript — videos without captions are never charged.

- **URL**: https://apify.com/eliai/youtube-transcript-clean.md
- **Developed by:** [Anthony Snider](https://apify.com/eliai) (community)
- **Categories:** Videos, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 extracted 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/platform/actors/running/actors-in-store#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 (Clean)

Extract YouTube video transcripts as **clean, readable text** — no duplicated karaoke lines, no timestamp soup. Paste one URL or a batch, get back prose paragraphs, per-line timestamps, and a ready-to-use SRT string.

### Why this one

- **Clean text out of the box.** YouTube auto-captions are a rolling karaoke buffer: in some caption formats each cue re-emits the tail of the previous one, so naive scrapers return transcripts with phrases duplicated throughout. This actor compares normalized word sequences across cues and removes those overlaps whenever they appear, so what you get reads like prose.
- **Original language preferred.** If a video was auto-dubbed, asking for "en" on many tools returns a machine translation of the original speech. This actor prefers the track in the language actually spoken (`-orig`) when one exists.
- **Honest billing.** You are charged **only for videos that actually yield a transcript**. Videos with no captions return an error record and cost nothing.
- **Fast.** No browser, no rendering — a typical video takes well under a second; a 1-hour talk takes a few seconds.

### Input

| Field | Description |
| --- | --- |
| `videoUrl` | Any YouTube URL (watch, youtu.be, shorts, embed) or a bare 11-character video ID |
| `videoUrls` | Batch of videos in one run — one video without captions never stops the rest |
| `language` | Preferred caption language code (`en`, `es`, `de`, …), default `en` |
| `format` | `paragraphs` (readable prose, default) or `raw` (one block) |
| `includeTimestamps` | Adds per-line timestamps and an SRT subtitle string (default `true`) |
| `maxVideos` | Safety cap, 1–200 — also your budget cap since billing is per transcript |

### Output (one record per video)

```json
{
  "videoId": "dQw4w9WgXcQ",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "ok": true,
  "title": "Rick Astley - Never Gonna Give You Up (Official Video)",
  "channel": "Rick Astley",
  "durationSeconds": 213,
  "language": "en",
  "isAutoGenerated": false,
  "isOriginalLanguageTrack": true,
  "cuesRaw": 61,
  "cuesAfterDedup": 59,
  "duplicationRemovedPct": 3,
  "wordCount": 478,
  "transcript": "We're no strangers to love. You know the rules and so do I...",
  "segments": [{ "start": 18.64, "timestamp": "00:18", "text": "We're no strangers to love" }],
  "srt": "1\n00:00:18,640 --> 00:00:21,880\n..."
}
```

Videos without captions come back as `{ "ok": false, "error": "No captions available for this video" }` — never charged.

### Pricing

$0.004 per transcript. For comparison, the most-used alternatives in this category charge $0.01 (pintostudio/youtube-transcript-scraper) and $0.005 (starvibe/youtube-video-transcript) per transcript (measured 2026-08-07). Videos without captions are never charged.

### Common uses

- Feed video content to an LLM (summaries, Q\&A, RAG pipelines) without paying for duplicated text
- Subtitle files (SRT) for re-uploads, translations, or accessibility
- Research and content analysis across channels
- Show notes, blog posts, and quotes from talks and podcasts

### Notes

- Works with auto-generated (ASR) and manually uploaded captions, in any language YouTube serves.
- Extraction talks to YouTube's own player API — no rendering, no third-party transcript services.
- If YouTube has no captions at all for a video (some music videos, very new uploads), there is nothing to extract; you are not charged for those.

### Use from code or AI agents

Run it from any HTTP client and get the transcripts back in the same call:

```bash
curl -X POST "https://api.apify.com/v2/acts/eliai~youtube-transcript-clean/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "format": "paragraphs"}'
```

Or with the Apify JS client:

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('eliai/youtube-transcript-clean').call({
  videoUrls: ['dQw4w9WgXcQ', 'jNQXAC9IVRw'],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

AI agents can call this actor as a tool through [Apify's MCP server](https://mcp.apify.com) — an MCP-enabled agent can discover it, read the input schema, and fetch transcripts autonomously.

### FAQ

**How do I get the transcript of a YouTube video as plain text?** Paste the video URL into `videoUrl` and run — the `transcript` field of the result is clean prose with duplicated caption fragments removed.

**Does it work on videos without manual subtitles?** Yes — auto-generated (ASR) captions are supported in any language YouTube serves. If a video has no captions at all, you get an `ok: false` record and are not charged.

**Can I download subtitles as an SRT file?** Yes. With `includeTimestamps` on (the default), every result includes a ready-to-use `srt` string — save it as `subtitles.srt`.

**Does it work with YouTube Shorts and youtu.be links?** Yes — watch, youtu.be, shorts, and embed URLs all work, as do bare 11-character video IDs.

**Why do transcripts from other tools repeat phrases twice?** YouTube auto-captions are a rolling karaoke buffer; in some formats each cue re-emits the tail of the previous one. This actor compares normalized word sequences across cues and removes those overlaps, so the text reads like prose.

**How do I transcribe a whole list of videos at once?** Put up to 200 URLs in `videoUrls` — one captionless video never stops the rest, and you pay only per transcript actually extracted.

**Can I get the transcript in a specific language?** Set `language` (e.g. `es`, `de`). If a video was auto-dubbed, the track in the language actually spoken is preferred over a machine translation of it.

# Actor input Schema

## `videoUrl` (type: `string`):

Any YouTube URL — watch, youtu.be, shorts, or embed. A bare 11-character video ID works too.

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

Extract many transcripts in one run. One video without captions never stops the rest.

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

Preferred caption language, e.g. en, es, de. The original spoken track is preferred over a machine translation of it.

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

Paragraphs is readable prose. Raw is one continuous block.

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

Adds per-line timestamps and a ready-to-use SRT subtitle string.

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

Safety cap. You are charged per transcript actually extracted, so this is also your budget cap.

## Actor input object example

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

# Actor output Schema

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

Every item this run produced, as JSON.

## `resultsCsv` (type: `string`):

The same items as a spreadsheet-ready CSV.

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

// Run the Actor and wait for it to finish
const run = await client.actor("eliai/youtube-transcript-clean").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 = {
    "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "videoUrls": [],
}

# Run the Actor and wait for it to finish
run = client.actor("eliai/youtube-transcript-clean").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 '{
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "videoUrls": []
}' |
apify call eliai/youtube-transcript-clean --silent --output-dataset

```

## MCP server setup

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

```

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/ApbiG2WHzV8H3oO6Y/builds/RR0niH4UFpTCO3kjC/openapi.json
