# YouTube Transcript Ninja ⚡️🥷⚡ (`excitable_pickle/youtube-transcript-scraper-1`) Actor

Extract transcripts from YouTube videos with ease! This actor takes a YouTube video URL as input and returns the transcript of the video in the specified format.

- **URL**: https://apify.com/excitable\_pickle/youtube-transcript-scraper-1.md
- **Developed by:** [Pavan](https://apify.com/excitable_pickle) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.10 / 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.

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 Actor

### 📌 Introduction

#### 🎯 What is this actor?

The **YouTube Transcript Actor** is a powerful tool designed to extract transcripts from YouTube videos. It takes a **YouTube video URL** as input and returns the **transcript** in a structured format.

#### 🚀 Key Features

- Extract transcripts from YouTube videos
- Support for multiple languages
- Option to **include timestamps**
- Clean text formatting
- JSON output for easy integration

#### 🔍 Use Cases

- **Content creators** can generate subtitles for their videos
- **Researchers** can perform **sentiment analysis** or **text processing** on video transcripts
- **Accessibility advocates** can **make video content more accessible**

***

### 📥 Inputs

#### 📝 What does the actor take in?

The YouTube Transcript Actor accepts the following inputs:

- **`startUrls`** (*required*): A list of YouTube video URLs to extract transcripts from.
- **`includeTimestamps`** (*optional*): A toggle to include timestamps in the output (**Yes/No**).

#### 🔒 Restrictions

- You must provide a **valid YouTube URL**.
- Some videos **do not have transcripts available** (e.g., live streams, private videos).

#### ✅ Example Input

```json
{
    "startUrls": ["https://www.youtube.com/watch?v=cPMJOaD-eZk"],
    "includeTimestamps": "Yes"
}
```

***

### 📤 Outputs

#### 📝 What does the actor return?

The actor produces:

- **A clean transcript** (default: plain text)
- **Timestamps** (*optional*)
- **JSON format** for structured data processing

#### ⚠️ Restrictions

- If a video has **no transcript available**, the result will be `null`.

#### ✅ Example Outputs

##### 🔹 **Without Timestamps (`includeTimestamps`: "No")**

```json
{
    "transcript": "We have skewed the lines. We are no longer raising women in our culture..."
}
```

##### 🔹 **With Timestamps (`includeTimestamps`: "Yes")**

```json
{
    "transcript": [
        { "timestamp": "0:01", "text": "We've skewed the lines." },
        {
            "timestamp": "0:04",
            "text": "We are no longer raising women in our culture."
        }
    ]
}
```

***

### ⚙️ How to Use

#### 🏁 Running the Actor

1. **Log in** or **Sign up** on [Apify](https://apify.com).
2. **Create a new task** and select **"YouTube Transcript Actor"**.
3. **Enter the YouTube video URL(s)** in the `startUrls` field.
4. **Choose whether to include timestamps** (`includeTimestamps`: "Yes" or "No").
5. **Start the task** and receive your transcript in JSON format.

#### 📊 Interpreting Results

- If timestamps are **enabled**, the transcript is returned as an **array of objects** (`[{ timestamp, text }]`).
- If timestamps are **disabled**, the transcript is returned as **plain text**.

***

### 🛠️ Troubleshooting

#### ❌ Common Issues & Fixes

| Issue                  | Possible Cause                        | Solution                        |
| ---------------------- | ------------------------------------- | ------------------------------- |
| `Transcript not found` | Video has **no transcript available** | Choose another video            |
| `Invalid URL error`    | URL is **incorrect or missing**       | Ensure the URL is **valid**     |
| `Empty transcript`     | YouTube **restricted the transcript** | Try **another video or region** |

***

### 🔗 Additional Resources

- [Alternative YouTube Transcript Actor](https://apify.com/vistics/youtube-transcript-scraper-2-1k-results)
- [Apify Platform](https://apify.com)
- [Check out my profile](https://apify.com/topaz_sharingan)

***

### 🙌 Acknowledgments

This actor was built with the support of the **Apify community** and the **YouTube API**. Special thanks to all contributors! 🎉

# Actor input Schema

## `timestamps` (type: `boolean`):

If true, returns transcript array with timestamps. If false, returns joined text only.

## `startUrls` (type: `array`):

List of YouTube video URLs to scrape transcripts from

## Actor input object example

```json
{
  "timestamps": false,
  "startUrls": [
    "https://www.youtube.com/watch?v=SieELGaJV8k"
  ]
}
```

# Actor output Schema

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

// Run the Actor and wait for it to finish
const run = await client.actor("excitable_pickle/youtube-transcript-scraper-1").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 = { "startUrls": ["https://www.youtube.com/watch?v=SieELGaJV8k"] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,excitable_pickle/youtube-transcript-scraper-1"
        }
    }
}
```

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/RjkNZ8kZUnfQZyhjl/builds/khRb0tH1Lp7rGkjge/openapi.json
