# YouTube Channel Scraper - Stats, Videos & Analytics (`fascinating_lentil/youtube-channel-scraper`) Actor

Scrape YouTube channels and their latest videos: subscribers, total views, video counts, descriptions, social links, plus per-video views, likes, comments, duration, and tags.

- **URL**: https://apify.com/fascinating\_lentil/youtube-channel-scraper.md
- **Developed by:** [Md Jakaria Mirza](https://apify.com/fascinating_lentil) (community)
- **Categories:** Social media, Lead generation, Other
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 channel scrapeds

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 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 Channel Scraper — Extract Analytics & Video Data

Get clean YouTube channel and video analytics in minutes — subscribers, total views, video counts, plus per-video views, likes, comments, duration, and tags. This YouTube channel scraper takes channel URLs, @handles (e.g. `@mkbhd`), or search keywords and needs no login and no API key. Export to JSON, CSV, Excel, or HTML, or pull via the Apify API.

A production-ready Apify Actor that scrapes YouTube for comprehensive channel and video analytics data.

### What it does

This Actor extracts detailed data from YouTube channels and their latest videos. Provide channel URLs, handles (e.g., `@mkbhd`), or search keywords — the Actor will scrape channel metadata and video analytics for each result.

#### Channel Data Extracted
- Channel name, handle, and URL
- Subscriber count, total views, total video count
- Join date and country
- Channel description and avatar/banner images
- Verified badge status
- Social links
- Channel category/topic

#### Video Data Extracted (per latest N videos)
- Video title and URL
- View count, like count, comment count
- Duration (seconds + formatted)
- Published date and thumbnail URL
- Video description (first 500 chars)
- Tags list and category
- YouTube Shorts detection

### Use Cases

1. **Influencer Research** — Analyze potential influencer partners by examining their subscriber growth, engagement rates, and content consistency across recent videos.

2. **Competitor Analysis** — Track competitor channels to understand their upload frequency, video performance, and content strategy over time.

3. **Content Strategy** — Study successful channels in your niche to identify trending topics, optimal video lengths, and high-performing content formats.

4. **Agency Reporting** — Automate the collection of client channel metrics for regular performance reports without manual data entry.

5. **Brand Partnership Research** — Evaluate potential brand partners by analyzing their audience size, engagement metrics, and content quality before outreach.

### Sample Output

#### Channel Record

```json
{
  "channelUrl": "https://www.youtube.com/@mkbhd",
  "channelName": "Marques Brownlee",
  "handle": "@mkbhd",
  "subscriberCount": "19.3M subscribers",
  "subscriberCountNumber": 19300000,
  "totalViews": "4,613,201,035 views",
  "totalViewsNumber": 4613201035,
  "totalVideoCount": "1,823 videos",
  "totalVideoCountNumber": 1823,
  "joinDate": "Mar 22, 2008",
  "country": "United States",
  "channelDescription": "MKBHD uploads quality videos about technology...",
  "avatarImageUrl": "https://yt3.googleusercontent.com/...",
  "bannerImageUrl": "https://yt3.googleusercontent.com/...",
  "channelCategory": "Science & Technology",
  "isVerified": true,
  "socialLinks": ["https://twitter.com/MKBHD"],
  "scrapedAt": "2026-06-08T12:00:00.000Z"
}
````

#### Video Record

```json
{
  "channelUrl": "https://www.youtube.com/@mkbhd",
  "channelName": "Marques Brownlee",
  "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "videoTitle": "Galaxy S25 Ultra Review: The Best Samsung Phone?",
  "viewCount": "5,234,567 views",
  "viewCountNumber": 5234567,
  "likeCount": "182K likes",
  "likeCountNumber": 182000,
  "commentCount": "12,345 comments",
  "commentCountNumber": 12345,
  "durationSeconds": 1245,
  "durationFormatted": "20:45",
  "publishedDate": "Jan 22, 2026",
  "thumbnailUrl": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
  "videoDescription": "The Samsung Galaxy S25 Ultra is here with a new chip...",
  "tags": ["samsung", "galaxy s25", "review", "android"],
  "category": "Science & Technology",
  "isShorts": false,
  "scrapedAt": "2026-06-08T12:00:00.000Z"
}
```

### Pricing

| Event | Price | Description |
|-------|-------|-------------|
| Channel Scraped | $0.005 | Per channel — includes full channel metadata + N latest videos |

**Example cost:** 10 channels × 20 videos each = $0.05 total

The per-channel pricing keeps costs simple and predictable. You pay once per channel regardless of how many videos are scraped.

### Configuration

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `channelUrls` | `string[]` | `[]` | YouTube channel URLs or @handles to scrape |
| `searchKeywords` | `string[]` | `[]` | Keywords to search for channels |
| `maxChannels` | `number` | `10` | Max channels per search keyword |
| `maxVideosPerChannel` | `number` | `20` | Videos to scrape per channel (max 100) |
| `includeShorts` | `boolean` | `false` | Include YouTube Shorts in results |
| `proxyConfiguration` | `object` | `{ useApifyProxy: true }` | Proxy settings |

### How to Scrape YouTube Channels (Step by Step)

1. Click **Try for free** / **Run**.
2. Add YouTube channel URLs or @handles (e.g. `@mkbhd`), or enter search keywords to find channels automatically.
3. Set **Max Videos Per Channel** and **Max Channels from Search** — start small to test.
4. Toggle **Include Shorts** if you want Shorts in the results, then click **Run**.
5. When the run finishes, export your data as JSON, CSV, Excel, or HTML, or pull it via the Apify API.

### Known Limitations

- **Subscriber count hidden:** Some smaller or private channels hide subscriber counts. The Actor returns `null` for these fields.
- **YouTube rate limiting:** Very large runs (100+ channels) may experience temporary blocks. The Actor uses session pools and random delays to mitigate this.
- **Like counts:** YouTube sometimes displays abbreviated like counts (e.g., "123K"). The Actor stores both the raw text and parsed numeric value.
- **Shorts duration:** YouTube Shorts may not always report accurate duration data due to platform limitations.
- **Search mode:** Channel search results may vary by region and are subject to YouTube's search algorithm ranking.

### Resources

- [Apify Platform](https://apify.com)
- [Crawlee Documentation](https://crawlee.dev)
- [Playwright API](https://playwright.dev)

### Responsible Use

This Actor is intended for lawful collection of publicly available information only. Users are responsible for ensuring their use complies with the source website's terms, robots.txt, applicable privacy laws, including India's DPDP Act, and all local regulations.

Do not use this Actor to collect, store, sell, or misuse personal data without a lawful basis. The Actor author is not responsible for misuse by end users.

# Actor input Schema

## `channelUrls` (type: `array`):

List of YouTube channel URLs or handles to scrape (e.g. https://www.youtube.com/@mkbhd or @mkbhd)

## `searchKeywords` (type: `array`):

Keywords to search YouTube for channels. Results will be scraped automatically.

## `maxChannels` (type: `integer`):

Maximum number of channels to scrape from each search keyword

## `maxVideosPerChannel` (type: `integer`):

Number of latest videos to scrape per channel (max 100)

## `includeShorts` (type: `boolean`):

Whether to include YouTube Shorts in video scraping

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

Proxy settings for the crawler. Datacenter proxies work well for YouTube.

## Actor input object example

```json
{
  "channelUrls": [
    "https://www.youtube.com/@mkbhd"
  ],
  "searchKeywords": [],
  "maxChannels": 10,
  "maxVideosPerChannel": 10,
  "includeShorts": 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 = {
    "channelUrls": [
        "https://www.youtube.com/@mkbhd"
    ],
    "searchKeywords": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("fascinating_lentil/youtube-channel-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 = {
    "channelUrls": ["https://www.youtube.com/@mkbhd"],
    "searchKeywords": [],
}

# Run the Actor and wait for it to finish
run = client.actor("fascinating_lentil/youtube-channel-scraper").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 '{
  "channelUrls": [
    "https://www.youtube.com/@mkbhd"
  ],
  "searchKeywords": []
}' |
apify call fascinating_lentil/youtube-channel-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Channel Scraper - Stats, Videos & Analytics",
        "description": "Scrape YouTube channels and their latest videos: subscribers, total views, video counts, descriptions, social links, plus per-video views, likes, comments, duration, and tags.",
        "version": "1.0",
        "x-build-id": "12ZuQIBEgXZHLwa5G"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/fascinating_lentil~youtube-channel-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-fascinating_lentil-youtube-channel-scraper",
                "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/fascinating_lentil~youtube-channel-scraper/runs": {
            "post": {
                "operationId": "runs-sync-fascinating_lentil-youtube-channel-scraper",
                "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/fascinating_lentil~youtube-channel-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-fascinating_lentil-youtube-channel-scraper",
                "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",
                "properties": {
                    "channelUrls": {
                        "title": "Channel URLs",
                        "type": "array",
                        "description": "List of YouTube channel URLs or handles to scrape (e.g. https://www.youtube.com/@mkbhd or @mkbhd)",
                        "default": [
                            "https://www.youtube.com/@mkbhd"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "searchKeywords": {
                        "title": "Search Keywords",
                        "type": "array",
                        "description": "Keywords to search YouTube for channels. Results will be scraped automatically.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxChannels": {
                        "title": "Max Channels from Search",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Maximum number of channels to scrape from each search keyword",
                        "default": 10
                    },
                    "maxVideosPerChannel": {
                        "title": "Max Videos Per Channel",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Number of latest videos to scrape per channel (max 100)",
                        "default": 10
                    },
                    "includeShorts": {
                        "title": "Include Shorts",
                        "type": "boolean",
                        "description": "Whether to include YouTube Shorts in video scraping",
                        "default": false
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Proxy settings for the crawler. Datacenter proxies work well for YouTube.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
