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

🎬 Turn YouTube videos into clean transcript data in seconds.

- **URL**: https://apify.com/api-ninja/youtube-transcript-scraper.md
- **Developed by:** [API ninja](https://apify.com/api-ninja) (community)
- **Categories:** AI, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 302 total users, 54 monthly users, 100.0% runs succeeded, 11 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $2.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Video Transcript do?

**YouTube Video Transcript** turns **YouTube video URLs or video IDs into structured transcript data** in a single run. Paste one or more video links from [YouTube](https://www.youtube.com/) or raw IDs, optionally choose a transcript language, and the Actor will return transcript lines, selected language details, and available language options in a clean dataset.

This Actor is built for the **Apify platform**, so you get more than just transcript extraction. You can run it manually, automate it via API, schedule recurring jobs, monitor logs, and plug the output into other workflows and integrations. It is designed to be simple for first-time users but reliable enough for repeated production runs.

#### What can this Actor do?

- 🎬 Accept full YouTube video URLs or plain video IDs.
- 🧠 Extract transcript data in a structured JSON format.
- 🌍 Request a specific transcript language when available.
- ⚡ Process multiple videos in one run.
- 🔁 Retry temporary failures automatically.
- 📦 Save all results to an Apify dataset for export or downstream automation.

### Why use YouTube Video Transcript?

If you need transcript data quickly, this Actor removes the repetitive setup work. You do not need to normalize video links, process items one by one, or build your own retry logic before you can start collecting usable output.

Common use cases:

- Content research and topic analysis
- LLM, RAG, and summarization pipelines
- Subtitle and transcript availability checks
- Internal knowledge base enrichment
- Monitoring transcripts across many videos over time

### How to get YouTube video transcripts

1. Open the Actor in Apify Console.
2. Paste one or more YouTube video URLs or raw video IDs into the `urls` field.
3. Optionally set the `language` field with a two-letter language code like `en` or `es`.
4. Start the run.
5. Open the dataset after the run finishes to review or download the results.

The Actor is suitable for both quick one-off runs and recurring automated jobs. Because it runs on Apify, you can connect it to schedules, webhooks, integrations, and API-based workflows without changing the input format.

### Input

YouTube Video Transcript has a small input schema designed for fast first runs. Use the **Input** tab in Apify Console for full field details.

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=_ZW5o1VegRI",
    "_ZW5o1VegRI"
  ],
  "language": "en"
}
```

#### Input fields

- `urls` - Required. A list of YouTube video URLs or raw video IDs.
- `language` - Optional. A two-letter transcript language code such as `en`, `es`, `fr`, or `de`.

### Output

The Actor returns one dataset item per input value. Successful items include the transcript itself plus metadata about the selected language and other language options. If a video cannot be processed, the Actor still stores a failure record so you can easily see which inputs need attention.

You can download the dataset extracted by YouTube Video Transcript in various formats such as JSON, HTML, CSV, or Excel.

```json
[
  {
    "originalInput": "https://www.youtube.com/watch?v=_AbFXuGDRTs",
    "videoId": "_AbFXuGDRTs",
    "requestedLanguage": "en",
    "success": true,
    "transcriptCount": 42,
    "id": "_AbFXuGDRTs",
    "transcript": [
      {
        "text": "Hello and welcome",
        "start": 0.12,
        "duration": 1.84
      }
    ],
    "selected": {
      "language": "English"
    },
    "languageMenu": [
      {
        "language": "English",
        "languageCode": "en"
      }
    ]
  }
]
```

### Data table

| Field | Type | Description |
| --- | --- | --- |
| `originalInput` | string | Original input value from the run |
| `videoId` | string | Normalized YouTube video ID |
| `requestedLanguage` | string or null | Requested transcript language |
| `success` | boolean | Whether transcript retrieval succeeded |
| `transcriptCount` | number | Number of transcript lines returned |
| `error` | string or null | Error message for failed items |
| `transcript` | array | Transcript lines with timing data |
| `selected` | object or null | Selected transcript/language details |
| `languageMenu` | array | Other language options returned for the video |

### Pricing / Cost estimation

How much does it cost to extract YouTube transcripts?

This Actor uses **pay-per-event pricing**.

| Charge | Free plan | Bronze-Diamond plans |
| --- | ---: | ---: |
| Actor start | $0.01 | $0.01 |
| Result saved to the default dataset | $0.015 per result | $0.002 per result |

The Actor start event is charged according to memory, at one event per GB with at least one event per run. The final cost depends mainly on how many transcript records are saved. Apify requires a maximum-charge limit of at least **$0.10 per run**; this is a spending cap, not a minimum fee. Start with a small sample, avoid duplicate videos, and check the Actor's **Pricing** tab before a large run.

### Tips or Advanced options

- Use raw video IDs if you already have them in a spreadsheet or database.
- Batch multiple videos into one run instead of launching many tiny runs.
- Review failed items in the dataset instead of guessing which inputs need a rerun.
- Use Apify scheduling and API access if you need recurring transcript collection.

### Other YouTube Scraping Tools

If you like this Actor, you might also find these YouTube tools useful:

- 📥 **[YouTube Video Downloader](https://apify.com/api-ninja/youtube-video-downloader)**: Download video or audio and receive direct media links.
- 🔍 **[YouTube Search Scraper](https://apify.com/api-ninja/youtube-search-scraper)**: Discover videos, channels, playlists, and Shorts by keyword.
- 📺 **[YouTube Channel Scraper](https://apify.com/api-ninja/youtube-channel-scraper)**: Extract videos, Shorts, playlists, livestreams, and posts from channels.
- 💬 **[YouTube Comments Scraper](https://apify.com/api-ninja/youtube-comments-scraper)**: Extract comments and replies for audience and sentiment analysis.

### FAQ, disclaimers, and support

#### Does this Actor download the video or audio?

No. It only returns transcript-related data for the supplied YouTube videos.

#### What if a transcript is unavailable?

The Actor retries temporary failures automatically and records failed items in the dataset with `success: false` and an error message.

#### Is it legal to extract YouTube transcript data?

You are responsible for using this Actor in compliance with YouTube terms and applicable laws. If your output contains personal data, make sure you have a legitimate reason to process it and consult legal counsel if needed.

#### Where can I get help or request improvements?

Use the Issues tab on the Actor page for feedback, bug reports, and feature requests. If you need custom output fields or workflow changes, this Actor can be extended further.

# Actor input Schema

## `urls` (type: `array`):

Add one or more YouTube video URLs or raw video IDs. The Actor automatically extracts the video ID from full links.

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

Optional. Use a two-letter language code such as <code>en</code>, <code>es</code>, <code>fr</code>, or <code>de</code>. Leave empty to use the default transcript language available for the video.

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=gN07gbipMoY",
    "gN07gbipMoY"
  ]
}
```

# Actor output Schema

## `results` (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 = {
    "urls": [
        "https://www.youtube.com/watch?v=gN07gbipMoY",
        "gN07gbipMoY"
    ]
};

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

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

```

## MCP server setup

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