# YouTube Channel Stats (`gochujang/youtube-channel-stats`) Actor

Fetch YouTube channel statistics using the YouTube Data API v3: subscriber count, total views, video count, recent upload dates, top videos by views, and growth metrics. Track multiple channels. Free API with 10,000 units/day quota. API key required.

- **URL**: https://apify.com/gochujang/youtube-channel-stats.md
- **Developed by:** [Hojun Lee](https://apify.com/gochujang) (community)
- **Categories:** Videos
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 item processeds

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/actors/running/actors-in-store.md#pay-per-event

## 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

Fetch YouTube channel statistics using the **YouTube Data API v3** — subscriber count, total views, video count, recent upload dates, top videos by views, and growth metrics. Track multiple channels at once.

Free API with **10,000 units/day** quota. Requires your own Google Cloud API key (takes ~2 minutes to set up).

***

### What you get

| Field | Description |
|---|---|
| `channel_id` | YouTube channel ID (e.g. `UCVHFbw7woebKtYre-5gN61A`) |
| `channel_name` | Display name |
| `custom_url` | Channel handle (e.g. `@MrBeast`) |
| `description` | First 300 chars of channel description |
| `country` | Country code (if set by channel) |
| `created_at` | Channel creation date (ISO 8601) |
| `subscriber_count` | Subscriber count (`null` if channel hides it) |
| `subscribers_hidden` | `true` if subscribers are hidden |
| `total_views` | All-time total view count |
| `video_count` | Total uploaded videos |
| `recent_videos` | Last 10 videos with title, published date, views, likes, URL |

***

### Getting a YouTube API Key (free)

1. Go to [Google Cloud Console](https://console.cloud.google.com/)
2. Create a project (or select existing)
3. Enable **YouTube Data API v3** in APIs & Services → Library
4. Create credentials → API Key
5. (Optional) Restrict key to YouTube Data API v3

Free quota: **10,000 units/day** — enough for ~100 full channel lookups including recent videos.

***

### Input

| Parameter | Required | Description |
|---|---|---|
| `apiKey` | ✅ | Your YouTube Data API v3 key |
| `channelIds` | One of these | List of channel IDs (start with `UC`) |
| `channelNames` | One of these | Channel names to search for (e.g. `["MrBeast", "TED"]`) |
| `includeRecentVideos` | Optional | Fetch last 10 videos per channel (default: `true`) |

You can combine `channelIds` and `channelNames` in the same run.

***

### Example input

```json
{
  "apiKey": "AIza...",
  "channelIds": ["UCVHFbw7woebKtYre-5gN61A"],
  "channelNames": ["TED", "Veritasium"],
  "includeRecentVideos": true
}
```

***

### Example output

```json
{
  "channel_id": "UCVHFbw7woebKtYre-5gN61A",
  "channel_name": "MrBeast",
  "custom_url": "@MrBeast",
  "description": "SUBSCRIBE FOR A COOKIE\n\n",
  "country": "US",
  "created_at": "2012-02-19T21:53:42Z",
  "subscriber_count": 350000000,
  "subscribers_hidden": false,
  "total_views": 62000000000,
  "video_count": 850,
  "recent_videos": [
    {
      "video_id": "abc123",
      "title": "I Spent 7 Days Buried Alive",
      "published_at": "2025-01-10T18:00:00Z",
      "views": 95000000,
      "likes": 4200000,
      "url": "https://www.youtube.com/watch?v=abc123"
    }
  ]
}
```

***

### Pricing

- **$0.01 per channel analyzed**
- Google's YouTube API is free (10,000 units/day)
- Each full channel lookup (with recent videos) uses ~103 API units

***

### Use cases

- 📊 Competitor channel benchmarking
- 📈 Influencer discovery and vetting
- 🔍 Content research and trend tracking
- 📉 Brand channel health monitoring
- Automated YouTube analytics pipelines

***

### Why use YouTube Channel Stats?

1. **Influencer vetting** — Verify subscriber count, total views, and recent upload frequency before a brand deal or sponsorship. `subscribers_hidden: false` + `video_count` + last 10 videos tells you whether a channel is genuine and active.
2. **Competitor benchmarking** — Track competitor channel growth monthly. Total views / video count = views per video average, a key engagement signal beyond raw subscriber count.
3. **Content trend detection** — `recent_videos` titles and view counts reveal what content is performing right now for any channel. Pattern-match across multiple channels to spot trends early.
4. **Brand channel monitoring** — Automate monthly snapshots of your brand's YouTube channel metrics to track growth rate and content performance over time.
5. **Multi-channel pipeline** — Pass 10+ channels at once. Works for both channel IDs (`UC...`) and search-by-name (`"TED"`, `"Veritasium"`).

***

### Related actors

- [Tech News Aggregator](https://apify.com/gochujang/tech-news-aggregator) — News from TechCrunch, Wired, etc. to correlate with YouTube creator topics
- [Reddit Thread Analyzer](https://apify.com/gochujang/reddit-thread-analyzer) — Reddit discussion around the same content or creators
- [Substack Posts Tracker](https://apify.com/gochujang/substack-posts-tracker) — Written content from creators who cross-post between YouTube and newsletters

### Feedback

If this actor powers your content research, a review helps others find it: [Leave a review on Apify Store](https://apify.com/gochujang/youtube-channel-stats#reviews)

# Actor input Schema

## `channelIds` (type: `array`):

YouTube channel IDs (e.g. \['UCVHFbw7woebKtYre-5gN61A']). Start with UC.

## `channelNames` (type: `array`):

YouTube channel names to search for (e.g. \['MrBeast', 'TED'])

## `includeRecentVideos` (type: `boolean`):

Include last 10 videos with view/like counts

## `apiKey` (type: `string`):

Google Cloud YouTube Data API v3 key. Get free at console.cloud.google.com.

## Actor input object example

```json
{
  "includeRecentVideos": 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gochujang/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 = {}

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

```

## MCP server setup

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