# Twitch Top Categories (`apt_marble/twitch-top-categories`) Actor

Snapshot the top Twitch categories with live viewer counts, follower counts and genre tags — one clean row per game or category.

- **URL**: https://apify.com/apt\_marble/twitch-top-categories.md
- **Developed by:** [Hamza](https://apify.com/apt_marble) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.50 / 1,000 category rows

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

## Twitch Top Categories

Get a snapshot of the top Twitch categories in live-viewer order, each with viewer counts, follower counts and genre tags. Built for anyone tracking where attention on Twitch is going: game publishers watching their launch against competitors, analysts measuring category share, marketers picking where to show up, and trend desks spotting rising games early.

### What you can do with it

- **Rank the directory** — get the top categories by live viewers as clean rows, up to 100 per run.
- **Track a launch** — re-run on a schedule and watch your game's viewers and rank move against competitors.
- **Size a market** — viewer and follower counts per category quantify attention game by game.
- **Discover rising games** — diff daily snapshots to spot categories climbing the ranking.
- **Feed a dashboard** — one row per category with stable IDs, ready to join with your other data.

### What you get

One row per category, in live-viewer order. Abridged sample of a single record:

```json
{
  "categoryId": "509658",
  "name": "Just Chatting",
  "displayName": "Just Chatting",
  "viewersCount": 301513,
  "followersCount": 53075589,
  "boxArtUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg",
  "tags": ["IRL"],
  "categoryUrl": "https://www.twitch.tv/directory/category/just-chatting",
  "collectedAt": "2026-09-14T09:00:00.000Z"
}
```

Every row carries `collectedAt`, the moment of its snapshot. Schedule the actor hourly, daily or weekly and diff the datasets on `collectedAt` to build your own 24h / weekly / monthly trend views — Twitch only serves the live directory, so history is built from your snapshots, not requested from it.

### Input reference

| Setting | Type | Default | What it does |
| --- | --- | --- | --- |
| Max categories | whole number | `50` | How many of the top categories to collect, in live-viewer order. Maximum 100 — each run returns a single snapshot of the directory. |
| Min viewers | whole number | `0` | Only keep categories with at least this many live viewers. `0` keeps everything. |
| Min followers | whole number | `0` | Only keep categories with at least this many total followers. `0` keeps everything. Combine both to find categories that are big *and* hot right now. |
| Sort by | `VIEWERS` / `FOLLOWERS` | `VIEWERS` | `VIEWERS` keeps the live directory order; `FOLLOWERS` re-ranks the snapshot by total followers, so each choice returns a different top list. |

### Output fields

| Field | Type | Description |
| --- | --- | --- |
| `categoryId` | text | Stable numeric Twitch ID for the category. |
| `name` | text | Category name. |
| `displayName` | text | Category display name. |
| `viewersCount` | number | Live viewers in the category at collection time. |
| `followersCount` | number | Total followers of the category. |
| `boxArtUrl` | text | Category artwork image. |
| `tags` | list of text | Genre tags such as Shooter or IRL. |
| `categoryUrl` | text | Clean link to the category directory page. |
| `collectedAt` | text | ISO timestamp of the snapshot this row came from — group by it to build trends over time. |

### Pricing

You pay per category row, with no monthly minimum.

| What you are charged for | Price |
| --- | --- |
| Category row — one row added to your dataset | **$1.50 per 1,000** |

**Worked example.** A run that collects 100 categories costs 100 × $0.0015 = **$0.15**. A daily run collecting 100 categories is about $0.15 per run, roughly $4.50 a month.

### Limits & what this actor cannot do

- Each run returns a single snapshot of the top categories (up to 100) — deeper pages of the directory are not collected.
- Rows are a snapshot at the moment of collection; viewers and rankings keep changing afterwards.
- Fields a category does not show come back empty rather than guessed.
- Speed depends on Twitch's own response times; no fixed throughput is promised.
- Twitch's terms govern automated access. You are responsible for using the data lawfully and in line with the source site's terms, and for handling any personal data in line with applicable privacy law.

### FAQ

**Do I need a Twitch account?**
No. The actor reads only what Twitch shows in its directory — press start.

**How many categories can I collect per run?**
Up to 100, in live-viewer order.

**Can I schedule it?**
Yes. Schedule it hourly, daily or weekly from the Apify console, and each run writes a fresh dataset you can compare against the last.

**Why do I get the same categories every run?**
The directory is live, and the very top barely moves. Change the picture with other settings: sort by `FOLLOWERS` instead of `VIEWERS`, raise Min viewers / Min followers to cut the long tail, or diff scheduled snapshots on `collectedAt` to catch climbers.

**Is the data complete?**
It covers the top of the directory at collection time. Smaller categories below the snapshot cut-off are not included.

# Actor input Schema

## `maxCategories` (type: `integer`):

How many of the top categories to collect, in live-viewer order. Maximum 100 — each run returns a single snapshot of the directory.

## `minViewers` (type: `integer`):

Only keep categories with at least this many live viewers. Use 0 to keep everything. Handy for cutting the long tail and watching just the heavyweights.

## `minFollowers` (type: `integer`):

Only keep categories with at least this many total followers. Use 0 to keep everything. Combine with Min viewers to find categories that are both big and hot right now.

## `sortBy` (type: `string`):

Rank by live viewers (VIEWERS, the live directory order) or re-rank the snapshot by total followers (FOLLOWERS) — each choice returns a different top list.

## Actor input object example

```json
{
  "maxCategories": 50,
  "minViewers": 0,
  "minFollowers": 0,
  "sortBy": "VIEWERS"
}
```

# Actor output Schema

## `results` (type: `string`):

Every row this run produced.

## `runSummary` (type: `string`):

What this run collected, and anything it could not read.

# 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 = {
    "maxCategories": 50,
    "minViewers": 0,
    "minFollowers": 0,
    "sortBy": "VIEWERS"
};

// Run the Actor and wait for it to finish
const run = await client.actor("apt_marble/twitch-top-categories").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 = {
    "maxCategories": 50,
    "minViewers": 0,
    "minFollowers": 0,
    "sortBy": "VIEWERS",
}

# Run the Actor and wait for it to finish
run = client.actor("apt_marble/twitch-top-categories").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 '{
  "maxCategories": 50,
  "minViewers": 0,
  "minFollowers": 0,
  "sortBy": "VIEWERS"
}' |
apify call apt_marble/twitch-top-categories --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apt_marble/twitch-top-categories"
        }
    }
}
```

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/z5H1xrFhmpeZh9KtB/builds/Wzefs3U1tRZhctwNs/openapi.json
