# YouTube Transcript Scraper - Captions & Subtitles to Text (`renzomacar/youtube-transcript-scraper`) Actor

Paste YouTube video or Shorts links and get the full transcript as clean text plus timed segments, in the language you choose (creator captions or auto-generated). Title, channel, views and length included. No API key, no login.

- **URL**: https://apify.com/renzomacar/youtube-transcript-scraper.md
- **Developed by:** [Renzo Madueno](https://apify.com/renzomacar) (community)
- **Categories:** Social media, AI
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$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

Paste YouTube links, get each video's **full transcript as clean text** plus **timed segments** (start and length of every line), in the language you choose. It works with regular videos, Shorts and youtu.be links, reads both captions written by the creator and the subtitles YouTube generates automatically, and adds the video's title, channel, views and length to every row.

No YouTube API key, no quota, no login.

### What you get

| Field | Example |
|---|---|
| `title` | But what is a neural network? |
| `channelName` | 3Blue1Brown |
| `language` / `languageName` | `en` / English |
| `isAutoGenerated` | `false` (written by the creator) |
| `transcript` | This is a 3. It's sloppily written and rendered at an extremely low resolution… |
| `wordCount` | 3357 |
| `segments` | `[{ "start": 4.2, "duration": 3.1, "text": "This is a 3." }, …]` |
| `availableLanguages` | `["ar", "en", "es", "ja", …]` |
| `durationSeconds`, `views`, `channelId`, `description`, `keywords`, `thumbnailUrl` | video details |

The `transcript` text joins the lines into readable sentences and starts a new paragraph where the speaker pauses, so it can go straight into a summary, a blog post, an LLM prompt or a search index. The `segments` keep the timing for subtitles, chapters or quotes with timestamps.

### How to use it

1. Paste one link per line in **Video links**. Accepted: `youtube.com/watch?v=…`, `youtube.com/shorts/…`, `youtu.be/…`, `/embed/…`, `/live/…` or the bare 11-character ID.
2. Optional: write a **Language** code (`en`, `es`, `de`, `pt`, `fr`, `ja`…). `pt` also finds `pt-BR`, `en` also finds `en-GB`. Leave it empty to get the language spoken in the video.
3. Choose what happens when a video has no transcript in that language: return its own language, or skip it.
4. Run. Each video is one row in the dataset; download it as JSON, CSV, Excel or read it through the API.

#### Input example

```json
{
    "videos": [
        "https://www.youtube.com/watch?v=aircAruvnKk",
        "https://youtu.be/UF8uR6Z6KLc"
    ],
    "language": "en",
    "ifLanguageMissing": "original",
    "preferManual": true,
    "includeSegments": true
}
```

### Pricing

You pay **per transcript returned**. Videos that have no transcript, are private or removed still get a row with the reason in the `error` column, and **those rows are free**. You can set a maximum cost per run in the run options; the run stops when it is reached.

### Good to know

- Only videos that have captions or automatic subtitles on YouTube have a transcript. Music videos without lyrics, very new uploads and some live streams may not have one yet.
- Automatic subtitles come without punctuation in some languages; that is how YouTube generates them.
- Private, members-only and age-restricted videos cannot be read without signing in, so they are returned with an error and not charged.
- Translation into a language the video does not have is not offered: you get the transcripts that exist on YouTube.

### Use it from code

```bash
curl -X POST "https://api.apify.com/v2/acts/renzomacar~youtube-transcript-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"videos":["https://www.youtube.com/watch?v=aircAruvnKk"]}'
```

The same works from Python or JavaScript with the Apify client, from Make, Zapier, n8n, or as a tool for AI agents through the Apify MCP server.

### Questions or a missing feature?

Open an issue on the actor's **Issues** tab; it is read and answered.

# Actor input Schema

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

One per line: a YouTube video link, a Shorts link, a youtu.be link or just the 11-character video ID.

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

Two-letter code of the transcript language you want, for example en, es, de, pt, fr, ja. Leave empty to get the language spoken in the video.

## `ifLanguageMissing` (type: `string`):

Return the transcript in the language spoken in the video, or skip that video (you are not charged for skipped videos).

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

When a video has both captions written by its creator and subtitles generated automatically by YouTube, take the creator's ones. Turn off to always prefer the automatic ones.

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

Add every line of the transcript with its start time and length in seconds, besides the full text.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=aircAruvnKk",
    "https://youtu.be/UF8uR6Z6KLc"
  ],
  "language": "",
  "ifLanguageMissing": "original",
  "preferManual": true,
  "includeSegments": true
}
```

# Actor output Schema

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

One row per video with its full transcript, language and video details.

# 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=aircAruvnKk",
        "https://youtu.be/UF8uR6Z6KLc"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("renzomacar/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=aircAruvnKk",
        "https://youtu.be/UF8uR6Z6KLc",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("renzomacar/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=aircAruvnKk",
    "https://youtu.be/UF8uR6Z6KLc"
  ]
}' |
apify call renzomacar/youtube-transcript-scraper --silent --output-dataset

```

## MCP server setup

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