# Youtube Video Transcript Scraper (`turboscraper/youtube-transcript-scrap`) Actor

Tired of manual transcript extraction? The YouTube-Transcript-Scraper makes it effortless! 🚀 Get full transcripts and valuable data in seconds. Let’s automate your workflow — it’s time to scrape smarter! 💻🔍

- **URL**: https://apify.com/turboscraper/youtube-transcript-scrap.md
- **Developed by:** [Ihor Dudnyk](https://apify.com/turboscraper) (community)
- **Categories:** Social media, Videos
- **Features:** Full permissions
- **Stats:** 48 total users, 1 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.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.

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

Extract accurate transcripts from any YouTube video with this powerful, easy-to-use Apify Actor. Get complete video transcriptions in multiple languages and formats to enhance content analysis, research, and accessibility.

### 🚀 Features

- **Multi-language Support**: Extract transcripts in any available language
- **Format Options**: Get results in JSON or plain text format
- **Fallback Options**: Configure language fallback preferences
- **Reliable Extraction**: Built-in retry mechanism ensures successful transcript retrieval
- **Fast Processing**: Efficiently processes YouTube videos with minimal resource usage
- **Easy Integration**: Simple API for seamless integration with your workflow

### 📋 Use Cases

- **Content Research**: Analyze video content without watching hours of footage
- **SEO Optimization**: Extract keywords and topics from popular videos
- **Accessibility**: Create subtitles or closed captions for your own content
- **Data Analysis**: Perform text analysis on video transcripts
- **Content Repurposing**: Transform video content into blog posts, articles, or social media content
- **Educational Resources**: Create study materials from educational videos
- **n8n Integration**: Use in n8n workflows to automate video transcript extraction
- **Zapier Integration**: Connect with Zapier to trigger actions based on video transcripts
- **Make.com Integration**: Automate tasks with Make.com using video transcripts

### ⚙️ Input Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `startUrls` | Array | **Required**. List of YouTube video URLs to process. |
| `format` | String | Output format: "text" or "json" (default: "json") |
| `language` | String | Preferred language code for the transcript (default: "en") |
| `allowDefaultLanguage` | Boolean | If true, falls back to English when preferred language isn't available (default: true) |
| `maxRetries` | Integer | Maximum number of retry attempts for failed requests (default: 3) |
| `getFirstAvailableLanguage` | Boolean | If true, returns the first available language when preferred language isn't available (default: false) |
| `proxyConfiguration` | Object | Proxy settings to be used by the actor. **Strongly recommended** as YouTube often blocks Apify servers. |
| `proxyConfiguration.useApifyProxy` | Boolean | If true, the actor will use Apify Proxy for all connections (default: true) |
| `proxyConfiguration.apifyProxyGroups` | Array | Proxy groups to be used by the Apify Proxy (default: \[]). Residential proxies are recommended for better reliability. |
| `proxyConfiguration.apifyProxyCountry` | String | Country to be used by the Apify Proxy (default: "") |
| `proxyConfiguration.proxyUrls` | Array | Custom proxy URLs to be used instead of Apify Proxy (default: \[]) |

#### Input Example

```json
{
    "startUrls": [
        { "url": "https://www.youtube.com/watch?v=aAkMkVFwAoo" }
    ],
    "format": "json",
    "language": "en",
    "allowDefaultLanguage": true,
    "maxRetries": 3,
    "getFirstAvailableLanguage": false,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US"
    }
}
```

### 📊 Output

#### JSON Format (Default)

```json
{
    "title": "Video Title - YouTube",
    "url": "https://www.youtube.com/watch?v=aAkMkVFwAoo",
    "language": "en",
    "data": {
        "transcription": [
            {
                "start": "0.06",
                "duration": "3.78",
                "text": "Sample transcript text"
            },
            {
                "start": "3.84",
                "duration": "2.76",
                "text": "More transcript text"
            }
        ],
        "language": "en",
        "fullText": "Sample transcript text More transcript text"
    }
}
```

#### Text Format

```json
{
    "data": "Sample transcript text\nMore transcript text",
    "title": "Video Title - YouTube",
    "url": "https://www.youtube.com/watch?v=aAkMkVFwAoo"
}
```

### 🔍 How It Works

1. The Actor loads the YouTube video page using a headless browser
2. It extracts the available transcript tracks from the page
3. Based on your language preferences, it selects the appropriate transcript
4. The transcript is processed and formatted according to your specifications
5. Results are saved to the Actor's default dataset

### 🚦 Limitations

- Only works with YouTube videos that have captions/transcripts available
- Some videos with auto-generated captions may have lower accuracy
- Private or age-restricted videos may require additional authentication
- **YouTube often blocks Apify servers**, so using proxies (especially residential proxies) is strongly recommended for reliable operation

### 🔧 Getting Started

#### Using the Apify Platform

1. Go to the YouTube Transcript Scraper page on Apify
2. Enter the YouTube video URL(s) you want to process
3. Configure optional parameters as needed
4. Run the Actor and retrieve your results

#### Using the Apify API

```javascript
const { ApifyClient } = require('apify-client');

// Initialize the ApifyClient with your API token
const client = new ApifyClient({
    token: 'YOUR_API_TOKEN',
});

// Prepare Actor input
const input = {
    startUrls: [{ url: 'https://www.youtube.com/watch?v=aAkMkVFwAoo' }],
    format: 'json',
    language: 'en',
    proxyConfiguration: {
        useApifyProxy: true,
        apifyProxyGroups: ['RESIDENTIAL'],
        apifyProxyCountry: 'US'
    }
};

(async () => {
    // Run the Actor and wait for it to finish
    const run = await client.actor('your-username/youtube-transcript-scraper').call(input);

    // Fetch and print Actor results from the run's dataset
    const { items } = await client.dataset(run.defaultDatasetId).listItems();
    console.log('Results:', items);
})();
```

### 💬 Support

- For issues and feature requests, please create a new issue in the repository

# Actor input Schema

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

The URL of website you want to get transcription

## `format` (type: `string`):

The format of the output data

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

The language of the transcript

## `allowDefaultLanguage` (type: `boolean`):

If true, the actor will return the transcript in the default language if no other language is available. Default language is English.

## `maxRetries` (type: `integer`):

The maximum number of retries for failed requests. Default is 3.

## `getFirstAvailableLanguage` (type: `boolean`):

If true, the actor will return the transcript in the first available language if no other language is specified.

## `proxyConfiguration` (type: `object`):

Select proxies to be used by the actor

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.youtube.com/watch?v=aAkMkVFwAoo"
    }
  ],
  "format": "json",
  "language": "en",
  "allowDefaultLanguage": true,
  "maxRetries": 3,
  "getFirstAvailableLanguage": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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": [
        {
            "url": "https://www.youtube.com/watch?v=aAkMkVFwAoo"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("turboscraper/youtube-transcript-scrap").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": [{ "url": "https://www.youtube.com/watch?v=aAkMkVFwAoo" }],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("turboscraper/youtube-transcript-scrap").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": [
    {
      "url": "https://www.youtube.com/watch?v=aAkMkVFwAoo"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call turboscraper/youtube-transcript-scrap --silent --output-dataset

```

## MCP server setup

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

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/qNcOGxOWzg669ENJH/builds/wPf2rfqUxU87Qji2v/openapi.json
