# YouTube Channel Stats Scraper - Subscribers, Views, Videos (`capy8ara/youtube-channel-stats`) Actor

Scrape YouTube channel statistics for up to 500 channels per run: subscriber count, total views, video count, handle and creation date. No API key needed - paste handles, channel URLs or IDs. Official Data API, no proxies, point-in-time timestamps on every row.

- **URL**: https://apify.com/capy8ara/youtube-channel-stats.md
- **Developed by:** [Punit Kaushik](https://apify.com/capy8ara) (community)
- **Categories:** Social media, Developer tools, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 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 Channel Stats Scraper - Subscribers, Views, Videos

Scrape YouTube channel statistics for up to 500 channels per run: subscriber count, total views,
video count, handle and channel creation date, straight from the official YouTube Data API v3.

Every row carries the fields a data buyer audits: **when it was observed**, a stable entity key, and
a content hash — so two runs can be diffed and deduplicated instead of eyeballed.

### Input

```json
{
  "channels": ["@MrBeast", "@mkbhd", "UCX6OQ3DkcsbYNE6H8uQQuVA",
               "https://www.youtube.com/channel/UC-lHJZR3Gqxm24_Vd_AJ5Yw"]
}
```

Handles (`@mkbhd`), channel ids (`UC…`) and full channel URLs all work in the same list.

### Output

```json
{
  "record_type": "channel",
  "event_time": "2026-10-25T06:00:11.402Z",
  "ingest_time": "2026-10-25T06:00:11.402Z",
  "entity_key": "youtube:channel:UCX6OQ3DkcsbYNE6H8uQQuVA",
  "source_url": "https://www.youtube.com/channel/UCX6OQ3DkcsbYNE6H8uQQuVA",
  "source_id": "UCX6OQ3DkcsbYNE6H8uQQuVA",
  "content_hash": "…",
  "http_status": 200,
  "title": "MrBeast",
  "handle": "@MrBeast",
  "subscriber_count": 523000000,
  "subscriber_hidden": false,
  "view_count": 144353642443,
  "video_count": 1009,
  "published_at": "2012-02-20T00:00:00Z",
  "country": "US"
}
```

### Two things worth knowing

**`subscriber_count` can be `null`.** Channels are allowed to hide it; the API omits the field
entirely. A null with `subscriber_hidden: true` is the correct answer, not a failure — and not a
zero. Roughly a third of large channels do this, so treating it as 0 would quietly corrupt any
average computed downstream.

**`event_time` equals `ingest_time`.** YouTube exposes the *current* subscriber count and no
history, so this row is an observation, not an event. That is exactly why collecting daily has
value: the series does not exist anywhere else.

### Pricing

Pay per result: **$2.40 per 1,000 channels**, plus a small per-run start fee. One row per channel
found; handles that resolve to nothing cost nothing.

### Notes

- Official YouTube Data API v3. No page scraping, no proxies, no captchas.
- Channels that hide subscriber counts still return views, video count and metadata.
- The API key is supplied by the Actor, so no credentials are needed from you.

# Actor input Schema

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

Channel handles (@mkbhd), channel ids (UC...), or full channel URLs. Up to 500 per run.

## Actor input object example

```json
{
  "channels": [
    "@MrBeast",
    "@mkbhd",
    "@LinusTechTips"
  ]
}
```

# Actor output Schema

## `dataset` (type: `string`):

One row per channel with subscriber, view and video counts, plus point-in-time provenance fields.

## `summary` (type: `string`):

Channels requested, channels found, and the ingest timestamp.

# 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",
        "@mkbhd",
        "@LinusTechTips"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("capy8ara/youtube-channel-stats").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",
        "@mkbhd",
        "@LinusTechTips",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("capy8ara/youtube-channel-stats").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",
    "@mkbhd",
    "@LinusTechTips"
  ]
}' |
apify call capy8ara/youtube-channel-stats --silent --output-dataset

```

## MCP server setup

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

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/h3t7hb1VIAyFy5Nfp/builds/4bgLHBUfBRluh8uce/openapi.json
