# YouTube Data Extractor (`utilitytools/youtube-data-extractor`) Actor

Extract YouTube video details, comments, transcripts, channel videos and search results without a YouTube Data API key.

- **URL**: https://apify.com/utilitytools/youtube-data-extractor.md
- **Developed by:** [Utility Tools](https://apify.com/utilitytools) (community)
- **Categories:** Social media, Videos
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 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.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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 Data Extractor

Extract YouTube video details, comments, transcripts, channel videos and search results — **completely without a YouTube Data API key**.

***

### ✨ Features

| Mode | What it extracts |
|---|---|
| `video_details` | Title, description, view count, like count, comment count, tags, upload date, duration |
| `comments` | Comments with author, text, publish date (newest first) |
| `transcript` | Subtitles/transcript in JSON (timestamped segments) or SRT format. Prioritizes Portuguese |
| `channel_videos` | Last 30 videos from any channel |
| `channel_latest_horizontal` | Most recent long-form (non-Short) video from a channel |
| `channel_latest_any` | Most recent video (compares long-form and Shorts, returns the newest) |
| `search` | Search YouTube by text — up to 50 results with metadata |

***

### 📥 Input

| Field | Type | Required for | Description |
|---|---|---|---|
| `mode` | string (select) | always | Operation mode (see table above) |
| `video_url` | string | `video_details`, `comments`, `transcript` | Full YouTube video URL |
| `channel_url` | string | `channel_videos`, `channel_latest_*` | Channel handle (e.g. `@ChannelName`) or full URL |
| `max_comments` | integer | `comments` | Max comments to return (default: 50, max: 500) |
| `transcript_format` | string (select) | `transcript` | `json` or `srt` (default: `json`) |
| `query` | string | `search` | Search text |
| `max_results` | integer | `search` | Max search results (default: 50, max: 50) |

#### Example inputs

**Get video details:**

```json
{
    "mode": "video_details",
    "video_url": "https://www.youtube.com/watch?v=VIDEO_ID"
}
```

**Get comments:**

```json
{
    "mode": "comments",
    "video_url": "https://www.youtube.com/watch?v=VIDEO_ID",
    "max_comments": 100
}
```

**Get transcript (SRT format):**

```json
{
    "mode": "transcript",
    "video_url": "https://www.youtube.com/watch?v=VIDEO_ID",
    "transcript_format": "srt"
}
```

**Get last 30 videos from a channel:**

```json
{
    "mode": "channel_videos",
    "channel_url": "@ChannelName"
}
```

**Search YouTube:**

```json
{
    "mode": "search",
    "query": "how to learn Python 2024",
    "max_results": 20
}
```

***

### 📤 Output

Results are saved to the **default Dataset** of the Actor run. Each item is a JSON object.

#### `video_details` output example:

```json
{
    "title": "How to Learn Python in 2024",
    "description": "Full video description...",
    "like_count": 12500,
    "comment_count": 843,
    "view_count": 250000,
    "tags": ["python", "programming", "tutorial"],
    "upload_date": "15-08-2024",
    "duration": "0:25:30"
}
```

#### `comments` output example (one item per comment):

```json
{
    "author": "@username",
    "comment": "Great video!",
    "published_at": "2 days ago",
    "date": "17-08-2024"
}
```

#### `transcript` output example (JSON format):

```json
{
    "video_id": "VIDEO_ID",
    "language": "pt",
    "entries": [
        { "text": "Welcome to this video", "start": 0.0, "duration": 3.5 },
        { "text": "Today we will learn...", "start": 3.5, "duration": 4.2 }
    ],
    "srt_content": null
}
```

#### `channel_videos` output example (one item per video):

```json
{
    "video_id": "abc123",
    "title": "Video title",
    "url": "https://www.youtube.com/watch?v=abc123",
    "view_count": 150000,
    "upload_date": "20240815"
}
```

#### `search` output example (one item per result):

```json
{
    "video_id": "abc123",
    "title": "How to Learn Python",
    "url": "https://www.youtube.com/watch?v=abc123",
    "channel": "Channel Name",
    "view_count": 95000,
    "upload_date": "10-08-2024",
    "duration": "0:18:22"
}
```

***

### ⚙️ How it works

- **No YouTube Data API key needed** — all data is extracted using a high-performance custom bypass infrastructure.
- Designed for fast and reliable data extraction from YouTube without strict API quotas or limits.

***

### ⚠️ Limitations

- **Transcripts:** Only available for videos that have subtitles enabled (auto-generated or manual). Portuguese is prioritized; falls back to any available language.
- **Like counts:** YouTube hides exact like counts for some videos; may return `null`.
- **IP Blocks:** Running from cloud IPs may occasionally trigger YouTube rate limits. For high-volume usage, consider enabling Apify residential proxies.
- **Comments:** Available only for videos with comments enabled.

***

### 📞 Support

If you encounter any issues or have feature requests, please use the **Issues** tab in the Apify Console.

# Actor input Schema

## `mode` (type: `string`):

Choose what data to extract from YouTube.

## `video_url` (type: `string`):

YouTube video URL. Required for modes: video\_details, comments, transcript.
Example: https://www.youtube.com/watch?v=VIDEO\_ID

## `channel_url` (type: `string`):

Channel handle or full URL. Required for modes: channel\_videos, channel\_latest\_horizontal, channel\_latest\_any.
Example: @ChannelName or https://www.youtube.com/@ChannelName

## `max_comments` (type: `integer`):

Maximum number of comments to return. Used for mode: comments.

## `transcript_format` (type: `string`):

Output format for the transcript. Used for mode: transcript.

## `query` (type: `string`):

Text to search on YouTube. Required for mode: search.
Example: 'best movies of 2024 explained'

## `max_results` (type: `integer`):

Number of search results to return (max 50). Used for mode: search.

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

Select proxies to be used. Apify Proxy is recommended to avoid bot detection.

## Actor input object example

```json
{
  "mode": "video_details",
  "max_comments": 50,
  "transcript_format": "json",
  "max_results": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("utilitytools/youtube-data-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 = { "proxyConfiguration": { "useApifyProxy": True } }

# Run the Actor and wait for it to finish
run = client.actor("utilitytools/youtube-data-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 '{
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call utilitytools/youtube-data-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,utilitytools/youtube-data-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/hlhIPYuBDJZe5WZgG/builds/RudueB4JXVjnlOf0A/openapi.json
