# Twitch VOD Chat Scraper (`romy/twitch-vod-chat-scraper`) Actor

Archive full Twitch VOD chat replay: commenter, message, emotes, badges, color and timestamp. No login needed.

- **URL**: https://apify.com/romy/twitch-vod-chat-scraper.md
- **Developed by:** [Romy](https://apify.com/romy) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.31 / 1,000 vod chat messages

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

## Twitch VOD Chat Scraper

Archive a Twitch VOD's full chat replay: commenter, message text, emotes,
badges, name color and timestamp. Wraps Twitch's own public web GraphQL API
(`gql.twitch.tv`) — no account, login, app or device needed.

### Why

Most of Twitch's list endpoints (streams, videos, clips) are capped at one
page: cursor pagination requires a device-attestation token this API can't
obtain. VOD chat replay is the exception — the real Twitch video player
walks it by seeking to a timestamp (`contentOffsetSeconds`), not by cursor,
so this actor can walk an entire VOD's chat log from start to finish, not
just a first page. Verified end-to-end across a 5.5-hour VOD.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `videoIds` | `string[]` | — | Twitch VOD ids (digits only). Either this or `logins` is required. |
| `logins` | `string[]` | — | Channel logins; auto-resolves to each one's most recent VOD(s) instead of listing ids by hand. |
| `videosPerLogin` | `integer` | `1` | How many of each login's most recent VODs to archive (only with `logins`). |
| `maxMessagesPerVideo` | `integer` | `2000` | Stop archiving a VOD's chat after this many messages. |
| `startSeconds` | `integer` | `0` | Second into the VOD to start from. |

### Output

One dataset row per chat message: `videoId`, `lengthSeconds`, `offsetSeconds`,
`createdAt`, `commenter` (public Twitch username), `color`, `fragments`
(message text + emote references), `badges`.

### Pricing

Researched against live competitors in this niche (2026-09-22):
`devilscrapes/twitch-vod-chat-archive` at ~$0.001/message. Priced
competitively using this account's standard tiered ladder
(FREE/BRONZE/SILVER/GOLD/PLATINUM/DIAMOND = 100/92/85/78/72/68%):
`vod-chat-message` at $0.0004 (FREE tier).

### Known limitations

- Commenter usernames are Twitch's own public data (same as shown in the
  live chat/VOD player), not extra PII.
- A single VOD's chat archiving stops if the account's spending limit is
  reached mid-run; already-archived messages are kept.

### Getting started

```bash
apify run
```

# Actor input Schema

## `videoIds` (type: `array`):

Twitch video/VOD ids (digits only, e.g. from a twitch.tv/videos/<id> URL). Either this or logins is required.

## `logins` (type: `array`):

Twitch channel logins to auto-resolve to their most recent VOD(s) (see videosPerLogin), instead of listing videoIds by hand. Either this or videoIds is required.

## `videosPerLogin` (type: `integer`):

How many of each login's most recent VODs to archive (only used when logins is set).

## `maxMessagesPerVideo` (type: `integer`):

Stop archiving a VOD's chat after this many messages.

## `startSeconds` (type: `integer`):

Second into the VOD to start archiving chat from (0 = the beginning).

## Actor input object example

```json
{
  "videoIds": [
    "2881171241"
  ],
  "videosPerLogin": 1,
  "maxMessagesPerVideo": 2000,
  "startSeconds": 0
}
```

# Actor output Schema

## `dataset` (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 = {
    "videoIds": [
        "2881171241"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("romy/twitch-vod-chat-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 = { "videoIds": ["2881171241"] }

# Run the Actor and wait for it to finish
run = client.actor("romy/twitch-vod-chat-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 '{
  "videoIds": [
    "2881171241"
  ]
}' |
apify call romy/twitch-vod-chat-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,romy/twitch-vod-chat-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/y5KLG4cJ0BwgO0iT0/builds/LbBLuzLDc3CudLiQu/openapi.json
