# YouTube Profile & Channel Scraper (`datapilot/youtube-profile-channel-scraper`) Actor

Extract channel titles, descriptions, subscriber counts, video totals, avatars, and channel URLs from handles or links. Supports fast , Apify Proxy, batch processing, and structured dataset exports.

- **URL**: https://apify.com/datapilot/youtube-profile-channel-scraper.md
- **Developed by:** [Data Pilot](https://apify.com/datapilot) (community)
- **Categories:** Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 scraped 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 Profile & Channel** Scraper is a powerful Apify Actor designed to discover, track, and collect public **YouTube Profile & Channel** data directly from YouTube's own channel pages using fast HTTP requests. This tool provides comprehensive **YouTube Profile & Channel** intelligence including channel title, description, subscriber count, video count, and avatar for any accessible **YouTube Profile & Channel**. Whether you're building a creator dashboard, tracking competitor channels, or conducting content research, the YouTube Profile & Channel Scraper delivers actionable **YouTube Profile & Channel** insights efficiently.

With direct HTML/JSON parsing, multi-layer fallback extraction, About-page cross-checking, and reliable Apify Dataset delivery, the YouTube Profile & Channel Scraper ensures comprehensive **YouTube Profile & Channel** coverage across any list of handles or channel links. It focuses on key **YouTube Profile & Channel** signals including subscribers, video count, and description, making it an essential tool for creator research and content intelligence.

***

### 📋 Table of Contents

- [Features](#-features)
- [Data Source](#-data-source)
- [How It Works](#-how-it-works)
- [Input](#-input)
- [Output](#-output)
- [Technical Stack](#-technical-stack)
- [Data Fields](#-data-fields-explained)
- [Use Cases](#-use-cases)
- [Quick Start](#-quick-start)
- [Configuration](#-configuration)
- [Performance](#-performance)
- [Important Notes](#-important-notes)
- [License & Legal](#-license--legal)

***

### 🔥 Features

- **Fast HTTP Scraping** – Uses `httpx` for lightweight, high-speed requests to each **YouTube Profile & Channel** page without a full browser.
- **Flexible Input Handling** – Accepts plain handles, `@handles`, or full **YouTube Profile & Channel** URLs and normalizes them automatically.
- **ytInitialData Parsing** – Extracts channel metadata directly from YouTube's embedded `ytInitialData` JSON for accurate **YouTube Profile & Channel** results.
- **Deep Key Search** – Recursively searches nested JSON for subscriber and video count fields, regardless of where YouTube places them.
- **About Page Fallback** – Automatically checks the channel's About page when subscriber or video counts are missing from the main page.
- **Raw Regex Fallback** – Applies pattern matching directly on page HTML as a final fallback for subscriber/video figures.
- **OpenGraph Meta Fallback** – Falls back to title, description, and avatar meta tags when structured data is unavailable.
- **404 Detection** – Automatically detects and skips **YouTube Profile & Channel** pages that no longer exist.
- **Residential Proxy Support** – Apify residential proxy for reliable **YouTube Profile & Channel** access.
- **Batch Processing** – Scrape any number of **YouTube Profile & Channel** entries in a single run.
- **Human-Like Pacing** – Built-in delay between **YouTube Profile & Channel** requests to reduce blocking.
- **Real-Time Dataset Push** – Pushes all collected **YouTube Profile & Channel** records to Apify Dataset in a single batch.
- **Graceful Error Handling** – Skips a failing **YouTube Profile & Channel** without stopping the whole run.

***

### 📊 Data Source

#### **YouTube Public Channel Pages**

- **Authority**: YouTube's own public-facing channel and About pages
- **Access Method**: Fast async HTTP requests via `httpx`, rendering `youtube.com/@{handle}` and its `/about` page
- **Coverage**: Any public **YouTube Profile & Channel** reachable without login
- **Data**: Embedded `ytInitialData` JSON, About-page text, and OpenGraph metadata
- **Access**: Public pages, no API key required
- **Update Frequency**: Reflects each **YouTube Profile & Channel**'s current live state at time of run

***

### ⚙️ How It Works

The YouTube Profile & Channel Scraper accepts a list of handles or channel URLs, normalizes each into a clean handle, and fetches the main channel page via a fast async HTTP client. It parses YouTube's embedded `ytInitialData` script to extract title, description, avatar, subscriber count, and video count using a recursive key search. If subscriber or video counts are still missing, the Actor fetches the channel's About page and applies targeted regex matching, then falls back to raw HTML regex matching, and finally to OpenGraph meta tags if needed. Every successfully scraped **YouTube Profile & Channel** record is collected and pushed to the Apify Dataset in a single batch at the end of the run.

**Key Processing Steps:**

1. **Input Parsing** – Accept a list of handles, `@handles`, or full **YouTube Profile & Channel** URLs
2. **Handle Normalization** – Strip `@` symbols and extract the handle from full URLs
3. **Proxy Setup** – Configure Apify residential proxy for the HTTP client
4. **Channel Loop** – Iterate through each normalized **YouTube Profile & Channel** handle
5. **Main Page Fetch** – Request `youtube.com/@{handle}` and check for 404s
6. **ytInitialData Parsing** – Extract title, description, avatar, subscribers, and video count from embedded JSON
7. **About Page Fallback** – Fetch `/about` and regex-match subscriber/video counts if still missing
8. **Raw HTML Fallback** – Apply regex directly on the main page HTML as a further fallback
9. **Meta Tag Fallback** – Use OpenGraph title/description/image tags if structured data is unavailable
10. **Timestamp Tagging** – Record scrape time per entry
11. **Rate Limiting** – Apply a short delay between **YouTube Profile & Channel** requests
12. **Dataset Push** – Push all collected records from the run in a single batch

**Key Benefits:**

- Pull **YouTube Profile & Channel** data for any public channel without manual visits
- Detect missing or renamed **YouTube Profile & Channel** pages automatically
- Monitor creator and brand channels' **YouTube Profile & Channel** metrics over time
- Feed content dashboards, research pipelines, or influencer-tracking tools
- Automate recurring **YouTube Profile & Channel** checks as subscriber counts change

***

### 📥 Input

The Actor accepts the following input parameters:

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `channels` | array | *(required)* | List of **YouTube Profile & Channel** handles, `@handles`, or full channel URLs. |
| `useApifyProxy` | boolean | `true` | Enable Apify residential proxies. |
| `apifyProxyGroups` | array | `["RESIDENTIAL"]` | Proxy group configuration. |

**Example Input:**

```json
{
  "channels": [
    "mkbhd",
    "@nasa",
    "https://www.youtube.com/@natgeo"
  ],
  "useApifyProxy": true,
  "apifyProxyGroups": ["RESIDENTIAL"]
}
```

**Scrape a Single YouTube Profile & Channel:**

```json
{
  "channels": ["natgeo"]
}
```

**Scrape from Full Channel URLs:**

```json
{
  "channels": [
    "https://www.youtube.com/@nasa",
    "https://www.youtube.com/@natgeo"
  ]
}
```

***

### 📤 Output

The Actor pushes **YouTube Profile & Channel** records with the following structure:

| Field | Type | Description |
|-------|------|-------------|
| `handle` | string | The normalized **YouTube Profile & Channel** handle used for the request |
| `title` | string | Channel name extracted from `ytInitialData` or meta tags |
| `channel_url` | string | The full **YouTube Profile & Channel** URL |
| `description` | string | Channel description text |
| `subscribers` | string/null | Subscriber count as displayed on the **YouTube Profile & Channel** (e.g., "1.2M subscribers") |
| `videos_count` | string/null | Video count as displayed on the **YouTube Profile & Channel** (e.g., "342 videos") |
| `avatar` | string | URL of the **YouTube Profile & Channel** avatar image |
| `scraped_at` | string | ISO 8601 timestamp of when the record was scraped |

**Example YouTube Profile & Channel Record:**

```json
{
  "handle": "natgeo",
  "title": "National Geographic",
  "channel_url": "https://www.youtube.com/@natgeo",
  "description": "It's more than a channel. It's a mission.",
  "subscribers": "22.4M subscribers",
  "videos_count": "9,850 videos",
  "avatar": "https://yt3.googleusercontent.com/...",
  "scraped_at": "2026-08-06T09:00:00+00:00"
}
```

***

### 🧰 Technical Stack

- **HTTP Client:** `httpx` for fast async requests to **YouTube Profile & Channel** pages, no browser required
- **JSON Parsing:** Regex extraction and recursive key search across YouTube's `ytInitialData` structure
- **HTML Parsing:**  for OpenGraph metadata fallback
- **Date Handling:** `datetime` with timezone-aware UTC timestamps
- **Async:** `asyncio` for non-blocking, multi-channel processing
- **Proxy:** Apify Proxy with `RESIDENTIAL` configuration
- **Logging:** Apify Actor logging system
- **Platform:** Apify Actor serverless environment

***

### 📊 Data Fields Explained

#### **Identity**

- **handle**: The normalized handle used to build the **YouTube Profile & Channel** URL
- **title**: The public channel name shown on the **YouTube Profile & Channel**

#### **Channel Details**

- **description**: The channel's about/description text
- **channel\_url**: The canonical link to the **YouTube Profile & Channel**
- **avatar**: Direct link to the channel's avatar image

#### **Engagement Metrics**

- **subscribers**: Subscriber count as publicly displayed on the **YouTube Profile & Channel**
- **videos\_count**: Total video count as publicly displayed on the **YouTube Profile & Channel**

***

### 🎯 Use Cases

- **Creator Research** – Evaluate subscriber and video metrics before an influencer partnership
- **Competitor Tracking** – Monitor a competitor's **YouTube Profile & Channel** growth over time
- **Content Auditing** – Verify channel descriptions and branding are up to date
- **Marketing Analytics** – Feed **YouTube Profile & Channel** metrics into campaign dashboards
- **Media Monitoring** – Track how partner or affiliate channels present themselves
- **Academic Research** – Study public **YouTube Profile & Channel** trends at scale
- **OSINT Research** – Gather publicly available **YouTube Profile & Channel** metadata for investigations

***

### 🚀 Quick Start

#### **1. Prepare Input**

Go to Apify Console and enter:

```json
{
  "channels": ["nasa", "natgeo"]
}
```

#### **2. Run the Actor**

Click **Start**. The Actor will:

- Normalize each handle or URL into a clean **YouTube Profile & Channel** handle
- Fetch the main channel page and parse embedded JSON data
- Fall back to About-page or meta-tag data as needed
- Push all results to the Dataset

#### **3. Monitor Progress**

Console shows:

```
Initializing Fast HTTP YouTube Scraper for 2 channel(s)...
[YouTube Scraper] Fetching channel data for: '@nasa'...
[YouTube Scraper] Fetching channel data for: '@natgeo'...
Done! Successfully saved 2 YouTube channel(s) to Dataset.
```

#### **4. View & Download Results**

- **Results Tab**: All **YouTube Profile & Channel** records
- **Export**: JSON, CSV, Excel, or HTML
- **Filter**: By subscriber count or handle
- **API Access**: Available via the Apify API

***

### ⚙️ Configuration

Single YouTube Profile & Channel:

```json
{
  "channels": ["natgeo"]
}
```

Mixed handles and URLs:

```json
{
  "channels": [
    "@nasa",
    "https://www.youtube.com/@natgeo"
  ]
}
```

Run without proxy:

```json
{
  "channels": ["natgeo"],
  "useApifyProxy": false
}
```

***

### 📈 Performance

#### **Processing Speed**

- One to two lightweight HTTP requests per **YouTube Profile & Channel** (main page, plus About page if needed)
- 1 second delay between channels to reduce blocking
- Faster than browser-based scraping since no rendering engine is required

#### **Resource Usage**

- Memory: Low, since no browser instance is launched
- Network: One or two requests per **YouTube Profile & Channel**, depending on fallback needs
- Proxy: One residential proxy tunnel shared across the HTTP client for the run

***

### ⚠️ Important Notes

#### **Legal & Compliance**

- **Fair Use**: Respects YouTube's public pages and applies pacing delays between requests
- **Public Data Only**: Retrieves only publicly visible **YouTube Profile & Channel** data exposed on the rendered page
- **Privacy**: Collecting channel data may be subject to privacy regulations and YouTube's Terms of Service — use only for legitimate purposes
- **Legal**: Not legal advice — consult qualified professionals before using this data for compliance-sensitive decisions

#### **Data Quality**

- **Freshness**: Reflects each **YouTube Profile & Channel**'s live state at time of run
- **Completeness**: Subscriber/video counts depend on which extraction layer succeeds; some channels may return partial data
- **Accuracy**: Sourced directly from YouTube's own rendered pages
- **Verification**: Cross-check high-stakes figures against the live YouTube app or website

#### **Best Practices**

- Always configure a residential proxy for the most reliable **YouTube Profile & Channel** access
- Use full channel URLs when a handle alone is ambiguous
- Re-run periodically to track changes in subscriber or video counts
- Expect `subscribers` or `videos_count` to occasionally be `null` if all extraction layers fail
- Batch multiple handles together in one run to reduce overhead

***

### 📄 License & Legal

**Terms of Use:**

- Use for legitimate research, marketing, and analytics purposes
- Respect YouTube's Terms of Service
- Do not use for unsolicited contact, harassment, or unlawful surveillance
- Use **YouTube Profile & Channel** data responsibly and in compliance with applicable privacy laws

**Disclaimer:**
YouTube Profile & Channel Scraper is provided as-is for research and analytics purposes. Users are responsible for compliance with YouTube's ToS and all applicable laws. This is not legal advice.

***

### ⚖️ YouTube Profile & Channel Excellence

This Actor is optimized for **YouTube Profile & Channel** research with:

- ✅ Fast, browser-free HTTP scraping
- ✅ Multi-layer fallback extraction (JSON → About page → regex → meta tags)
- ✅ Flexible handle/URL input handling
- ✅ 404 and missing-channel detection
- ✅ Real-time Dataset push
- ✅ Production-ready code

# Actor input Schema

## `channels` (type: `array`):

Enter YouTube handles or channel URLs (e.g. MrBeast or https://www.youtube.com/@MrBeast).

## `useApifyProxy` (type: `boolean`):

Recommended to bypass rate limiting.

## `apifyProxyGroups` (type: `array`):

Select proxy networks (RESIDENTIAL is recommended).

## Actor input object example

```json
{
  "channels": [
    "MrBeast"
  ],
  "useApifyProxy": true,
  "apifyProxyGroups": [
    "RESIDENTIAL"
  ]
}
```

# 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 = {
    "channels": [
        "MrBeast"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("datapilot/youtube-profile-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 = { "channels": ["MrBeast"] }

# Run the Actor and wait for it to finish
run = client.actor("datapilot/youtube-profile-channel-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 '{
  "channels": [
    "MrBeast"
  ]
}' |
apify call datapilot/youtube-profile-channel-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datapilot/youtube-profile-channel-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/IWB9OfrEVXhtVVIOx/builds/1ks0wHnyCO4epXUJm/openapi.json
