# 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:** 26 total users, 0 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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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(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 '{
  "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": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devnaz/youtube-transcript-extractor"
        }
    }
}

```

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/F9GHdwdVyk8TPxZKy/builds/Xgnk6rMmJnhkTTr14/openapi.json
