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

Get the transcripts (captions) of YouTube videos, Shorts, whole channels and playlists, as plain text and timed segments, in any language a video has. $1 per 1,000 transcripts; videos without captions are free. Export to JSON, CSV or Excel.

- **URL**: https://apify.com/ttechx/youtube-transcript-scraper.md
- **Developed by:** [TTech](https://apify.com/ttechx) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 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

### What is YouTube Transcript Scraper?

YouTube Transcript Scraper gets the **transcripts (captions) of YouTube videos**: as one plain
text, ready for AI tools, summaries and search, and as **timed segments** with start and end
times in seconds. It reads single videos and Shorts, the newest videos of **whole channels**, and
**playlists**, in any language a video has captions in.

Paste links, click **Start**, and download one row per video as JSON, CSV or Excel. No YouTube API
key, no login, no proxies to set up.

To try it, open the Actor, keep the example video and click **Start**. The example is free.

### What can you use it for?

- **AI and LLM apps:** feed transcripts to ChatGPT, Claude or your own RAG pipeline; summarize
  videos and podcasts.
- **Content research and SEO:** see what a channel or a niche talks about, find quotes,
  repurpose videos into articles and posts.
- **Training and analysis data:** collect spoken text of a channel's or playlist's videos at scale.
- **Subtitles and accessibility:** get the timed captions of a video.

### What data do you get?

| Field | What it is |
|---|---|
| `text` | The whole transcript as one text |
| `segments` | The timed captions: `{"start": 12.645, "end": 14.015, "text": "..."}`, times in seconds |
| `language`, `languageName` | The captions' language (`en`, "English") |
| `isAutoGenerated` | `true` for YouTube's automatic captions, `false` for captions people wrote |
| `availableLanguages` | Every caption language the video has |
| `videoId`, `url`, `title` | The video |
| `channelId`, `channelTitle` | Its channel |
| `lengthSeconds` | The video's length (empty for some Shorts) |
| `source` | The link the row came from |

Every row has every column (empty when there is nothing), so CSV and Excel exports line up.

### How to scrape YouTube transcripts

1. Open the Actor.
2. Add **YouTube links**, one per line:
   - videos: `https://www.youtube.com/watch?v=…`, `https://youtu.be/…` or the 11-character id
   - Shorts: `https://www.youtube.com/shorts/…`
   - channels: `https://www.youtube.com/@name` or an `@handle` (its newest videos);
     `https://www.youtube.com/@name/shorts` for its Shorts, `/streams` for its live streams
   - playlists: `https://www.youtube.com/playlist?list=…`
3. Set **Videos per channel or playlist** (default 50).
4. Optional: a **Language** such as `es`, `de` or `pt-BR`. Left empty, each video's own default
   captions are used: those people wrote if there are any, else YouTube's automatic ones.
5. Click **Start**, then download the results from the Output tab, or send them to Google Sheets,
   Make, Zapier or n8n.

#### Input examples

A few videos:

```json
{
    "links": ["https://www.youtube.com/watch?v=arj7oStGLkU", "https://youtu.be/3Ae4qCvQIcM"]
}
```

The 200 newest videos of a channel, in Spanish where they have Spanish captions:

```json
{
    "links": ["https://www.youtube.com/@TED"],
    "maxVideos": 200,
    "language": "es"
}
```

#### Output example

```json
{
    "videoId": "arj7oStGLkU",
    "url": "https://www.youtube.com/watch?v=arj7oStGLkU",
    "title": "Inside the Mind of a Master Procrastinator | Tim Urban | TED",
    "channelId": "UCAuUUnT6oDeKwE6v1NGQxug",
    "channelTitle": "TED",
    "lengthSeconds": 844,
    "language": "en",
    "languageName": "English",
    "isAutoGenerated": false,
    "availableLanguages": ["ar", "hy", "bg", "...", "en", "es", "..."],
    "text": "So in college, I was a government major, which means ...",
    "segments": [
        {"start": 12.645, "end": 14.015, "text": "So in college,"},
        "..."
    ],
    "source": "https://www.youtube.com/watch?v=arj7oStGLkU"
}
```

### How much does it cost?

**$1 per 1,000 transcripts** ($0.001 each, $10 per 10,000), plus Apify's tiny start fee per run.
You pay only for transcripts you get: videos without captions, private or deleted videos and
links that cannot be read are **free**, and so is the example video. Each video is charged once
per run, even when it comes from two links. Set a maximum charge per run in the run options;
the run stops when it is reached.

### FAQ

**Why is a video missing from my results?** It has no captions (common for music and very new
videos), or no captions in the language you asked for, or it is private or deleted, or YouTube refused it.
Each one is listed with its reason in the `ERRORS` record of the run's key-value store (the
"Not read" link on the Output tab), free of charge.

**Can it translate captions?** No: you get the languages a video really has (`availableLanguages`).
YouTube's machine translations are not offered.

**What about videos without any captions?** They are skipped, free. Speech-to-text for such videos
is planned.

**How fast is it?** About 2 seconds per video, several videos at a time.

**Is it legal?** It reads only public captions that YouTube shows to every visitor. You are
responsible for how you use the data; respect copyright and the creators' rights.

**Need help or a new feature?** Open an issue on the Actor's Issues tab.

# Actor input Schema

## `links` (type: `array`):

Videos, Shorts, channels or playlists, one per line: video links or ids, youtube.com/shorts/… links, channel links or @handles (a channel's /shorts or /streams link reads its Shorts or live streams), playlist links.

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

How many videos to read from each channel (newest first) or playlist. Video links are always read.

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

A language code such as en, es, de or pt-BR. Empty: each video's own default captions (the ones people wrote if there are any, else YouTube's automatic ones). A video without captions in this language is skipped, free.

## Actor input object example

```json
{
  "links": [
    "https://www.youtube.com/watch?v=arj7oStGLkU"
  ],
  "maxVideos": 50
}
```

# Actor output Schema

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

One row per video: its transcript as text and as timed segments, with title, channel and language.

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

Videos without captions and links that could not be read, with the reason (free of charge).

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

// Run the Actor and wait for it to finish
const run = await client.actor("ttechx/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 = { "links": ["https://www.youtube.com/watch?v=arj7oStGLkU"] }

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

```

## MCP server setup

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