# YouTube Transcript & Subtitles Scraper (`fujiwaranosai/youtube-transcript-scraper`) Actor

Get the transcript of any YouTube video: human or auto-generated subtitles, any language, optional translation, plain text and timestamped segments. Ready for AI, summaries and research.

- **URL**: https://apify.com/fujiwaranosai/youtube-transcript-scraper.md
- **Developed by:** [Sai Data Tools](https://apify.com/fujiwaranosai) (community)
- **Categories:** Videos, AI
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.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 does YouTube Transcript Scraper do?

**YouTube Transcript Scraper** extracts the transcript (subtitles / captions) of any public YouTube video — creator-uploaded or auto-generated — in the language you want, optionally translated, as **plain text** and/or **timestamped segments**, together with the video title and channel.

Paste a list of video URLs and get clean text ready for **AI summaries, RAG, content repurposing, SEO, research and accessibility**.

### Why use it?

- 🎯 **Any public video** with captions: regular videos, Shorts, live replays, embeds, youtu.be links.
- 🌍 **Language control** — choose preferred languages in order; if none exists you still get the first available transcript.
- 🔁 **Translation** — get the transcript translated by YouTube into another language (e.g. Spanish video → English text).
- 🧑‍🎤 **Human subtitles first** — prefers creator-uploaded subtitles and falls back to auto-generated ones.
- ⏱️ **Text and timestamps** — full text for LLMs plus segments with start time and duration for clips and chapters.
- 🛡️ **Reliable** — tries a direct connection first and switches to Apify Proxy only when YouTube blocks the request.
- 📋 **Available languages** of every video are listed, so you know what else you can request.

### Use cases

- **AI & LLM pipelines**: summarize videos, build RAG knowledge bases, generate notes and quizzes.
- **Content repurposing**: turn videos into blog posts, newsletters, threads and show notes.
- **Research & monitoring**: analyze what creators, competitors or experts say across many videos.
- **SEO & accessibility**: create captions, chapters and searchable text.

### How to use it

1. Paste video URLs or 11-character IDs in **Videos** (one per line).
2. Set **Preferred languages** (e.g. `en`, `es`) and, optionally, **Translate to**.
3. Choose the **Output format**: text, timestamped segments, or both.
4. Run it — one result per video.

#### Input example

```json
{
  "videos": ["https://www.youtube.com/watch?v=aircAruvnKk", "https://youtu.be/8jPQjjsBbIc"],
  "languages": ["en"],
  "translateTo": "",
  "preferManual": true,
  "outputFormat": "both"
}
```

### Output example

```json
{
  "video_id": "aircAruvnKk",
  "url": "https://www.youtube.com/watch?v=aircAruvnKk",
  "title": "But what is a neural network? | Deep learning chapter 1",
  "channel": "3Blue1Brown",
  "channel_url": "https://www.youtube.com/@3blue1brown",
  "language": "English",
  "language_code": "en",
  "is_generated": false,
  "translated": false,
  "word_count": 3357,
  "duration_seconds": 1106,
  "transcript": "This is a 3. It's sloppily written and rendered at an extremely low resolution of 28x28 pixels…",
  "segments": [{"start": 4.22, "duration": 3.1, "text": "This is a 3."}],
  "available_languages": [{"language": "English", "language_code": "en", "is_generated": false, "translatable": true}],
  "scraped_at": "2026-11-10T04:10:00+00:00"
}
```

A `SUMMARY` record in the run's key-value store lists each video with its status (and the reason when a transcript is not available, e.g. captions disabled).

### Pricing

You pay per transcript successfully extracted. Videos without captions, private or unavailable videos are not charged.

### Is it legal?

The actor reads captions that are publicly available for public videos. Transcripts are the creators' content: make sure your use (e.g. republishing) respects copyright and YouTube's terms in your jurisdiction.

### Feedback

Need playlists or whole channels, another field or format? Open an issue on the **Issues** tab — the actor is actively maintained.

# Actor input Schema

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

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

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

Language codes in order of preference (en, es, pt, de...). If none is available, the first available transcript is returned.

## `translateTo` (type: `string`):

Language code to translate the transcript into using YouTube's own translation (e.g. 'en' or 'es'). Leave empty to keep the original.

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

Use creator-uploaded subtitles when they exist; otherwise fall back to auto-generated captions.

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

Plain text, timestamped segments, or both.

## Actor input object example

```json
{
  "videos": [
    "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
    "https://youtu.be/jNQXAC9IVRw"
  ],
  "languages": [
    "en"
  ],
  "preferManual": true,
  "outputFormat": "both"
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

# 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=dQw4w9WgXcQ",
        "https://youtu.be/jNQXAC9IVRw"
    ],
    "languages": [
        "en"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("fujiwaranosai/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=dQw4w9WgXcQ",
        "https://youtu.be/jNQXAC9IVRw",
    ],
    "languages": ["en"],
}

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

```

## MCP server setup

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