# Youtube Transcript Extractor ( with Metadata ) (`devnaz/youtube-transcript-extractor`) Actor

Extract YouTube video transcripts with complete metadata including title, description, views, likes, channel information, tags, and more.

- **URL**: https://apify.com/devnaz/youtube-transcript-extractor.md
- **Developed by:** [DevnaZ](https://apify.com/devnaz) (community)
- **Categories:** Developer tools, Videos, Automation
- **Stats:** 27 total users, 2 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: No ratings yet

## 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## YouTube Transcript Extractor

Extract YouTube video transcripts with complete metadata including title, description, views, likes, channel information, tags, and more.

### Features

- **Complete video metadata** - Title, description, views, likes, thumbnails, channel info
- **Full transcript extraction** - Text with precise timestamps
- **Channel information** - Name, ID, subscribers, verification status
- **Multi-language support** - Extract transcripts in any language available on YouTube
- **Multiple output formats** - JSON with timestamps, SRT, WebVTT
- **Fast extraction** - HTTP-only approach, no browser overhead

### Input

#### Required Fields

| Field | Type | Description |
|-------|------|-------------|
| `video_urls` | Array | List of YouTube video URLs or video IDs |

#### Optional Fields

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `language` | String | `auto` | Transcript language (auto, en, fr, es, de, it, pt, ru, ja, ko, zh, ar, hi) |
| `output_format` | String | `json` | Output format: `json`, `srt`, `webvtt` |
| `include_metadata` | Boolean | `true` | Include video metadata (title, views, channel, etc.). Set to `false` for transcript only |

#### 🔐 **`proxyConfig`** (Required)

Proxy configuration to avoid YouTube bot detection.

**Default**: Apify Datacenter proxy - **Free** (upgrade to Residential if blocked)

**Available types**:
- `"apify-datacenter"` - Apify datacenter proxy (free, included in your plan) - **Default**
- `"apify-residential"` - Apify residential proxy (paid, most reliable if datacenter is blocked)
- `"none"` - No proxy (direct connection, usually blocked by YouTube)
- `"custom"` - Your own custom proxies

##### Option 1: Apify Datacenter proxy (default - free)

```json
{
  "proxyConfig": {
    "type": "apify-datacenter"
  }
}
````

##### Option 2: Apify Residential proxy (if datacenter is blocked)

```json
{
  "proxyConfig": {
    "type": "apify-residential"
  }
}
```

##### Option 3: No proxy (not recommended - YouTube blocks most requests)

```json
{
  "proxyConfig": {
    "type": "none"
  }
}
```

##### Option 4: Custom proxy

```json
{
  "proxyConfig": {
    "type": "custom",
    "proxyUrls": ["http://proxy.example.com:8080"]
  }
}
```

#### Example Input

```json
{
  "video_urls": [
    "https://www.youtube.com/watch?v=xObhZ0Ga7EQ"
  ],
  "language": "auto",
  "output_format": "json",
  "include_metadata": true,
  "proxyConfig": {
    "type": "apify-datacenter"
  }
}
```

### Output

#### With Metadata (include\_metadata: true)

```json
{
  "video_id": "bBC-nXj3Ng4",
  "url": "https://www.youtube.com/watch?v=bBC-nXj3Ng4",
  "url_short": "https://youtu.be/bBC-nXj3Ng4",
  "embed_url": "https://www.youtube.com/embed/bBC-nXj3Ng4",
  "title": "But how does bitcoin actually work?",
  "description": "The math behind cryptocurrencies...",
  "thumbnail_url": "https://i.ytimg.com/vi/bBC-nXj3Ng4/maxresdefault.webp",
  "upload_date": "2017-07-07",
  "duration": "25:15",
  "duration_seconds": 1515,
  "view_count": 17474405,
  "view_count_text": "17.5M",
  "like_count": 395820,
  "like_count_text": "396K",
  "comment_count": 24000,
  "channel_name": "3Blue1Brown",
  "channel_id": "UCYO_jab_esuFRV4b17AJtAw",
  "channel_url": "https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw",
  "channel_follower_count": 7840000,
  "channel_follower_count_text": "7.84M",
  "channel_is_verified": true,
  "transcript_text": "What does it mean to have a Bitcoin? Many people have heard...",
  "transcript_language": "auto",
  "transcript_segments": [
    {
      "timestamp": "0:03",
      "text": "What does it mean to have a Bitcoin?",
      "start_seconds": 3.9,
      "duration_seconds": 2.58
    },
    {
      "timestamp": "0:07",
      "text": "Many people have heard of Bitcoin...",
      "start_seconds": 7.42,
      "duration_seconds": 3.838
    }
  ],
  "word_count": 4422,
  "segment_count": 384,
  "tags": ["bitcoin", "cryptocurrency", "blockchain", "math"],
  "categories": ["Education"],
  "age_limit": 0,
  "is_live": false,
  "was_live": false,
  "has_transcript": true
}
```

#### Without Metadata (include\_metadata: false)

```json
{
  "video_id": "bBC-nXj3Ng4",
  "url": "https://www.youtube.com/watch?v=bBC-nXj3Ng4",
  "transcript_text": "What does it mean to have a Bitcoin? Many people have heard...",
  "transcript_language": "auto",
  "transcript_segments": [
    {
      "timestamp": "0:03",
      "text": "What does it mean to have a Bitcoin?",
      "start_seconds": 3.9,
      "duration_seconds": 2.58
    },
    {
      "timestamp": "0:07",
      "text": "Many people have heard of Bitcoin...",
      "start_seconds": 7.42,
      "duration_seconds": 3.838
    }
  ]
}
```

#### SRT Format (output\_format: "srt")

```srt
1
00:00:03,900 --> 00:00:06,480
What does it mean to have a Bitcoin?

2
00:00:07,420 --> 00:00:11,258
Many people have heard of Bitcoin, that it's a fully digital currency
```

#### WebVTT Format (output\_format: "webvtt")

```webvtt
WEBVTT

00:00:03.900 --> 00:00:06.480
What does it mean to have a Bitcoin?

00:00:07.420 --> 00:00:11.258
Many people have heard of Bitcoin, that it's a fully digital currency
```

### Use Cases

- Content analysis and research
- Subtitle generation for videos
- Accessibility improvements
- SEO and keyword extraction
- Video content indexing
- Educational content processing
- Data mining and analytics

### Supported Languages

The actor automatically detects and extracts transcripts in any language available on YouTube:

- English (en), Français (fr), Español (es), Deutsch (de), Italiano (it)
- Português (pt), Русский (ru), 日本語 (ja), 한국어 (ko), 中文 (zh)
- العربية (ar), हिन्दी (hi), and many more...

### Limitations

- Only publicly available transcripts can be extracted
- Private or age-restricted videos may not be accessible
- Transcripts must be enabled by the video owner
- Some videos may not have transcripts available

# Actor input Schema

## `video_urls` (type: `array`):

List of YouTube video URLs or video IDs to extract transcripts from

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

Transcript language code (auto, en, fr, es, de, it, pt, etc.)

## `translate_to` (type: `string`):

Translate transcript to target language (leave empty for no translation)

## `output_format` (type: `string`):

Choose how to format the transcript output

## `include_metadata` (type: `boolean`):

Include language, word count, and segment count in output

## `proxyConfig` (type: `object`):

Proxy required to avoid YouTube bot detection (recommended: apify-datacenter for free, apify-residential if blocked)

## Actor input object example

```json
{
  "video_urls": [
    "https://www.youtube.com/watch?v=xObhZ0Ga7EQ"
  ],
  "language": "auto",
  "output_format": "json",
  "include_metadata": true,
  "proxyConfig": {
    "type": "apify-datacenter"
  }
}
```

# 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 = {
    "video_urls": [
        "https://www.youtube.com/watch?v=xObhZ0Ga7EQ"
    ],
    "proxyConfig": {
        "type": "apify-datacenter"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("devnaz/youtube-transcript-extractor").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 = {
    "video_urls": ["https://www.youtube.com/watch?v=xObhZ0Ga7EQ"],
    "proxyConfig": { "type": "apify-datacenter" },
}

# Run the Actor and wait for it to finish
run = client.actor("devnaz/youtube-transcript-extractor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "video_urls": [
    "https://www.youtube.com/watch?v=xObhZ0Ga7EQ"
  ],
  "proxyConfig": {
    "type": "apify-datacenter"
  }
}' |
apify call devnaz/youtube-transcript-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=devnaz/youtube-transcript-extractor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Youtube Transcript Extractor ( with Metadata )",
        "description": "Extract YouTube video transcripts with complete metadata including title, description, views, likes, channel information, tags, and more.",
        "version": "1.0",
        "x-build-id": "Xgnk6rMmJnhkTTr14"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/devnaz~youtube-transcript-extractor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-devnaz-youtube-transcript-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/devnaz~youtube-transcript-extractor/runs": {
            "post": {
                "operationId": "runs-sync-devnaz-youtube-transcript-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/devnaz~youtube-transcript-extractor/run-sync": {
            "post": {
                "operationId": "run-sync-devnaz-youtube-transcript-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "video_urls"
                ],
                "properties": {
                    "video_urls": {
                        "title": "Video URLs or IDs",
                        "type": "array",
                        "description": "List of YouTube video URLs or video IDs to extract transcripts from",
                        "items": {
                            "type": "string"
                        }
                    },
                    "language": {
                        "title": "Language",
                        "enum": [
                            "auto",
                            "en",
                            "fr",
                            "es",
                            "de",
                            "it",
                            "pt",
                            "ru",
                            "ja",
                            "ko",
                            "zh",
                            "ar",
                            "hi"
                        ],
                        "type": "string",
                        "description": "Transcript language code (auto, en, fr, es, de, it, pt, etc.)",
                        "default": "auto"
                    },
                    "translate_to": {
                        "title": "Translate to language (optional)",
                        "enum": [
                            "",
                            "en",
                            "fr",
                            "es",
                            "de",
                            "it",
                            "pt",
                            "ru",
                            "ja",
                            "ko",
                            "zh",
                            "ar",
                            "hi"
                        ],
                        "type": "string",
                        "description": "Translate transcript to target language (leave empty for no translation)"
                    },
                    "output_format": {
                        "title": "Output Format",
                        "enum": [
                            "json",
                            "srt",
                            "webvtt",
                            "txt"
                        ],
                        "type": "string",
                        "description": "Choose how to format the transcript output",
                        "default": "json"
                    },
                    "include_metadata": {
                        "title": "Include Metadata",
                        "type": "boolean",
                        "description": "Include language, word count, and segment count in output",
                        "default": true
                    },
                    "proxyConfig": {
                        "title": "🔐 Proxy Configuration",
                        "type": "object",
                        "description": "Proxy required to avoid YouTube bot detection (recommended: apify-datacenter for free, apify-residential if blocked)",
                        "default": {
                            "type": "apify-datacenter"
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
