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

Get YouTube video transcripts and captions (manual or auto-generated) with timestamps, plain text and video title/channel. Fast, reliable, pay only for transcripts delivered.

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

$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?

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 transcripts and captions** from videos, Shorts, **whole playlists, channels or search results**: creator-uploaded or auto-generated, in any language the video offers, with timestamps and as clean plain text. Built for AI/LLM pipelines, RAG, summarisation, research and content repurposing.

### Why this scraper

- **Reliable** — retries and smart rate handling so runs finish instead of failing halfway.
- **Pay only for results** — you're charged per transcript delivered. Videos without captions, private videos and invalid links are returned with an error and cost nothing.
- **LLM-ready output** — full transcript as one `text` string, plus timestamped `segments` if you need them.
- **Video metadata included** — title, channel name and channel URL in every result.
- **Bulk input** — paste a playlist or channel URL (or a search query) and get every video's transcript; duplicates are removed automatically.
- **Any language** — get each video's transcript in your preferred language when available, or its own default; the transcript's language is reported in `languageCode`.
- **Any URL format** — `watch?v=`, `youtu.be/`, Shorts, embed, live, mobile and YouTube Music links, or bare video IDs.

### Input

| Field | Description |
|---|---|
| `videos` | Video URLs/IDs, playlist URLs, or channel URLs (`@handle`, `/channel/…`; add `/shorts` or `/streams` for those tabs) |
| `searchQueries` | Get transcripts for the top results of YouTube searches |
| `maxVideosPerSource` | Max videos per playlist, channel or search (default 20) |
| `languages` | Preferred caption languages in order, e.g. `["en", "es"]`. Empty = any language |
| `anyLanguage` | If no preferred language exists, return whatever language is available (default `true`) |
| `preferManual` | Prefer human-made captions over auto-generated (default `true`) |
| `outputFormat` | `both`, `segments` or `text` |

### Output

```json
{
  "videoId": "8jPQjjsBbIc",
  "url": "https://www.youtube.com/watch?v=8jPQjjsBbIc",
  "title": "How to stay calm when you know you'll be stressed | Daniel Levitin | TED",
  "channelName": "TED",
  "channelUrl": "https://www.youtube.com/@TED",
  "language": "English",
  "languageCode": "en",
  "isGenerated": null,
  "durationSeconds": 742,
  "source": "https://www.youtube.com/playlist?list=…",
  "text": "A few years ago, I broke into my own house...",
  "segments": [{"start": 12.08, "duration": 3.52, "text": "A few years ago,"}]
}
```

Videos that fail come back with an `error` code and a plain-English `message` — `transcripts_disabled`, `video_unavailable`, `video_unplayable` (e.g. live now), `age_restricted`, or `no_transcript_in_language` (with the list of `available` languages) — and are **not charged**.

### Notes

- `languageCode` is the language of the returned transcript. `isGenerated` (auto-generated vs creator captions) is reported when known, otherwise `null`.
- Exact-language mode (fallback to any language **off**) checks the video's caption tracks precisely; it is slower and best for smaller batches.

### Pricing

Pay per event: one charge per transcript successfully returned. No charge for failures.

### Use it via API, Make, Zapier, n8n or as an MCP tool

Call it like any Apify Actor through the Apify API, integrations, or the Apify MCP server for AI agents.

### FAQ

**Can it translate transcripts?** Not currently — it returns the languages YouTube provides for each video.
**Does it work on Shorts and livestream replays?** Yes, if captions exist. Streams that are live right now have no transcript yet.
**A watch URL with `&list=` — video or playlist?** That single video. Paste the `playlist?list=` URL to get the whole playlist.
**Is it legal?** It reads publicly available captions. You are responsible for how you use the data.

# Actor input Schema

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

YouTube video URLs or IDs (watch, youtu.be, Shorts, live, embed), playlist URLs, or channel URLs (@handle, /channel/…, add /shorts or /streams for those tabs). A watch URL that also has \&list= is treated as that single video.

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

Get transcripts for the top search results of each query (up to 'Max videos per playlist/channel/search').

## `maxVideosPerSource` (type: `integer`):

Limit for each playlist, channel or search query. Single video URLs are always included.

## `outputFormat` (type: `string`):

Timestamped segments, a single plain-text string, or subtitle files (SRT / WebVTT).

## `includeDetails` (type: `boolean`):

Adds the video description, keywords/tags and chapters to each result. Views, upload date, duration and category are always included.

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

Preferred language codes, e.g. \["en"] or \["es"]. You get the video's transcript in your first preferred language when the video has it, otherwise its default language (if 'Fall back to any available language' is on). Leave empty for each video's own default.

## `anyLanguage` (type: `boolean`):

If the video has no transcript in your preferred languages, return its default transcript instead of an error. Turn off to get only your exact languages (slower, exact track check).

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

When an exact track check is needed (fallback off), prefer creator-made captions over auto-generated ones.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=8jPQjjsBbIc"
  ],
  "maxVideosPerSource": 20,
  "outputFormat": "both",
  "includeDetails": false,
  "languages": [
    "en"
  ],
  "anyLanguage": true,
  "preferManual": true
}
```

# Actor output Schema

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

One item per video: transcript text/segments/subtitles and video details, or an error message for videos that failed (not charged).

# 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=8jPQjjsBbIc"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("potato_44/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=8jPQjjsBbIc"] }

# Run the Actor and wait for it to finish
run = client.actor("potato_44/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=8jPQjjsBbIc"
  ]
}' |
apify call potato_44/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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