# Twitch Categories Scraper 🎮 (`shahidirfan/twitch-categories-scraper`) Actor

Extract Twitch category data instantly. Scrape live streams, viewer counts, game categories, and trending content. Perfect for analytics, market research, and gaming insights. Automated, reliable, fast data collection.

- **URL**: https://apify.com/shahidirfan/twitch-categories-scraper.md
- **Developed by:** [Shahid Irfan](https://apify.com/shahidirfan) (community)
- **Categories:** Automation, Developer tools, Social media
- **Features:** Limited permissions
- **Stats:** 13 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.80 / 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

### What does Twitch Categories Scraper do?

Twitch Categories Scraper collects structured category data from the Twitch Directory. Enter the main directory URL or a public Twitch directory collection URL, choose how many unique categories you want, and receive records with category names, slugs, viewer counts, tags, artwork, and direct Twitch URLs.

The dataset is useful for Twitch market research, gaming trend analysis, creator planning, sponsorship research, category monitoring, and dashboards that need repeatable snapshots of Twitch demand.

### Why use Twitch Categories Scraper?

- **Find categories with active audiences** - Compare current `viewersCount` values across Twitch games, topics, and other directory categories.
- **Research niches before publishing content** - Use category names, tags, and viewer activity to identify areas worth testing.
- **Monitor changes over time** - Schedule recurring runs and compare datasets to see how category interest moves.
- **Start with a public Twitch URL** - Use the standard Twitch Directory or a directory collection as the run input.
- **Export ready-to-use datasets** - Download JSON, CSV, Excel, XML, and other formats supported by Apify.
- **Connect to your workflow** - Send completed runs to Google Sheets, webhooks, Make, Zapier, dashboards, or your own application through the Apify API.

### What data can you extract from Twitch Directory?

Each dataset item represents one Twitch category. Empty values are omitted when Twitch does not provide them for a category.

| Field | Type | Description |
|-------|------|-------------|
| `categoryId` | String | Twitch identifier for the category. |
| `slug` | String | URL-friendly category slug. |
| `name` | String | Public category display name. |
| `internalName` | String | Category name supplied by Twitch as an alternate name value. |
| `url` | String | Direct Twitch URL for the category. |
| `avatarUrl` | String | Category artwork or thumbnail URL when available. |
| `viewersCount` | Number | Current viewer count associated with the category. |
| `originalReleaseDate` | String | Original release date when Twitch provides it. |
| `tags` | Array | Content tags, including tag IDs and localized names when available. |
| `trackingId` | String | Optional source tracking value retained for record provenance. |
| `cursor` | String | Optional source cursor associated with the category record. |
| `source` | String | Identifies whether the item came from the Twitch directory or a collection. |
| `sourceUrl` | String | Twitch URL used for the run. |
| `collectionSlug` | String | Collection identifier when a collection URL was used. |
| `scrapedAt` | String | UTC timestamp showing when the record was saved. |

### How to scrape Twitch category data

1. Open Twitch Categories Scraper on Apify.
2. Enter `https://www.twitch.tv/directory`, or paste a public URL such as `https://www.twitch.tv/directory/collection/gaming-streams`.
3. Set `results_wanted` to the maximum number of unique category records to save.
4. Add an optional Apify Proxy configuration if your workflow requires one.
5. Start the run and review the dataset preview.
6. Download the results or connect the dataset to your next workflow.

The standard directory URL is the easiest starting point. Collection URLs are useful when you want to begin with categories grouped by a Twitch collection. If a collection contains fewer unique categories than requested, the run can add directory categories to help reach the requested result count.

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `startUrl` | String | No | `"https://www.twitch.tv/directory"` | Public Twitch Directory URL. Supports the main directory and `/directory/collection/{slug}` URLs. |
| `results_wanted` | Integer | No | `20` | Maximum number of unique category records to save. |
| `proxyConfiguration` | Object | No | Not set | Optional Apify Proxy settings, such as `useApifyProxy` and `apifyProxyGroups`. |

### Usage Examples

#### Basic Directory Extraction

Collect 20 categories from the default Twitch Directory.

```json
{
  "startUrl": "https://www.twitch.tv/directory",
  "results_wanted": 20
}
```

#### Twitch Collection Research

Start with a public Twitch collection and request a larger category dataset.

```json
{
  "startUrl": "https://www.twitch.tv/directory/collection/gaming-streams",
  "results_wanted": 80
}
```

#### Larger Scheduled Run with Proxy

Use an Apify residential proxy group for a recurring run that collects more records.

```json
{
  "startUrl": "https://www.twitch.tv/directory",
  "results_wanted": 120,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

### Sample Output

This example shows one category record from a standard Twitch Directory run.

```json
{
  "categoryId": "509658",
  "slug": "just-chatting",
  "name": "Just Chatting",
  "internalName": "Just Chatting",
  "url": "https://www.twitch.tv/directory/category/just-chatting",
  "avatarUrl": "https://static-cdn.jtvnw.net/ttv-boxart/509658-285x380.jpg",
  "viewersCount": 131692,
  "originalReleaseDate": "2011-09-27T00:00:00Z",
  "tags": [
    {
      "id": "2610cff9-10ae-4cb3-8500-778e6722fbb5",
      "localizedName": "IRL"
    }
  ],
  "trackingId": "a2c4fb59-fa29-4a00-b6de-954b6ae4756c",
  "cursor": "eyJzIjoxLCJkIjpmYWxzZSwidCI6dHJ1ZX0=",
  "source": "twitch_directory",
  "sourceUrl": "https://www.twitch.tv/directory",
  "scrapedAt": "2026-08-13T10:00:00.000Z"
}
```

Collection runs can also include `collectionSlug`, while `source` identifies the source type for each record.

### Tips for Best Results

- **Test with 20 records first** - Confirm the fields and workflow before increasing the requested volume.
- **Use a complete public URL** - Keep the Twitch hostname and directory path in the value of `startUrl`.
- **Use collection URLs for focused research** - A collection can give your run a more specific starting point than the general directory.
- **Schedule snapshots for trend analysis** - Viewer counts change, so recurring runs are better than a single snapshot for measuring movement.
- **Expect optional fields to vary** - Artwork, release dates, tags, tracking values, and collection values may be absent for some records.
- **Review the dataset before automation** - Check a small run before sending data to a dashboard, spreadsheet, or downstream service.

### Integrations and Export Formats

- **Google Sheets** - Maintain a category tracker and compare scheduled snapshots.
- **Airtable** - Store searchable category records with viewer and tag fields.
- **Webhooks** - Notify another service when a run completes.
- **Make or Zapier** - Trigger alerts, reports, or follow-up tasks from new datasets.
- **Apify API** - Start runs and retrieve dataset items from your own application.
- **JSON, CSV, Excel, and XML** - Export the data for code, spreadsheet, reporting, and integration workflows.

### Frequently Asked Questions

#### What Twitch URLs can I use?

You can use the main Twitch Directory URL or a public directory collection URL such as `https://www.twitch.tv/directory/collection/gaming-streams`. The default input is the main directory.

#### How many categories can I collect?

You can set `results_wanted` to the maximum number of unique category records you want saved. Start with a smaller value for testing, then increase it for research or scheduled collection.

#### Does the Actor include viewer counts?

Yes. Each category normally includes `viewersCount`, which represents the viewer count available when that record is collected. Viewer numbers can change between runs.

#### Does a collection URL limit the output to that collection?

No. The run starts with the collection when possible, then can add directory categories if the collection does not provide enough unique records for the requested amount.

#### Why is a field missing from a record?

A field can be missing when Twitch does not publish that value for the category or source. Empty values are removed from the dataset to keep records clean.

#### Can I schedule Twitch category monitoring?

Yes. Create an Apify schedule to run the Actor hourly, daily, weekly, or at another interval, then compare the resulting datasets over time.

#### Can I export the results to CSV or Excel?

Yes. Apify datasets can be downloaded as CSV, Excel, JSON, XML, and other supported formats.

#### Is collecting Twitch category data legal?

You are responsible for complying with Twitch terms, applicable laws, privacy requirements, and any restrictions that apply to your intended use. Collect and use public data responsibly.

### Related Actors

For broader audience and gaming research around Twitch categories, these Shahid Irfan Actors may also be useful:

- [YouTube Comments Scraper](https://apify.com/shahidirfan/youtube-comments-scraper) - Collect comments and engagement signals from gaming or creator videos.
- [Reddit Community Scraper](https://apify.com/shahidirfan/reddit-community-scraper) - Research communities and discussions related to games, creators, and streaming topics.
- [Instagram Post Comments Scraper](https://apify.com/shahidirfan/instagram-post-comments-scraper) - Analyze audience discussion and engagement around creator or gaming content.

### Support

For issues, feature requests, or custom data requirements, use the Issues tab on the Actor page or contact the developer through Apify.

### Legal Notice

This Actor is intended for legitimate collection of publicly available Twitch category data. Users are responsible for complying with Twitch terms of service, applicable laws, privacy rules, and third-party intellectual property rights.

# Actor input Schema

## `startUrl` (type: `string`):

Twitch directory URL to scrape (supports /directory and /directory/collection/{slug}).

## `results_wanted` (type: `integer`):

Maximum number of categories to collect.

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

Optional proxy configuration.

## Actor input object example

```json
{
  "startUrl": "https://www.twitch.tv/directory",
  "results_wanted": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (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 = {
    "startUrl": "https://www.twitch.tv/directory",
    "results_wanted": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("shahidirfan/twitch-categories-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 = {
    "startUrl": "https://www.twitch.tv/directory",
    "results_wanted": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("shahidirfan/twitch-categories-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 '{
  "startUrl": "https://www.twitch.tv/directory",
  "results_wanted": 20
}' |
apify call shahidirfan/twitch-categories-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,shahidirfan/twitch-categories-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/8CSShYH5KFvrB3rea/builds/wXxKvGoSZMpoaFyHG/openapi.json
