# YouTube Live Chat Scraper (`parsebird/youtube-live-chat-scraper`) Actor

Extract YouTube live chat messages, Super Chats, Super Stickers, and membership events from live or replayed streams. Export by video URL or channel.

- **URL**: https://apify.com/parsebird/youtube-live-chat-scraper.md
- **Developed by:** [ParseBird](https://apify.com/parsebird) (community)
- **Categories:** Videos, Automation, Integrations
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 chats

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### YouTube Live Chat Scraper

Scrape [YouTube](https://www.youtube.com) live chat — messages, Super Chats, Super Stickers, membership events, and moderation actions — from a video that's airing right now or from the chat replay of a stream that already ended. Point it at one video, a list of videos, or an entire channel.

<table><tr>
<td style="border-left:4px solid #FF0000;padding:12px 16px;font-weight:600">
Pulls every chat event type YouTube exposes — normal messages, Super Chats with real dollar amounts, Super Stickers, membership joins/renewals/gifts, and moderation/system notices — with replay-position timestamps, author badges, and emoji preserved as structured runs.
</td>
</tr></table>

##### Copy to your AI assistant

Copy this block into ChatGPT, Claude, Cursor, or any LLM to start using this Actor.

```
YouTube Live Chat Scraper (parsebird/youtube-live-chat-scraper) — Scrapes YouTube live chat, Super Chats, Super Stickers, and membership events from a video's live chat or chat replay. Input: {"videoRefs": ["https://www.youtube.com/watch?v=VIDEO_ID"], "mode": "replay", "maxMessagesPerVideo": 5000}. Key inputs: videoRefs (array of watch URLs / youtu.be URLs / bare 11-char video IDs), channelRefs (array of @handle / channel URL / UC... ID — the Actor finds the streams), mode ("replay" | "live", default "replay"), channelDiscoveryMode ("current_live_then_replays" | "latest_replays_only"), maxVideosPerChannel (integer, default 5), lookbackDays (integer, default 30, 0 = no limit), maxMessagesPerVideo (integer, default 5000, 0 = entire replay), maxTotalItems (integer, default 0 = no limit), maxTimePerVideoSecs (integer, default 600), includeNormalMessages/includeSuperChats/includeMembershipEvents/includeModerationEvents (booleans, default true). Output per chat event: stream context (videoId, videoUrl, videoTitle, channelId, channelTitle, streamStatus, streamStartedAt, streamEndedAt), event fields (eventType: message/super_chat/super_sticker/membership/moderation/system/error, messageId, seq, publishedAt, videoOffsetMsec, videoOffsetText), author fields (authorChannelId, authorName, authorHandle, authorBadges, isOwner/isModerator/isMember/isVerified), content (messageText, messageParts), monetization (superChatAmount, superChatAmountValue, superChatCurrency, membershipLevel). API: POST https://api.apify.com/v2/acts/parsebird~youtube-live-chat-scraper/runs?token=YOUR_TOKEN. Get token: https://console.apify.com/account#/integrations
```

### What does YouTube Live Chat Scraper do?

**YouTube Live Chat Scraper** turns a stream's live chat into structured, spreadsheet-ready data. Give it a video or a channel and it:

- 💬 Captures every chat event type — normal messages, Super Chats, Super Stickers, membership joins/renewals/gifted memberships, and moderation/system notices
- 🔴 Works on **live** chat (a stream airing right now) or **chat replay** (an ended stream), auto-detecting the actual video status regardless of which mode you pick
- 📺 Accepts watch URLs, `youtu.be` short links, `/live/` URLs, or bare 11-character video IDs — or skip video URLs entirely and hand it a channel `@handle`
- 🔎 Discovers streams from a channel automatically — grab whatever's currently live, then fall back to recent replays, or pull only recent replays
- 💰 Parses Super Chat and Super Sticker amounts into a real numeric value and currency code, so you can `SUM()` revenue directly in Sheets or Excel
- ⏱️ Preserves **replay position** — `videoOffsetMsec` / `videoOffsetText` tell you exactly where in the recording each message appeared
- 🎭 Keeps emoji and custom channel emotes as structured runs with their image URLs, instead of flattening everything to plain text
- 🏷️ Flags owner, moderator, member, and verified authors as filterable booleans, not just badge arrays you can't filter in Sheets
- 🛑 Hard spending controls — per-video message caps, a whole-run item ceiling, and a per-video time limit so one stuck video can't run away with your budget
- 🚫 No YouTube Data API key, no OAuth login, no browser — reads the same public data youtube.com itself loads
- 🌐 Routes requests through [Apify Residential Proxy](https://apify.com/proxy) by default, since YouTube serves an incomplete page to some datacenter IP ranges
- ⚡ Runs on lightweight infrastructure (128–512 MB) — fast and cost-efficient

YouTube Live Chat Scraper reads the same public live-chat continuation feed the youtube.com web player uses, so message counts, Super Chat amounts, and badges match exactly what viewers saw live.

### What data can you extract from YouTube live chat?

| Field | Description |
|-------|-------------|
| `eventType` | `message`, `super_chat`, `super_sticker`, `membership`, `moderation`, `system`, or `error` |
| `videoId` / `videoTitle` / `channelTitle` | Which stream and channel the event belongs to |
| `streamStatus` | `live`, `replay`, `ended`, or `unknown` |
| `publishedAt` | Wall-clock time the message was posted |
| `videoOffsetMsec` / `videoOffsetText` | How far into the recording the message appeared (replay only), e.g. `"1:23:45"` |
| `authorName` / `authorHandle` / `authorChannelId` | Who posted it |
| `authorBadges` / `isOwner` / `isModerator` / `isMember` / `isVerified` | Author badges as a filterable array **and** individual booleans |
| `messageText` / `messageParts` | Plain text and structured runs (text + emoji, with emote image URLs) |
| `superChatAmount` / `superChatAmountValue` / `superChatCurrency` | Super Chat/Sticker amount as shown, as a number, and its currency code |
| `membershipLevel` | Membership tier, when YouTube exposes it |
| `moderationAction` | e.g. `DELETED`, `AUTHOR_BANNED` |

That's 12 of 40+ output fields. See the [output example](#output-example) below and the [dataset views](#dataset-views) for the complete list — including channel-discovery metadata (`discoverySource`, `channelRef`, `discoveredAt`) so a multi-channel export is traceable back to its source.

### How to scrape YouTube live chat with YouTube Live Chat Scraper

1. Open [YouTube Live Chat Scraper](https://apify.com/parsebird/youtube-live-chat-scraper) on Apify
2. Paste one or more **Video URLs or IDs** (watch URL, `youtu.be` link, or bare video ID) — or add a **Channel** `@handle` and let the Actor find the streams
3. Choose **Mode**: `replay` for a stream that already ended, `live` for one airing right now
4. If you used a channel, pick a **Channel discovery mode** — current live + recent replays, or latest replays only
5. Set **Max messages per video** and **Max total items** to control cost, or leave `maxMessagesPerVideo` at `0` to pull an entire replay
6. Toggle **Event filters** off for any event type you don't need — a Super-Chats-only export skips the (usually much larger) volume of normal messages
7. Click **Start** and wait for the run to finish
8. Export your data as **JSON, CSV, or Excel** from the dataset tab, or pull it via the [Apify API](https://docs.apify.com/api/v2)

**Quick start — a single replay:**

```json
{
    "videoRefs": ["https://www.youtube.com/watch?v=BZ_UzbpMjMg"],
    "mode": "replay",
    "maxMessagesPerVideo": 5000
}
```

**Super Chats only — cheapest monetization export:**

Turn off normal messages and you're charged only for the paid events, not the thousands of ordinary messages scraped alongside them.

```json
{
    "videoRefs": ["https://www.youtube.com/watch?v=BZ_UzbpMjMg"],
    "mode": "replay",
    "includeNormalMessages": false,
    "includeSuperChats": true,
    "includeMembershipEvents": true,
    "maxMessagesPerVideo": 0
}
```

**Track a whole channel, with a hard spend ceiling:**

```json
{
    "channelRefs": ["@LofiGirl"],
    "channelDiscoveryMode": "current_live_then_replays",
    "maxVideosPerChannel": 5,
    "lookbackDays": 30,
    "mode": "replay",
    "maxTotalItems": 5000
}
```

💡 Match the discovery mode to the channel: `current_live_then_replays` suits channels that are often live; use `latest_replays_only` for channels whose streams have ended.

### Input parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `videoRefs` | array | No\* | `[]` | Watch URLs, short URLs, or bare 11-character video IDs |
| `channelRefs` | array | No\* | `[]` | Channel `@handle`, channel URL, or `UC…` ID — the Actor finds the streams |
| `mode` | string | No | `replay` | `replay` (ended streams) or `live` (airing now) |
| `channelDiscoveryMode` | string | No | `current_live_then_replays` | `current_live_then_replays` or `latest_replays_only` |
| `maxVideosPerChannel` | integer | No | 5 | Max streams to pull per channel in `channelRefs` |
| `lookbackDays` | integer | No | 30 | Only consider channel streams from the last N days. `0` = no limit |
| `maxMessagesPerVideo` | integer | No | 5000 | Per-video cap on chat events. `0` = the entire chat replay |
| `maxTotalItems` | integer | No | 0 | Hard ceiling for the whole run. `0` = no limit |
| `maxTimePerVideoSecs` | integer | No | 600 | Give up on one video after this long |
| `includeNormalMessages` | boolean | No | `true` | Turn off for a monetization-only export |
| `includeSuperChats` | boolean | No | `true` | Super Chats and Super Stickers, with amounts |
| `includeMembershipEvents` | boolean | No | `true` | Joins, renewals, and gifted memberships |
| `includeModerationEvents` | boolean | No | `true` | Deletions, bans, auto-mod, and system notices |

\*At least one of `videoRefs` or `channelRefs` is required.

### Output example

One dataset row per chat event — flat and spreadsheet-safe. A real Super Chat captured from a replay run:

```json
{
    "videoId": "BZ_UzbpMjMg",
    "videoTitle": "Crypto Cypher Live Stream...3/9/26...Bear Market wk 23...Weekend Trap...",
    "channelTitle": "Crypto Cypher",
    "streamStatus": "replay",
    "eventType": "super_chat",
    "seq": 554,
    "publishedAt": "2026-03-10T00:16:17.553Z",
    "videoOffsetMsec": 7819483,
    "videoOffsetText": "2:10:19",
    "authorName": "@matiss6895",
    "authorHandle": "@matiss6895",
    "authorBadges": ["MEMBER"],
    "isMember": true,
    "messageText": "d bloc!!!! when florida meet up?",
    "superChatAmount": "$5.00",
    "superChatAmountValue": 5,
    "superChatCurrency": "USD",
    "discoverySource": "direct_videoRef"
}
```

`videoOffsetText: "2:10:19"` means you can jump straight to that timestamp in the video to see the moment it was sent. `superChatAmountValue: 5` is a number, not a string — sum a column of these directly in Sheets or Excel.

#### Dataset views

The dataset ships with three ready-made table views, switchable in the Apify Console or via the API:

- **Chat Events** — the everyday view: who said what, when, and how far into the stream
- **Super Chats & Memberships** — a monetization view with numeric amounts, currencies, and membership tiers
- **All Fields** — every column, including channel-discovery metadata

### Use cases

- **Community management** — Pull the full chat log of a stream for moderation review or highlight-clipping
- **Revenue tracking** — Sum Super Chat and Super Sticker income across one stream or a whole channel's recent VODs
- **Sentiment & audience research** — Analyze what viewers said, when, and how membership status correlates with engagement
- **Membership analytics** — Track new-member and gifted-membership events across streams
- **Archival** — Preserve chat history before a stream's replay chat becomes unavailable
- **Highlight generation** — Match Super Chat spikes and message bursts to `videoOffsetMsec` to find a stream's biggest moments
- **Live dashboards** — Poll a currently-live video's chat on a schedule to feed a live overlay or alert system

### How much does it cost to scrape YouTube live chat?

YouTube Live Chat Scraper uses [pay-per-event pricing](https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event) — you're charged per chat event returned to the dataset, not for compute time.

| Event | Price per event | Price per 1,000 |
|-------|-----------------|------------------|
| `chat-event` (Free plan) | $0.0009 | **$0.90** |
| `chat-event` (Bronze/Silver/Gold plans) | $0.0008 | **$0.80** |

An event fires once per row pushed to the dataset — messages, Super Chats, Super Stickers, memberships, moderation, and system events. `error` rows and messages you've filtered out with the `include...` toggles are never charged.

**Cost examples (paid plans):**

| Scenario | Events | Cost |
|----------|--------|------|
| Super-Chats-only export of one stream | 200 | $0.16 |
| Default per-video cap (5,000 messages) | 5,000 | $4.00 |
| Full replay of a long stream | 20,000 | $16.00 |

The [Apify Free plan](https://apify.com/pricing) includes $5/month in platform credits — enough for roughly 5,500 chat events at the free-tier rate, no credit card required.

The Actor runs through [Apify Residential Proxy](https://apify.com/proxy) by default for reliable results, which is billed separately from PPE against your Apify plan's proxy allowance. You can switch to a different proxy group or turn it off in the **Proxy** input section, though results may be incomplete without it.

### Integrations and API access

Use YouTube Live Chat Scraper programmatically via the [Apify API](https://docs.apify.com/api/v2), the [JavaScript client](https://docs.apify.com/api/client/js), or the [Python client](https://docs.apify.com/api/client/python).

**Python:**

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("parsebird/youtube-live-chat-scraper").call(run_input={
    "videoRefs": ["https://www.youtube.com/watch?v=BZ_UzbpMjMg"],
    "mode": "replay",
    "maxMessagesPerVideo": 5000,
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["eventType"], item.get("authorName"), item.get("messageText"))
```

**JavaScript:**

```javascript
import { ApifyClient } from "apify-client";

const client = new ApifyClient({ token: "YOUR_API_TOKEN" });

const run = await client.actor("parsebird/youtube-live-chat-scraper").call({
    videoRefs: ["https://www.youtube.com/watch?v=BZ_UzbpMjMg"],
    mode: "replay",
    maxMessagesPerVideo: 5000,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => console.log(item.eventType, item.authorName, item.messageText));
```

You can also connect YouTube Live Chat Scraper to [Google Sheets](https://apify.com/integrations/google-sheets), [Slack](https://apify.com/integrations/slack), [Zapier](https://apify.com/integrations/zapier), [Make](https://apify.com/integrations/make), and other platforms via [Apify integrations](https://apify.com/integrations). Schedule runs with [Apify Schedules](https://docs.apify.com/platform/schedules) to poll a live channel's chat repeatedly, or connect it to any LLM agent through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp).

### Is it legal to scrape YouTube live chat?

Scraping publicly available data is generally considered legal, based on the [2022 US appeals court ruling](https://blog.apify.com/is-web-scraping-legal/) in *hiQ Labs v. LinkedIn*. This Actor only reads the same public live-chat feed the youtube.com web player itself loads — it does not log in, bypass authentication, or access private chats or members-only content you aren't already entitled to see.

Always review [YouTube's Terms of Service](https://www.youtube.com/t/terms) and comply with applicable laws in your jurisdiction. For guidance, see [Apify's guide to web scraping legality](https://blog.apify.com/is-web-scraping-legal/).

### Other YouTube scrapers by ParseBird

- [YouTube Search Scraper](https://apify.com/parsebird/youtube-search-scraper) — Scrape YouTube search results for videos, channels, playlists, and shorts
- [YouTube Channel Search Scraper](https://apify.com/parsebird/youtube-channel-search-scraper) — Find YouTube channels by keyword, niche, or product and get full channel profiles
- [YouTube Thumbnail Downloader](https://apify.com/parsebird/youtube-thumbnail-downloader) — Download YouTube video thumbnails in bulk, with automatic quality fallback

### FAQ

**Does this work on a stream that's live right now?**
Yes. Set `mode` to `live`, or just point `channelRefs` at a channel — with `channelDiscoveryMode: "current_live_then_replays"` the Actor detects the channel's currently-live video automatically. The Actor always confirms a video's real status from YouTube before polling, so it adapts even if `mode` doesn't match reality.

**What happens if a video has no live chat replay?**
The Actor pushes a single `error` row explaining why (e.g. chat replay wasn't enabled, or it's not a livestream at all) and moves on to the next video. `error` rows are never charged.

**How is a Super Chat's dollar amount parsed?**
`superChatAmountValue` is a numeric value derived from the amount YouTube displays (e.g. `"$5.00"` → `5`), with `superChatCurrency` holding the ISO-style currency code. Sum `superChatAmountValue` directly — don't parse `superChatAmount` yourself.

**Can I export just monetization events?**
Yes — turn off `includeNormalMessages` and leave `includeSuperChats` / `includeMembershipEvents` on. You're then charged only for the paid and membership events, which are typically a small fraction of total chat volume.

**Why are some fields `null`?**
`system` rows are YouTube's own notices (e.g. "Live chat replay is on") — they have no author, so author fields are legitimately empty. Similarly, `discoverySource`, `channelRef`, `discoveredAt`, `isDiscoveredLive`, and `isDiscoveredUpcoming` are only populated for videos found via `channelRefs`; for videos passed directly in `videoRefs`, `discoverySource` is `direct_videoRef` and those four are `null`. That's expected, not missing data.

**Why does this use Apify Proxy? I thought it didn't need a browser or API key.**
It doesn't — but YouTube serves a stripped-down watch page missing the video title, channel info, and stream timestamps to some datacenter IP ranges. Residential proxy avoids that, so `videoTitle`, `channelId`, and related fields come back populated. Chat messages themselves still scrape fine without it.

**Does this need a YouTube Data API key?**
No. It reads the same public live-chat continuation feed the youtube.com web player loads for any viewer — no API key, no OAuth login, and no Data API quota.

**Can I schedule recurring runs?**
Yes. Use [Apify's scheduling feature](https://docs.apify.com/platform/schedules) to poll a channel's live chat on an interval, or to pull replay chat from new streams as they're published.

**Can I use this with my AI assistant or MCP server?**
Yes. Copy the AI assistant block from the top of this page into ChatGPT, Claude, or Cursor, or connect it to any agent framework through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp).

**Something isn't working. How do I get help?**
Open an issue in the [Issues tab](https://apify.com/parsebird/youtube-live-chat-scraper/issues) on the Actor page. Include your input configuration and any error messages.

# Actor input Schema

## `videoRefs` (type: `array`):

Watch URLs, short youtu.be URLs, /live/ URLs, or bare 11-character video IDs.

## `channelRefs` (type: `array`):

Channel @handle, full channel URL, or UC… channel ID. The Actor finds the streams for you.

## `mode` (type: `string`):

Scrape an ended stream's chat replay, or an airing-now live chat.

## `channelDiscoveryMode` (type: `string`):

Match this to the channel: 'Current live, then replays' suits channels that are often live; use 'Latest replays only' for channels whose streams have ended.

## `maxVideosPerChannel` (type: `integer`):

Maximum number of streams to pull from each channel in 'Channels'.

## `lookbackDays` (type: `integer`):

Only consider streams from the last N days. 0 = no limit.

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

Per-video cap on chat events. 0 = the entire chat replay.

## `maxTotalItems` (type: `integer`):

Hard ceiling on chat events for the whole run, across every video. 0 = no limit.

## `maxTimePerVideoSecs` (type: `integer`):

Give up on one video's chat after this many seconds and move to the next.

## `includeNormalMessages` (type: `boolean`):

Turn off for a monetization-only export.

## `includeSuperChats` (type: `boolean`):

Super Chats and Super Stickers, with amounts.

## `includeMembershipEvents` (type: `boolean`):

Joins, renewals, and gifted memberships.

## `includeModerationEvents` (type: `boolean`):

Deletions, bans, auto-mod, and system notices.

## `proxy` (type: `object`):

Leave this on Residential for the most reliable results.

## Actor input object example

```json
{
  "videoRefs": [
    "https://www.youtube.com/watch?v=EAdh6m3E3UI"
  ],
  "channelRefs": [],
  "mode": "replay",
  "channelDiscoveryMode": "current_live_then_replays",
  "maxVideosPerChannel": 1,
  "lookbackDays": 30,
  "maxMessagesPerVideo": 50,
  "maxTotalItems": 50,
  "maxTimePerVideoSecs": 120,
  "includeNormalMessages": true,
  "includeSuperChats": true,
  "includeMembershipEvents": true,
  "includeModerationEvents": true,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "videoRefs": [
        "https://www.youtube.com/watch?v=EAdh6m3E3UI"
    ],
    "channelRefs": [],
    "mode": "replay",
    "channelDiscoveryMode": "current_live_then_replays",
    "maxVideosPerChannel": 1,
    "lookbackDays": 30,
    "maxMessagesPerVideo": 50,
    "maxTotalItems": 50,
    "maxTimePerVideoSecs": 120,
    "includeNormalMessages": true,
    "includeSuperChats": true,
    "includeMembershipEvents": true,
    "includeModerationEvents": true,
    "proxy": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("parsebird/youtube-live-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 = {
    "videoRefs": ["https://www.youtube.com/watch?v=EAdh6m3E3UI"],
    "channelRefs": [],
    "mode": "replay",
    "channelDiscoveryMode": "current_live_then_replays",
    "maxVideosPerChannel": 1,
    "lookbackDays": 30,
    "maxMessagesPerVideo": 50,
    "maxTotalItems": 50,
    "maxTimePerVideoSecs": 120,
    "includeNormalMessages": True,
    "includeSuperChats": True,
    "includeMembershipEvents": True,
    "includeModerationEvents": True,
    "proxy": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("parsebird/youtube-live-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 '{
  "videoRefs": [
    "https://www.youtube.com/watch?v=EAdh6m3E3UI"
  ],
  "channelRefs": [],
  "mode": "replay",
  "channelDiscoveryMode": "current_live_then_replays",
  "maxVideosPerChannel": 1,
  "lookbackDays": 30,
  "maxMessagesPerVideo": 50,
  "maxTotalItems": 50,
  "maxTimePerVideoSecs": 120,
  "includeNormalMessages": true,
  "includeSuperChats": true,
  "includeMembershipEvents": true,
  "includeModerationEvents": true,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call parsebird/youtube-live-chat-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parsebird/youtube-live-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/Qv1b9v5HSRAIHgTCQ/builds/f94HsHdQdebppPtds/openapi.json
