X broadcast viewer history scraper skill for AI agents

Get a public X broadcast's title, state, start/end times, viewer counts over time, thumbnail, broadcaster profile, and an optional replay stream link, resolved from a broadcast link or ID.

What the skill does

It tells your agent when a request fits the X Broadcast Viewer History & Replay Link Scraper Actor, which input to send and which fields come back (title, state, broadcaster.username, viewers now and 4 more). The agent runs it through the Apify API with your token and gets JSON rows.

Skill files updated 2026-11-14.

Install by hand

Save the five files into a folder named x-broadcast-viewer-history-and-replay-link-scraper: ~/.claude/skills/x-broadcast-viewer-history-and-replay-link-scraper/ for Claude Code, ~/.agents/skills/x-broadcast-viewer-history-and-replay-link-scraper/ for Codex and most other agents.

The same five files as one download: x-broadcast-viewer-history-and-replay-link-scraper.zip (4.8 KB).

Run it

Ask your agent in plain words, for example "X broadcast viewer history scraper", and it picks the skill from its description. Or run the script yourself:

export APIFY_TOKEN=your_apify_token
cd x-broadcast-viewer-history-and-replay-link-scraper                             # the skill folder
node scripts/run.mjs                     # the example input
node scripts/run.mjs my-input.json       # your own input

Without an argument the script uses references/example-input.json. It waits for the run and prints the rows as JSON; for long runs SKILL.md shows the async API calls.

What it returns

Main fields the X broadcast viewer history scraper skill returns
FieldWhat it is
titleTitle
stateState
broadcaster.usernameBroadcaster.username
viewersNowViewers Now
viewersTotalViewers Total
startedAtStarted At
urlUrl

Read SKILL.md

Show the whole file (5.2 KB)
---
name: x-broadcast-viewer-history-and-replay-link-scraper
description: "Get a public X broadcast's title, state, start/end times, viewer counts over time, thumbnail, broadcaster profile, and an optional replay stream link, resolved from a broadcast link or ID. Output fields: title, state, broadcaster.username, viewersNow, viewersTotal and more, as JSON rows. Use it for requests like \"X broadcast viewer history scraper\", or a CSV/JSON export of public X data."
---

# X Broadcast Viewer History & Replay Link Scraper

Get a public X broadcast's title, state, start/end times, viewer counts over time, thumbnail, broadcaster profile, and an optional replay stream link, resolved from a broadcast link or ID.

- Actor: https://apify.com/dataspryva/x-broadcast-viewer-history-and-replay-link-scraper (ID `dataspryva~x-broadcast-viewer-history-and-replay-link-scraper`)
- n8n workflow for the same Actor: https://scraperfinder.com/n8n/x-broadcast-viewer-history-and-replay-link-scraper/
- Example input: `references/example-input.json`
- Input schema: `references/input-schema.json`
- Output fields: `references/output-fields.json`

## When to use

Use this skill when the user wants:

- X broadcast viewer history scraper
- a repeatable export of public X data as CSV or JSON

Do not use it for private, login-protected or paywalled data.

## What it returns

One JSON row per result. Columns from the Actor's dataset schema:

- `title`: Title
- `state`: State
- `broadcaster.username`: Broadcaster.username
- `viewersNow`: Viewers Now
- `viewersTotal`: Viewers Total
- `startedAt`: Started At
- `url`: Url

All 8 declared fields: `references/output-fields.json`.

## Inputs

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `broadcastIds` | array | yes |  | Paste broadcast links such as `https://x.com/i/broadcasts/1YGNrbPLejQGw,` bare broadcast IDs, post links that announce a broadcast, or legacy Periscope links (/v/ or //). |
| `includeViewerStats` | boolean | no | true | Include current/total viewers, the viewer-history graph when X exposes it, and derived peak/average viewers. Turn off for a lighter output. |
| `includeViewerTimeline` | boolean | no | false | Push one "viewer timeline point" row per point of the broadcast's viewer-history graph. No rows are emitted when X provides no graph. |
| `maxViewerTimelinePoints` | integer | no | 0 | Maximum timeline rows per broadcast. 0 means all points. When capped, points are evenly sampled across the full broadcast and each row keeps its original index. |
| `includeReplayVideo` | boolean | no | false | Resolve the HLS playback URL and stream status. For a live broadcast the URL is the live stream; for an ended broadcast it is the replay. |
| `includeChatHistory` | boolean | no | false | Collect text messages from the broadcast's public chat replay after it ends. Live chat and private chats are not collected. |
| `maxChatMessages` | integer | no | 1000 | Maximum public chat text messages per broadcast. Older events and join/heart events are not counted. |
| `includeThumbnail` | boolean | no | true | Store the broadcast cover image in the run's key-value store and return its stable URL plus the original X image URL. |
| `includeBroadcasterProfile` | boolean | no | true | Add the broadcaster's public profile (followers, bio, location, account creation date, pinned posts). Falls back to the compact broadcaster record if the profile is unavailable. |

Example (`references/example-input.json`):

```json
{
  "broadcastIds": [
    "https://x.com/i/broadcasts/1YGNrbPLejQGw"
  ],
  "maxChatMessages": 100
}
```

The input passes the Actor's input schema (checked at every publish). The run size follows the number of inputs you pass.

## Run it

Set `APIFY_TOKEN`, then call the synchronous endpoint for small and medium runs (it waits up to 300 seconds):

```bash
curl -s -X POST "https://api.apify.com/v2/acts/dataspryva~x-broadcast-viewer-history-and-replay-link-scraper/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d @references/example-input.json > output.json
```

Or with Node 18+: `node scripts/run.mjs [input.json]`.

For large runs, start an async run and read its dataset when it finishes:

```bash
RUN=$(curl -s -X POST "https://api.apify.com/v2/acts/dataspryva~x-broadcast-viewer-history-and-replay-link-scraper/runs" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d @references/example-input.json)
RUN_ID=$(echo "$RUN" | jq -r '.data.id'); DATASET=$(echo "$RUN" | jq -r '.data.defaultDatasetId')
curl -s "https://api.apify.com/v2/actor-runs/$RUN_ID?waitForFinish=60" -H "Authorization: Bearer $APIFY_TOKEN" | jq -r '.data.status'
curl -s "https://api.apify.com/v2/datasets/$DATASET/items?format=json" -H "Authorization: Bearer $APIFY_TOKEN" > output.json
```

## Cost and limits

- Apify bills the Actor's usage on your account; the Actor's Pricing tab shows the current price.
- Keep the limit in the input small for a first run.

## Guardrails

- Public data only. Do not pass cookies, sessions or private account data.
- Do not use the output for spam, harassment or unlawful discrimination.
- Check the target site's terms and local law before running at scale.

Questions people ask

Which agents can use this skill?

Any agent that reads Agent Skills folders: Claude Code, Codex, Cursor, Gemini CLI and the other agents the skills CLI installs into. The skill is a SKILL.md file plus a small Node script, so an agent without skill support can still follow the file by hand.

Does the skill cost anything?

The skill is free. Running it starts the X Broadcast Viewer History & Replay Link Scraper Actor on your own Apify account, which bills the run at the Actor's Store price; the Apify Free plan includes $5 of usage a month.

What does npx skills add install?

The whole folder: SKILL.md, scripts/run.mjs and the three reference files, downloaded from this site and checked against the SHA-256 digest in scraperfinder.com/.well-known/agent-skills/index.json. Add -g to install it for every project.

Skill updated 2026-11-14