# Twitch API by APISH (`apish/twitch-api`) Actor

Twitch live status, channels, followers, clips, VODs, schedules, teams and top streams as JSON, without a Twitch app or OAuth token, via APISH. Pay per credit; failed calls are free.

- **URL**: https://apify.com/apish/twitch-api.md
- **Developed by:** [APISH](https://apify.com/apish) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 credits

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 API by APISH

Get public Twitch data as clean, consistent JSON: twitch top categories, twitch category, twitch category clips, twitch category videos, twitch clip (with playable MP4), twitch clip transcript and more. 16 endpoints, one response shape, numbers parsed, absolute URLs.

### How to use

1. Pick an **Endpoint**. Each option shows what it returns and its price in credits.
2. Enter its **Parameters** as JSON, for example `{"handle":"shroud"}`. All parameters are listed below.
3. Run. Each call becomes one row in the dataset. Use **Batch** to run the same endpoint for many inputs and **Pages per input** to follow pagination.

### Pricing

Pay per event: you pay per APISH credit the call used. The price of each endpoint is in the table below. Calls that fail on our side (server errors, timeouts, blocks) are free.

### Endpoints

| Endpoint | Returns | Required parameters | Credits |
|---|---|---|---|
| `/twitch/v1/categories/top` | Twitch top categories | — | 1 |
| `/twitch/v1/category` | Twitch category | `slug` | 1 |
| `/twitch/v1/category/clips` | Twitch category clips | `slug` | 1 |
| `/twitch/v1/category/videos` | Twitch category videos | `slug` | 1 |
| `/twitch/v1/clip` | Twitch clip (with playable MP4) | `url` | 1 |
| `/twitch/v1/clip/transcript` | Twitch clip transcript | `url` | 1 |
| `/twitch/v1/profile` | Twitch channel | `handle` | 1 |
| `/twitch/v1/search` | Twitch search | `q` | 1 |
| `/twitch/v1/stream` | Twitch live status | `handle` | 1 |
| `/twitch/v1/streams/top` | Twitch top live streams | — | 1 |
| `/twitch/v1/team` | Twitch team and members | `name` | 1 |
| `/twitch/v1/user/clips` | Twitch channel clips | `handle` | 1 |
| `/twitch/v1/user/followers` | Twitch follower count | `username` | 1 |
| `/twitch/v1/user/schedule` | Twitch stream schedule | `handle` | 1 |
| `/twitch/v1/user/videos` | Twitch channel videos (VODs) | `handle` | 1 |
| `/twitch/v1/video` | Twitch video | `url` | 1 |

### Output

Each dataset row has `endpoint`, `params`, `status`, `credits_used` and the endpoint's data. Add `"raw": 1` to the parameters to also get the site's original record, or `"fields": "a,b.c"` to return only the fields you need.

### Endpoint details

#### Twitch top categories

Endpoint `/twitch/v1/categories/top` · 1 credit per successful call.

Categories by live viewers. Twitch serves logged-out visitors the first page only (its later pages are not public), so `limit` (up to 100) sets the size; `has_more` says whether Twitch has more.

Parameters:

- `limit`: 1-100 (default 30).

Example parameters: `{"limit":30}`

#### Twitch category

Endpoint `/twitch/v1/category` · 1 credit per successful call.

A category (game): viewers, followers, live channels, tags, and its live streams. Twitch serves logged-out visitors the first page only (its later pages are not public), so `limit` (up to 100) sets the size; `has_more` says whether Twitch has more.

Parameters:

- `slug` (required): Category slug (minecraft, just-chatting) or directory URL.
- `sort` — one of `viewers`, `viewers_asc`, `recent`, `relevance`: viewers (default), viewers_asc, recent or relevance.
- `language`: Stream language(s), comma separated (en, es, de...).
- `limit`: 1-100 (default 30).

Example parameters: `{"slug":"minecraft"}`

#### Twitch category clips

Endpoint `/twitch/v1/category/clips` · 1 credit per successful call.

Most viewed clips in a category for a period. Twitch serves logged-out visitors the first page only (its later pages are not public), so `limit` (up to 100) sets the size; `has_more` says whether Twitch has more.

Parameters:

- `slug` (required): Category slug.
- `period` — one of `last_day`, `last_week`, `last_month`, `all_time`: last_day, last_week (default), last_month or all_time.
- `language`: Clip language(s), comma separated.
- `limit`: 1-100 (default 30).

Example parameters: `{"slug":"minecraft"}`

#### Twitch category videos

Endpoint `/twitch/v1/category/videos` · 1 credit per successful call.

Videos in a category. Twitch serves logged-out visitors the first page only (its later pages are not public), so `limit` (up to 100) sets the size; `has_more` says whether Twitch has more.

Parameters:

- `slug` (required): Category slug.
- `type` — one of `all`, `archive`, `highlight`, `upload`, `past_premiere`: all (default), archive, highlight, upload or past_premiere.
- `sort` — one of `views`, `time`: views (default) or time.
- `language`: Video language(s), comma separated.
- `limit`: 1-100 (default 30).

Example parameters: `{"slug":"minecraft"}`

#### Twitch clip (with playable MP4)

Endpoint `/twitch/v1/clip` · 1 credit per successful call.

Parameters:

- `url` (required)

Example parameters: `{"url":"https://www.twitch.tv/shroud/clip/TangentialBillowingJalapenoYee-ccA2oB1pEYh4CHWJ"}`

#### Twitch clip transcript

Endpoint `/twitch/v1/clip/transcript` · 1 credit per successful call.

Every response includes `credits_used`: the credits this call cost.  Speech-to-text on the clip audio (Whisper).

Parameters:

- `url` (required)

Example parameters: `{"url":"https://www.twitch.tv/shroud/clip/TangentialBillowingJalapenoYee-ccA2oB1pEYh4CHWJ"}`

#### Twitch channel

Endpoint `/twitch/v1/profile` · 1 credit per successful call.

Also `team`, `chat_settings` (followers-only minutes, slow mode, emote-only, subscribers-only, verified-only, delay, rules), `badges` (the channel's subscriber and bits badges with images) and `emotes` (subscriber emotes with tier and image).

Parameters:

- `handle` (required)

Example parameters: `{"handle":"shroud"}`

#### Twitch search

Endpoint `/twitch/v1/search` · 1 credit per successful call.

Channels, categories and videos matching the text, plus related live channels. With type=channels, categories or videos, pass `next_cursor` back as `cursor` for more.

Parameters:

- `q` (required): Search text.
- `type` — one of `all`, `channels`, `categories`, `videos`: all (default), channels, categories or videos.
- `cursor`: Value of `next_cursor` from the previous page (type must not be all).

Example parameters: `{"q":"minecraft"}`

#### Twitch live status

Endpoint `/twitch/v1/stream` · 1 credit per successful call.

Is the channel live: title, viewers, game, tags, start time, thumbnail; otherwise the last broadcast.

Parameters:

- `handle` (required): Channel login or URL.

Example parameters: `{"handle":"kaicenat"}`

#### Twitch top live streams

Endpoint `/twitch/v1/streams/top` · 1 credit per successful call.

The most watched live streams right now. Twitch serves logged-out visitors the first page only (its later pages are not public), so `limit` (up to 100) sets the size; `has_more` says whether Twitch has more.

Parameters:

- `language`: Stream language(s), comma separated (en, es...).
- `limit`: 1-100 (default 30).

Example parameters: `{"limit":30}`

#### Twitch team and members

Endpoint `/twitch/v1/team` · 1 credit per successful call.

A Twitch team: name, description, logo, banner, owner, member and live counts, and its member channels (followers, partner or affiliate, live stream with viewers and game). live=true lists only members live now. Pass `next_cursor` back as `cursor`; null on the last page.

Parameters:

- `name` (required): Team name or twitch.tv/team link.
- `live`: true lists only members live now.
- `limit`: Members per page (max 100).
- `cursor`: Paging cursor from the previous page.

Example parameters: `{"name":"esl"}`

#### Twitch channel clips

Endpoint `/twitch/v1/user/clips` · 1 credit per successful call.

The channel's clips (up to 100) for a period. Twitch serves logged-out visitors the first page only (its later pages are not public), so `has_more` says whether Twitch has more.

Parameters:

- `handle` (required)
- `period`: last_day, last_week, last_month or all_time.
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"handle":"shroud","period":"all_time"}`

#### Twitch follower count

Endpoint `/twitch/v1/user/followers` · 1 credit per successful call.

A channel's follower count. Twitch no longer shows who follows a channel to logged-out visitors, so `followers_list` is empty unless Twitch makes it public again (`list_public`).

Parameters:

- `username` (required): Channel login or URL.

Example parameters: `{"username":"shroud"}`

#### Twitch stream schedule

Endpoint `/twitch/v1/user/schedule` · 1 credit per successful call.

Parameters:

- `handle` (required)

Example parameters: `{"handle":"shroud"}`

#### Twitch channel videos (VODs)

Endpoint `/twitch/v1/user/videos` · 1 credit per successful call.

Past broadcasts, highlights and uploads (up to 100). Twitch serves logged-out visitors the first page only (its later pages are not public), so `has_more` says whether Twitch has more.

Parameters:

- `handle` (required)
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"handle":"shroud"}`

#### Twitch video

Endpoint `/twitch/v1/video` · 1 credit per successful call.

A past broadcast/VOD: title, views, duration, dates, game, channel, tags, chapters and muted segments. With `chat_offset`, the replayed chat from that point.

Parameters:

- `url` (required): Video URL or id.
- `chat_offset`: Seconds into the video: adds `chat_replay` with the chat messages around that point (offset, time, commenter, text, emotes, badges) and `next_offset` for the next stretch.

Example parameters: `{"url":"https://www.twitch.tv/videos/2907766307"}`

### Support

Questions, bugs or a missing field? Open an issue in this Actor's Issues tab and we will reply there.

Public data only: nothing behind a login. You are responsible for how you use the data you collect.

# Actor input Schema

## `endpoint` (type: `string`):

Which Twitch endpoint to call. Each option shows what it returns and its price in credits.

## `params` (type: `object`):

Query parameters for the endpoint, as JSON. See the README for every endpoint's parameters. Example: {"handle":"shroud"}

## `batch` (type: `array`):

Run the same endpoint for many inputs: a list of parameter objects. Each item is one call. Leave empty to use Parameters.

## `maxPages` (type: `integer`):

For paginated endpoints: follow next_cursor up to this many pages per input. 1 = first page only.

## Actor input object example

```json
{
  "endpoint": "/twitch/v1/profile",
  "params": {
    "handle": "shroud"
  },
  "batch": [],
  "maxPages": 1
}
```

# Actor output Schema

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

One row per call: endpoint, params, status, credits_used and the data.

# 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 = {
    "endpoint": "/twitch/v1/profile",
    "params": {
        "handle": "shroud"
    },
    "batch": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("apish/twitch-api").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 = {
    "endpoint": "/twitch/v1/profile",
    "params": { "handle": "shroud" },
    "batch": [],
}

# Run the Actor and wait for it to finish
run = client.actor("apish/twitch-api").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 '{
  "endpoint": "/twitch/v1/profile",
  "params": {
    "handle": "shroud"
  },
  "batch": []
}' |
apify call apish/twitch-api --silent --output-dataset

```

## MCP server setup

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

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/dqhkajuaMKH2Ze4GF/builds/jk1Ca8Xsf8RCXEl5u/openapi.json
