# YouTube Ultimate Scraper (`khnaami/actor-youtube-scraper`) Actor

Extract creator business emails, complete video metadata, timestamped transcripts/subtitles for LLMs, YouTube Shorts, comments, and full playlists without API quota limits.

- **URL**: https://apify.com/khnaami/actor-youtube-scraper.md
- **Developed by:** [khalid naami](https://apify.com/khnaami) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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 Ultimate Scraper (Channels, Leads, Videos, Shorts, Transcripts & Comments)

The ultimate, all-in-one YouTube data extraction engine on Apify. Scrape **Channels & Creator Leads** (business emails, phone numbers, social media links), **Video Metadata** (full descriptions, tags, likes, chapters), **YouTube Shorts**, **Timed Transcripts & Subtitles** (ready for LLM/AI workflows), **Comments & Replies**, **Playlists**, **Keyword Search**, and **Community Posts**.

***

### ⚡ Key Features

- 👤 **Creator Lead Generation**: Automatically extracts business contact **emails**, phone numbers, external websites, and verified social media handles (Instagram, Twitter/X, TikTok, LinkedIn, Discord, Telegram, Patreon, Spotify).
- 🎬 **Video & Metadata Extraction**: Complete video details including view counts, like counts, category, publish timestamps, tags/keywords, video duration, and max-resolution thumbnails.
- ⏱️ **Timestamped Chapters**: Automatically parses video chapters directly from video descriptions or player markers.
- 🎞️ **YouTube Shorts Scraper**: Scrape short-form videos with view counts, sound/audio tracks, tags, and channel information.
- 📝 **AI-Ready Transcripts & Subtitles**: Extracts full video transcripts and timestamped subtitle segments `[{ start, duration, text }]` in any language (English, Spanish, Arabic, French, German, etc.) — ideal for RAG, ChatGPT, Claude, and summarization pipelines.
- 💬 **Comments & Threaded Replies**: Extract top-level comments and replies with author profiles, like counts, and pinned badges.
- 📜 **Full Playlists**: Scrape entire playlists with ordered video lists, durations, authors, and preview thumbnails.
- 🔍 **YouTube Search**: Search videos, shorts, and channels by keyword query with deep metadata extraction.
- 📢 **Community Tab Posts**: Scrape text updates, images, and community polls.
- 🛡️ **Dual Engine & Anti-Blocking**: High-speed HTTP parser (`got-scraping`) paired with an intelligent Playwright browser fallback to breeze past cookie consent prompts.

***

### 📥 Input Configuration

| Parameter | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `mode` | String | `AUTO_DETECT` | Scraping mode: `AUTO_DETECT`, `CHANNELS`, `VIDEOS`, `SHORTS`, `TRANSCRIPTS`, `COMMENTS`, `PLAYLISTS`, `SEARCH`, `COMMUNITY`. |
| `targetUrls` | Array | `[...]` | YouTube URLs (channels, videos, shorts, playlists). |
| `searchQueries` | Array | `[]` | Keywords to search when in `SEARCH` mode. |
| `maxItems` | Integer | `30` | Maximum items to extract per channel, playlist, or search query. |
| `maxComments` | Integer | `50` | Maximum comments to extract per video. |
| `extractTranscripts` | Boolean | `true` | Automatically fetch video subtitles/transcripts during video scraping. |
| `transcriptLanguage` | String | `"en"` | Language code for subtitles (e.g., `en`, `es`, `ar`, `fr`, `de`). |
| `proxyConfiguration` | Object | `{ useApifyProxy: true }` | Apify Residential or Datacenter proxy configuration. |

***

### 📤 Output Data Format

#### 1. Channel & Creator Lead Record

```json
{
  "type": "CHANNEL",
  "id": "UCX6OQ3DkcsbYNE6H8uQQuVA",
  "channelId": "UCX6OQ3DkcsbYNE6H8uQQuVA",
  "title": "MrBeast",
  "channelHandle": "@MrBeast",
  "url": "https://www.youtube.com/@MrBeast",
  "description": "I want to make the world a better place before I die. For business inquiries: business@mrbeast.com",
  "subscribersCount": "320M subscribers",
  "subscribersCountRaw": 320000000,
  "videosCount": 820,
  "viewsCount": 61200000000,
  "avatarUrl": "https://yt3.googleusercontent.com/...",
  "bannerUrl": "https://yt3.googleusercontent.com/...",
  "country": "United States",
  "isVerified": true,
  "email": "business@mrbeast.com",
  "emails": [
    "business@mrbeast.com"
  ],
  "socialLinks": [
    { "platform": "twitter_x", "url": "https://x.com/MrBeast" },
    { "platform": "instagram", "url": "https://instagram.com/mrbeast" }
  ],
  "scrapedAt": "2026-10-09T10:30:00.000Z"
}
```

#### 2. Video Record with AI Transcript & Chapters

```json
{
  "type": "VIDEO",
  "id": "kJQP7kiw5Fk",
  "url": "https://www.youtube.com/watch?v=kJQP7kiw5Fk",
  "title": "Luis Fonsi - Despacito ft. Daddy Yankee",
  "channelTitle": "Luis Fonsi",
  "channelId": "UCxoq-PAQeAdk_zyg8YS0JqA",
  "duration": 282,
  "durationFormatted": "04:42",
  "viewsCount": 8500000000,
  "likesCount": 54000000,
  "isShort": false,
  "tags": ["Luis Fonsi", "Despacito", "Daddy Yankee", "Latin Pop"],
  "chapters": [
    { "title": "Intro", "timeDisplay": "00:00", "timeSeconds": 0 },
    { "title": "Verse 1", "timeDisplay": "00:25", "timeSeconds": 25 }
  ],
  "transcriptText": "Ay, Fonsi, DY, oh-oh, oh no, oh no...",
  "transcriptSegments": [
    { "start": 12.5, "duration": 3.2, "text": "Ay, Fonsi, DY" },
    { "start": 16.0, "duration": 4.1, "text": "Oh-oh, oh no, oh no" }
  ],
  "scrapedAt": "2026-10-09T10:30:00.000Z"
}
```

***

### 🤖 Integrations & AI Workflows

- **Large Language Models (LLMs)**: Feed transcripts directly into GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Flash for rapid summarization, translation, or Q\&A indexing.
- **Lead Generation**: Pipe creator emails and social media handles directly into HubSpot, Salesforce, Airtable, or Make.com.
- **Apify API & Webhooks**: Trigger downstream automations upon scraper completion.

***

### 📄 License

Apache-2.0

# Actor input Schema

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

Select what type of YouTube data you want to extract, or use AUTO_DETECT to decide from URLs.

## `targetUrls` (type: `array`):

List of YouTube URLs (Videos, Channels, Shorts, Playlists, etc.)

## `searchQueries` (type: `array`):

Keywords to search on YouTube when using SEARCH mode.

## `maxItems` (type: `integer`):

Maximum number of videos, search results, or playlist items to extract.

## `maxComments` (type: `integer`):

Max comments and replies to scrape when extracting comments.

## `extractTranscripts` (type: `boolean`):

If enabled, attempts to fetch video captions/transcripts during video scraping.

## `transcriptLanguage` (type: `string`):

Language code for transcripts (e.g. 'en', 'es', 'fr', 'ar', 'de'). Defaults to 'en'.

## `customCookies` (type: `string`):

Optional cookies string or JSON array for accessing age-gated videos or specific user feeds.

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

Select Apify Proxy (RESIDENTIAL or AUTO) for reliable and undetected scraping.

## Actor input object example

```json
{
  "mode": "AUTO_DETECT",
  "targetUrls": [
    "https://www.youtube.com/@MrBeast",
    "https://www.youtube.com/watch?v=kJQP7kiw5Fk"
  ],
  "searchQueries": [
    "artificial intelligence tutorial"
  ],
  "maxItems": 30,
  "maxComments": 50,
  "extractTranscripts": true,
  "transcriptLanguage": "en",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Scraped YouTube records (Channels, Videos, Shorts, Transcripts, Comments, Playlists, Search Results, Community Posts)

## `overview` (type: `string`):

High-level summary report and execution metrics stored in Key-Value store

# 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 = {
    "targetUrls": [
        "https://www.youtube.com/@MrBeast",
        "https://www.youtube.com/watch?v=kJQP7kiw5Fk"
    ],
    "searchQueries": [
        "artificial intelligence tutorial"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("khnaami/actor-youtube-scraper").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 = {
    "targetUrls": [
        "https://www.youtube.com/@MrBeast",
        "https://www.youtube.com/watch?v=kJQP7kiw5Fk",
    ],
    "searchQueries": ["artificial intelligence tutorial"],
}

# Run the Actor and wait for it to finish
run = client.actor("khnaami/actor-youtube-scraper").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 '{
  "targetUrls": [
    "https://www.youtube.com/@MrBeast",
    "https://www.youtube.com/watch?v=kJQP7kiw5Fk"
  ],
  "searchQueries": [
    "artificial intelligence tutorial"
  ]
}' |
apify call khnaami/actor-youtube-scraper --silent --output-dataset

```

## MCP server setup

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

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/HvnMoF3SpNbZYu1pD/builds/MiYJ2Js2lQfcknQnP/openapi.json
