# ViewStats Scraper - YouTube Channel Stats & Search (`haketa/viewstats-scraper`) Actor

Scrape ViewStats search results and channel details: YouTube subscribers, views, video count, global/country/category rankings, long-vs-short splits and average views. Search by keyword or pass channel handles/URLs. No login, no API key, no browser. Export JSON, CSV, Excel.

- **URL**: https://apify.com/haketa/viewstats-scraper.md
- **Developed by:** [Haketa](https://apify.com/haketa) (community)
- **Categories:** Social media, Business
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.75 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## ViewStats Scraper — YouTube Channel Stats, Rankings & Analytics

**Scrape [ViewStats](https://www.viewstats.com) search results and YouTube channel analytics** in one run — **subscribers, total views, video count, global / country / category rankings, average views, estimated revenue and long-form-vs-Shorts splits** — by keyword or by channel handle. This **ViewStats scraper** reads the same JSON data ViewStats' own front-end uses, so you get clean, structured records with **no login, no API key, no browser extension, and no coding**.

Export to **JSON, CSV, Excel, HTML, XML, or pull straight from the API**.

> Built for influencer-marketing teams, talent agencies, brand-sponsorship scouts, media researchers, data journalists, and YouTube creators who want ViewStats channel data as a clean dataset instead of copying numbers off a web page.

***

### 🔎 Why scrape ViewStats?

[ViewStats](https://www.viewstats.com) is a YouTube analytics platform (co-founded by MrBeast) that tracks millions of channels and surfaces the kind of numbers the native YouTube UI hides: **global and country subscriber rankings, category rankings, views-per-video signals, upload cadence, estimated ad revenue, and a long-form-vs-Shorts breakdown**. It is one of the richest free sources of comparative creator data on the web.

The problem is that this data lives behind a search box and interactive dashboards. If you want to compare 50 cooking channels, build an outreach list for a sponsorship campaign, or benchmark a competitor over time, you end up clicking through profiles and copy-pasting numbers by hand. That does not scale, it is error-prone, and it leaves you with no structured dataset to filter, sort, or feed into a spreadsheet or CRM.

This **ViewStats scraper** automates all of it. Give it search keywords and/or channel handles and it returns one clean row per channel with every headline metric already parsed into typed fields — ready for Sheets, BI tools, or your own pipeline.

**Common reasons people scrape ViewStats:**

- Build **influencer shortlists** for a niche, then sort by subscribers, views, or ranking.
- **Benchmark competitors** — compare channels on subs, views, rankings, and upload frequency.
- Source **brand-deal and sponsorship candidates** by size, country, and engagement signals.
- Track **creator growth** by running the scraper on a schedule and diffing the numbers.
- Assemble **market and trend datasets** of YouTube channels by topic or country.
- Enrich an existing **list of channel handles** with full ViewStats analytics in bulk.
- Feed **estimated-revenue and Shorts-vs-long-form data** into monetization research.

### ✨ What this ViewStats scraper does

- ✅ **Two input modes, combinable in one run** — **search by keyword** (`searchQueries`) to discover matching channels, and/or pass **specific channels** (`channels`) by `@handle`, `viewstats.com/@handle` URL, `youtube.com/@handle` URL, or a `UC…` channel id.
- ✅ **Automatic pagination** across ViewStats search pages, collecting and de-duplicating results up to your `maxResultsPerQuery` limit.
- ✅ **Core channel stats** — `subscriberCount`, `viewCount`, `videoCount`, `verified`, `country`.
- ✅ **ViewStats rankings** — `globalSubscribersRanking`, `globalViewsRanking`, `countrySubscriberRanking`, `categorySubscriberRanking`.
- ✅ **Engagement signal** — `vpv90` (90-day views-per-video).
- ✅ **Identity & media** — `displayName`, `handle`, `channelId`, `avatarUrl`, `bannerUrl`, plus a channel **description** when the search surfaces one.
- ✅ **Ready-made links** — `viewstatsUrl` and `youtubeUrl` for every channel.
- ✅ **Deep analytics (optional)** — with `includeStats` on, each row also carries `averages` (daily / weekly / monthly / yearly **views, subscriber gains, and estimated low/high USD revenue**, plus `uploadFrequency`) and `longsAndShorts` (video / Shorts / long-form counts and views across weekly, monthly, 90-day, yearly, and all-time windows).
- ✅ **Fast HTTP, no browser** — reads ViewStats' JSON API directly (handling its bot-prevention token and encrypted payloads automatically), so runs are quick and cheap on **datacenter proxies**.
- ✅ **Robust** — automatic retries with back-off, proxy rotation, and graceful handling of channels that can't be resolved.
- ✅ **Export anywhere** — JSON, CSV, Excel, HTML, XML, or the Apify dataset API.

### 🎯 Use cases

- **Influencer-marketing agencies** — discover creators in a niche and export a vetted shortlist with subs, rankings, and country.
- **Brand & sponsorship teams** — source channels by size and geography, and use estimated-revenue and view-average signals to gauge reach.
- **Talent managers** — monitor a roster of channels' subscriber and view rankings over time.
- **Competitor & market analysts** — benchmark a set of channels on growth, upload cadence, and Shorts-vs-long-form strategy.
- **Media & data journalists** — build reproducible datasets of top creators by topic or country.
- **MCN / network operators** — bulk-enrich a list of channel handles with ViewStats analytics.
- **Creators & editors** — track your own channel's rankings and compare against peers.
- **Data teams & SaaS products** — pull **ViewStats data** via API into dashboards, warehouses, or lead databases.

### 📥 Input

Provide at least one search query or one channel. Every field is optional; sensible defaults apply.

| Field | Type | Description |
|-------|------|-------------|
| `searchQueries` | array of strings | Keywords to search ViewStats for channels (e.g. `mrbeast`, `tech reviews`). Each keyword returns its matching channels. |
| `channels` | array of strings | Specific channels to fetch details for — a `@handle`, a `viewstats.com/@handle` URL, a `youtube.com/@handle` URL, or a `UC…` channel id. |
| `includeDetails` | boolean | Fetch complete channel details (subscribers, views, rankings, etc.) for every search result. Default `true`. Turn off to return only lightweight search info. |
| `includeStats` | boolean | Also fetch each channel's `averages` (views, subscriber gains, estimated revenue, upload frequency) and `longsAndShorts` breakdown. Default `false`. |
| `maxResultsPerQuery` | integer | Maximum channels to collect per search keyword. Default `50`. |
| `proxyConfiguration` | object | Proxy settings. Defaults to Apify Proxy (datacenter), which is recommended. |

#### Example input

```json
{
  "searchQueries": ["tech reviews"],
  "channels": ["@MrBeast", "https://www.youtube.com/@mkbhd"],
  "includeDetails": true,
  "includeStats": true,
  "maxResultsPerQuery": 20
}
```

### 📤 Output

The actor writes one row per channel to the dataset. Here is a representative record (with `includeStats` enabled):

```json
{
  "channelId": "UCX6OQ3DkcsbYNE6H8uQQuVA",
  "handle": "mrbeast",
  "displayName": "MrBeast",
  "subscriberCount": 523000000,
  "viewCount": 144353642443,
  "videoCount": 1009,
  "verified": true,
  "country": "US",
  "globalSubscribersRanking": 1,
  "globalViewsRanking": 12,
  "countrySubscriberRanking": 1,
  "categorySubscriberRanking": 1,
  "vpv90": 110584326,
  "totalFollowing": 0,
  "description": "SUBSCRIBE FOR A COOKIE!",
  "avatarUrl": "https://yt3.ggpht.com/…",
  "bannerUrl": "https://yt3.googleusercontent.com/…",
  "viewstatsUrl": "https://www.viewstats.com/@mrbeast",
  "youtubeUrl": "https://www.youtube.com/@mrbeast",
  "averages": {
    "daily":   { "viewsAverage": 53611, "subsAverage": 33, "estimatedRevenueLowUsd": 8, "estimatedRevenueHighUsd": 18 },
    "weekly":  { "viewsAverage": 375277, "subsAverage": 231, "estimatedRevenueLowUsd": 56, "estimatedRevenueHighUsd": 124 },
    "monthly": { "viewsAverage": 1608341, "subsAverage": 1000, "estimatedRevenueLowUsd": 241, "estimatedRevenueHighUsd": 531 },
    "yearly":  { "viewsAverage": 9484715, "subsAverage": 16000, "estimatedRevenueLowUsd": 1422, "estimatedRevenueHighUsd": 3130 },
    "uploadFrequency": 9
  },
  "longsAndShorts": {
    "weekly":     { "videos": 2, "shorts": 0, "longs": 2, "views": 223222, "longViews": 222246, "shortViews": 975 },
    "monthly":    { "videos": 6, "shorts": 0, "longs": 6, "views": 1581187, "longViews": 1574430, "shortViews": 6756 },
    "ninetyDays": { "videos": 28, "shorts": 4, "longs": 24, "views": 3372772, "longViews": 3333083, "shortViews": 39688 },
    "yearly":     { "videos": 120, "shorts": 20, "longs": 100, "views": 9484715, "longViews": 9300000, "shortViews": 184715 },
    "allTime":    { "videos": 1009, "shorts": 50, "longs": 959, "views": 144353642443, "longViews": 143000000000, "shortViews": 1353642443 }
  },
  "searchQuery": "tech reviews",
  "scrapedAt": "2026-10-25T12:00:00.000Z"
}
```

#### Field reference

| Field | Description |
|-------|-------------|
| `channelId` | YouTube channel id (`UC…`). |
| `handle` | YouTube/ViewStats `@handle` (without the `@`). |
| `displayName` | Channel display name. |
| `subscriberCount` | Total subscribers. |
| `viewCount` | Lifetime total views. |
| `videoCount` | Number of public videos. |
| `verified` | Whether the channel is verified. |
| `country` | Two-letter country code. |
| `globalSubscribersRanking` | ViewStats global rank by subscribers. |
| `globalViewsRanking` | ViewStats global rank by total views. |
| `countrySubscriberRanking` | Rank by subscribers within the channel's country. |
| `categorySubscriberRanking` | Rank by subscribers within the channel's category. |
| `vpv90` | Views-per-video signal over the last 90 days. |
| `totalFollowing` | Accounts the channel follows (YouTube reports `0`). |
| `description` | Channel description — present when surfaced by a search query. |
| `avatarUrl` / `bannerUrl` | Channel avatar and banner image URLs. |
| `viewstatsUrl` / `youtubeUrl` | Direct links to the ViewStats and YouTube pages. |
| `averages` | Daily/weekly/monthly/yearly view & subscriber averages, estimated low/high USD revenue, and `uploadFrequency`. *Present with `includeStats`.* |
| `longsAndShorts` | Video / Shorts / long-form counts and views across weekly, monthly, 90-day, yearly, and all-time windows. *Present with `includeStats`.* |
| `searchQuery` | The keyword that surfaced this channel (search mode only). |
| `scrapedAt` | ISO 8601 timestamp of when the row was scraped. |

Some fields are populated only when ViewStats has the data for a given channel. Ranking fields can be `null` for very small or new channels, `bannerUrl`/`avatarUrl` may be empty for channels without art, and `description` appears when the data comes from a search result. The deep `averages` and `longsAndShorts` objects are only included when you enable `includeStats`.

### 🔁 Pagination & scale

For each keyword in `searchQueries`, the **ViewStats scraper** calls the search API with `withPagination=true` and walks pages (`page=1`, `page=2`, …), reading `totalPages` from each response. It keeps requesting pages until it reaches the end of the results or hits your **`maxResultsPerQuery`** cap, then de-duplicates and trims to that limit. Each explicit entry in `channels` triggers a direct channel-details lookup (plus the optional stats endpoints). Set `maxResultsPerQuery` high to pull every matching channel for a keyword, or low to keep runs lean — and add more keywords or handles to scale out breadth. Because it runs over fast HTTP with no browser, large multi-keyword jobs stay quick and inexpensive.

### ⚙️ How to use

1. Open the actor on the **Apify Console**.
2. Enter one or more **search keywords** in `searchQueries` and/or paste **channel handles/URLs** into `channels`.
3. (Optional) Toggle `includeStats` on for averages, estimated revenue, and the Shorts-vs-long-form breakdown.
4. (Optional) Set `maxResultsPerQuery` to control how many channels each keyword returns.
5. Click **Start** and watch rows stream into the dataset.
6. **Export** the results as JSON, CSV, Excel, HTML, or XML — or fetch them from the **Apify API**.
7. **Automate it**: schedule recurring runs, or trigger via API and connect to **Make, Zapier, Google Sheets, or a webhook**.

### 💡 Tips

- **Build a niche list**: search a topic (e.g. `cooking`) with a high `maxResultsPerQuery`, keep `includeDetails` on, and sort the dataset by `subscriberCount`.
- **Deep-dive a creator**: pass the handle in `channels` with `includeStats` on to get averages, estimated revenue, upload frequency, and the long/short split.
- **Mix modes**: combine `searchQueries` and `channels` in a single run to discover *and* enrich in one pass.
- **Keep runs cheap**: leave `includeStats` off when you only need headline stats and rankings — that skips the extra per-channel analytics calls.
- **Track growth over time**: schedule the same input daily or weekly and diff `subscriberCount`, `viewCount`, and the ranking fields.
- **Rank by reach**: `globalSubscribersRanking` and `globalViewsRanking` are great primary sort keys for comparing channels of different sizes.

### ❓ FAQ

**Is scraping ViewStats legal?**
This actor collects **publicly available** YouTube channel statistics that ViewStats surfaces on its public pages. Use the output responsibly and in line with ViewStats' and YouTube's Terms and applicable laws. You are responsible for how you use the data.

**Do I need a ViewStats account, login, or API key?**
No. There is no login, no API key, and no browser extension. Just provide keywords and/or handles.

**How many channels can I get, and how fast?**
Search mode returns up to `maxResultsPerQuery` channels per keyword; add more keywords or handles to scale. Because it runs over fast HTTP with no browser, runs are quick and typically finish in seconds to a couple of minutes depending on how many channels and whether `includeStats` is on.

**Do I need proxies?**
Apify Proxy (datacenter) is enabled by default and recommended — it rotates IPs and keeps requests reliable. You can supply your own proxy configuration if you prefer.

**Is there a ViewStats API I can use instead?**
This actor *is* your ViewStats API: it reads ViewStats' internal JSON endpoints (handling the bot-prevention token and encrypted responses for you) and returns clean, typed records you can fetch through the Apify API or export to a file.

**How fresh is the data?**
Every field is scraped live from ViewStats on each run, so the numbers reflect ViewStats' current figures at run time.

**Can I get estimated revenue and a Shorts-vs-long-form breakdown?**
Yes — enable `includeStats`. Each row then includes `averages` (with estimated low/high USD revenue and view/subscriber averages) and `longsAndShorts` across multiple time windows.

**What handle and URL formats are accepted?**
`@handle`, `viewstats.com/@handle`, `youtube.com/@handle`, `youtube.com/channel/UC…`, or a bare `UC…` channel id.

**Why is `description` sometimes empty?**
ViewStats returns a description on search-result objects but not on its channel-detail endpoint, so `description` is populated for channels found via `searchQueries`. Ranking fields can also be `null` for very small or brand-new channels that ViewStats hasn't ranked yet.

**Can I export to Google Sheets or my own app?**
Yes — export to CSV/Excel, pull the dataset via the Apify API, or wire the output into Make, Zapier, a webhook, or a database.

### 🔗 Related scrapers

- [YouTube Contact Scraper](https://apify.com/haketa/youtube-contact-scraper) — pull creator emails and contact info from YouTube channels.
- [YouTube Comments Scraper](https://apify.com/haketa/youtube-comments-scraper) — scrape comments and engagement from any YouTube video.
- [Patreon Scraper](https://apify.com/haketa/patreon-scraper) — extract creators, tiers, and membership data from Patreon.
- [WeChat Official Account Scraper](https://apify.com/haketa/wechat-official-account-scraper) — collect posts and account data from WeChat.
- [Xiaohongshu (RedNote) Scraper](https://apify.com/haketa/xiaohongshu-rednote-scraper) — scrape notes and creators from Xiaohongshu / RED.
- [Bilibili Scraper](https://apify.com/haketa/bilibili-scraper) — extract videos and channel data from Bilibili.

***

**Ready to go?** Click **Start**, drop in a keyword or a handle, and get clean **ViewStats YouTube channel data** — subscribers, views, rankings, and analytics — in seconds. Export to JSON, CSV, Excel, or API.

# Actor input Schema

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

Keywords to search ViewStats for channels (e.g. <b>mrbeast</b>, <b>tech reviews</b>). Each returns matching channels. Leave empty if you only pass channels below.

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

Specific channels to get details for — a <b>@handle</b>, a <b>viewstats.com/@handle</b> URL, a <b>youtube.com/@handle</b> URL, or a <b>UC…</b> channel id.

## `includeDetails` (type: `boolean`):

Fetch complete channel details (subscribers, views, rankings, etc.) for every search result. Turn off to return just the lightweight search info.

## `includeStats` (type: `boolean`):

Also fetch each channel's average views (daily/weekly/monthly/yearly), upload frequency and long-form vs Shorts breakdown.

## `maxResultsPerQuery` (type: `integer`):

Maximum channels to collect per search keyword.

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

Optional. Defaults to Apify Proxy (datacenter).

## Actor input object example

```json
{
  "searchQueries": [
    "mrbeast"
  ],
  "channels": [
    "@MrBeast"
  ],
  "includeDetails": true,
  "includeStats": false,
  "maxResultsPerQuery": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `channels` (type: `string`):

Scraped ViewStats channels with subscribers, views and rankings.

# 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 = {
    "searchQueries": [
        "mrbeast"
    ],
    "channels": [
        "@MrBeast"
    ],
    "maxResultsPerQuery": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("haketa/viewstats-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 = {
    "searchQueries": ["mrbeast"],
    "channels": ["@MrBeast"],
    "maxResultsPerQuery": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("haketa/viewstats-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 '{
  "searchQueries": [
    "mrbeast"
  ],
  "channels": [
    "@MrBeast"
  ],
  "maxResultsPerQuery": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call haketa/viewstats-scraper --silent --output-dataset

```

## MCP server setup

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