Chat Streaks · v1

Streaks API

Every tracked channel’s streaks as JSON for overlays and scripts, or as one line of text for Nightbot, StreamElements, Fossabot and Streamer.bot. Free, no sign-up for public reads.

Base URL https://www.hxs01.net/api/streaks/v1/{channel}

Quick start

A !streak command (replace hxs01 with your channel; your dashboard’s API section has these pre-filled):

Nightbot

!commands add !streak $(urlfetch https://www.hxs01.net/api/streaks/v1/hxs01/cmd?user=$(user)&target=$(touser))

StreamElements

!cmd add !streak ${customapi.https://www.hxs01.net/api/streaks/v1/hxs01/cmd?user=${user}&target=${touser}}

Fossabot (command response)

$(customapi https://www.hxs01.net/api/streaks/v1/hxs01/cmd?user=$(user)&target=$(touser))

Streamer.bot

  1. Action with a Command trigger !streak.
  2. Sub-action Core → Network → Fetch URL: https://www.hxs01.net/api/streaks/v1/hxs01/cmd?user=%userName%&target=%input0%, Variable Name streakReply.
  3. Sub-action Twitch → Chat → Send Message to Channel: %streakReply%.

Reply: @Viewer123 🔥 12 stream streak (best 30) · rank #4 · Blaze. With !streak @someone it answers for that viewer.

Chatbot variables (fetch URL)

For bots that fetch a URL and use the answer: every value on its own, raw. Names are camelCase and the same in JSON and text.

URLAnswers
/u/{login}All viewer variables: flat JSON, 2-space indent, fixed key order (easy to read in a browser, and every key is top-level for “Parse as JSON”).
/u/{login}/{variable}Only that value, text/plain: no quotes, no JSON, no newline, e.g. 12.
/u/{login}?var=streakSame as above.
/u/{login}?vars=streak,highest,flameName&sep=|Several values joined by sep (default one space, up to 10 characters, up to 40 variables): 12|30|Blaze.
/c, /c/{variable}Channel variables, the same ways.
  • Unknown viewer: still 200: numbers 0, booleans false, strings empty, exists = false (user and login echo the name asked for). Blocked and ignored viewers look unknown.
  • Unknown variable: 404 with unknown variable: x; with format=json the error also lists every valid name.
  • Booleans are true / false; add bool=1 for 1 / 0 (in JSON too).
  • Names: login or display name, any case, a leading @ is dropped, URL-encoded and Arabic names work.
  • Same rules as the rest of the API: CORS open, cached at the edge about 15 s, 60 requests a minute per IP, and the channel’s public / key setting.

Examples

https://www.hxs01.net/api/streaks/v1/hxs01/u/viewer123
https://www.hxs01.net/api/streaks/v1/hxs01/u/viewer123/streak
https://www.hxs01.net/api/streaks/v1/hxs01/u/@Viewer123?vars=streak,highest,flameName&sep=%7C
https://www.hxs01.net/api/streaks/v1/hxs01/u/%D9%85%D8%AD%D9%85%D8%AF/messages
https://www.hxs01.net/api/streaks/v1/hxs01/u/viewer123/maxFlame?bool=1
https://www.hxs01.net/api/streaks/v1/hxs01/c/top1User
{
  "exists": true,
  "user": "محمد",
  "login": "mohammed",
  "userId": "123456789",
  "avatar": "https://static-cdn.jtvnw.net/…",
  "channel": "HXS01",
  "link": "https://www.hxs01.net/streaks/hxs01",
  "live": true,
  "streak": 12,
  "highest": 30,
  "pending": false,
  "countedToday": true,
  "flame": 3,
  "flamePhase": 10,
  "flameName": "Blaze",
  "nextFlame": 4,
  "nextFlamePhase": 25,
  "nextFlameName": "Arcane",
  "toNextFlame": 13,
  "maxFlame": false,
  …
  "messages": 1543,
  "messagesThisStream": 37,
  "messagesRank": 9,
  …
}

Streamer.bot: all variables at once

  1. Create an action with a Command trigger, e.g. !streak.
  2. Add Core → Network → Fetch URL. URL: https://www.hxs01.net/api/streaks/v1/hxs01/u/%userName%. Variable Name: streak. Tick Parse as JSON.
  3. Streamer.bot then creates one variable per key, named %<Variable Name>.<key>%: %streak.streak%, %streak.highest%, %streak.flameName%, %streak.messages%… (that’s why the JSON is flat).
  4. Add Twitch → Chat → Send Message to Channel: @%user% 🔥 %streak.streak% streak (best %streak.highest%) · %streak.flameName% · %streak.messages% msgs

Streamer.bot: one value

Fetch URL https://www.hxs01.net/api/streaks/v1/hxs01/u/%userName%/streak with Variable Name myStreak and Parse as JSON off; the body is just the number, so use %myStreak% in the message.

Nightbot

!commands add !streak $(urlfetch https://www.hxs01.net/api/streaks/v1/hxs01/u/$(user)/streak)

Replies with just the number; wrap it in your own text: !commands add !streak @$(user) has a $(urlfetch …/u/$(user)/streak) streak. Several values in one fetch:

!commands add !streak @$(user) 🔥 $(urlfetch https://www.hxs01.net/api/streaks/v1/hxs01/u/$(user)?vars=streak,highest,flameName&sep=%20%C2%B7%20)

StreamElements

!cmd add !streak @${user} 🔥 ${customapi.https://www.hxs01.net/api/streaks/v1/hxs01/u/${user}/streak} streak

Fossabot (command response)

@$(user) 🔥 $(customapi https://www.hxs01.net/api/streaks/v1/hxs01/u/$(user)/streak) streak, $(customapi https://www.hxs01.net/api/streaks/v1/hxs01/u/$(user)/messages) messages

Viewer variables

NameMeaningExample
existsthe viewer has a streak record in this channel (false = unknown, everything else 0 / empty)true
userdisplay name (Arabic and other scripts kept); for an unknown viewer, the name you asked forمحمد
loginTwitch loginmohammed
userIdTwitch user id123456789
avatarprofile picture URLhttps://static-cdn.jtvnw.net/…
channelchannel nameHXS01
linkleaderboard linkhttps://www.hxs01.net/streaks/hxs01
livethe channel is live right nowtrue
streakcurrent streak12
highestbest streak ever30
pendinglive, has a streak, and hasn’t chatted yet this streamfalse
countedTodayalready counted in the current (or last) streamtrue
flameflame level: 0 = none, 1 = Spark, 2 = Kindled … in tier order3
flamePhasethe streak where their current flame starts (1, 3, 10 … 300, 365 … 1000; 0 = none)10
flameNamecurrent flame nameBlaze
nextFlamenext flame level (0 at the top)4
nextFlamePhasethe streak where the next flame starts (0 at the top)25
nextFlameNamenext flame name (empty at the top)Arcane
toNextFlamestreaks left to the next flame (0 at the top)13
maxFlamealready has the highest flamefalse
highestFlameflame level of their best streak4
highestFlameNameflame name of their best streakArcane
rankplace by current streak (0 = no streak)4
highestRankplace by best streak (0 = none)2
totalRankedviewers with a streak right now120
topPercenttop x % by current streak, rounded up (0 = no streak)4
messageschat messages counted in total1543
messagesThisStreamchat messages in the current (or last) stream37
messagesRankplace by chat messages (0 = none)9
watchHourshours watched (one decimal under 100)126
watchTimetime watched, e.g. "126h 5m"126h 5m
watchHoursThisYearhours watched this year40.5
watchRankplace by watch time (0 = none)7
lostthe streak they lost last (0 = none)0
lostDatewhen they lost it, YYYY-MM-DD (Riyadh date; empty = never)2026-10-01
canRestorehas a lost streak a moderator could restorefalse
isNewBesttheir current streak is their best everfalse
toBeatBeststreaks needed to beat their best (0 = no record yet)19
streamsChattedstreams they were counted in41
lastCountedlast date their streak went up, YYYY-MM-DD (empty = never)2026-10-24
firstSeenfirst date they were counted, YYYY-MM-DD2026-03-02
daysSinceLastcalendar days since lastCounted, Riyadh dates (0 = today or never)1

Flame levels follow the tier list below: 0 = no streak, 1 = Spark (1–2), 2 = Kindled (3–9) … the last level is the top flame (maxFlame = true, nextFlame = 0).

Channel variables

NameMeaningExample
channelchannel nameHXS01
linkleaderboard linkhttps://www.hxs01.net/streaks/hxs01
livelive right nowtrue
sessionsstreams counted214
viewersviewers tracked1890
activeStreaksviewers with a streak right now120
countedTodaychatters counted in the current (or last) stream64
totalMessageschat messages counted in total84213
messagesThisStreamchat messages in the current (or last) stream1260
chattersviewers with at least one counted message640
messageMode"live" (only while live) or "always"live
top1User#1 current streak: nameAlice
top1Streak#1 current streak40
top2User#2 current streak: nameBob
top2Streak#2 current streak32
top3User#3 current streak: nameمحمد
top3Streak#3 current streak30
topChatterUsermost chat messages: nameCarl
topChatterMessagestheir chat messages5021
recordUserlongest streak ever: nameAlice
recordStreakthe longest streak ever61

The dashboard’s API & variables section has a Variables explorer with your live values and a copy button for each URL.

Endpoints

All are GET, open to any origin (CORS *), and under /api/streaks/v1/{channel}.

PathReturnsParameters
/user/{login}One viewer’s streak. {login} is a login or display name (any case, a leading @ is fine, Arabic works).format, template, none
/cmdSame data as /user, made for urlfetch chatbots: answers for target if given, otherwise user. Text by default.user, target, format, template, none
/u/{login}[/{variable}]Every viewer variable as flat, pretty JSON, or one / several raw values as text. See Chatbot variables.var, vars, sep, bool, format
/c[/{variable}]Channel variables, flat JSON or raw values.var, vars, sep, bool, format
/leaderboardRanked rows, paginated (each row includes messages and watchHours).sort=current|highest|messages|watch, limit=1–100 (25), offset=0–10000, format, template
/topCompact top list by current streak.n=1–25 (10, text 5), format, template
/statsChannel totals: tracked viewers, active streaks, streams counted, live now, chatters counted this stream, top streak, longest ever.format, template
/tiersEvery flame tier: level, key, name, min, max and colours, for overlays.format, template

Examples

https://www.hxs01.net/api/streaks/v1/hxs01/user/viewer123
https://www.hxs01.net/api/streaks/v1/hxs01/user/viewer123?format=text
https://www.hxs01.net/api/streaks/v1/hxs01/leaderboard?sort=highest&limit=50&offset=50
https://www.hxs01.net/api/streaks/v1/hxs01/top?n=3&format=text
https://www.hxs01.net/api/streaks/v1/hxs01/stats
https://www.hxs01.net/api/streaks/v1/hxs01/tiers

/user response

{
  "channel": { "login": "hxs01", "name": "HXS01", "live": true, "url": "https://www.hxs01.net/streaks/hxs01" },
  "user": {
    "login": "viewer123", "displayName": "Viewer123", "avatar": "https://static-cdn.jtvnw.net/…",
    "current": 12, "highest": 30, "rank": 4, "highestRank": 2,
    "tier": "blaze", "tierName": "Blaze", "tierLevel": 3, "nextTier": "Arcane", "streaksToNextTier": 13,
    "lostStreak": 30, "streamsChatted": 51, "messages": 1543, "messagesThisStream": 37, "messagesRank": 9, "pending": false,
    "lastCounted": "2026-10-24T18:03:11.000Z", "blocked": false
  }
}

rank is by current streak, highestRank by best streak (null when not ranked). pending = live, has a streak, hasn’t chatted yet this stream. Blocked viewers are hidden (404). /leaderboard returns { channel, sort, limit, offset, total, rows }, /top returns { channel, n, top }, /stats returns { channel, stats }, /tiers returns { channel, tiers }.

Text & templates

Add format=text (the default on /cmd) for a plain-text line: no HTML, one line, at most 400 characters (Nightbot’s limit). Change it with template=, URL-encoded, up to 300 characters, and the not-found line with none=. Variables are case-insensitive; unknown or missing ones render as nothing. Mass pings like @everyone are defused and a reply never starts with /, . or !, so it can’t trigger chat commands.

EndpointDefault template
/user, /cmd@{user} 🔥 {current} stream streak (best {highest}) · rank #{rank} · {tierName}
no current streak@{user} has no active streak right now (best {highest})
unknown viewer (none=)@{user} has no streak yet
/leaderboard🔥 {channel} streaks: {list}
/top🔥 Top streaks in {channel}: {list}
/stats🔥 {channel}: {activeStreaks} active streaks, {totalViewers} viewers over {sessions} streams. Top {top1} ({top1Streak}), longest ever {longest} ({longestStreak})
/tiers🔥 Flame tiers: {list}

An unknown viewer answers 200 in text mode (chatbots show the body) and 404 in JSON. Arabic works in names and templates:

https://www.hxs01.net/api/streaks/v1/hxs01/cmd?user=$(user)&template=%F0%9F%94%A5%20%7Buser%7D%20%D8%B9%D9%86%D8%AF%D9%87%20%D8%B3%D8%AA%D8%B1%D9%8A%D9%83%20%7Bcurrent%7D

Template variables

For template= on the text endpoints (the /u and /c variables above are a separate, raw format).

VariableMeaning
{user}viewer display name (Arabic and other scripts kept)
{login}viewer login
{current}current streak
{highest}best streak ever
{rank}place by current streak (– when not ranked)
{highestRank}place by best streak
{tier}flame tier number (1 = Spark)
{tierName}flame tier name, e.g. Blaze
{nextTier}next flame tier name (empty at the top)
{streaksToNextTier}streaks left to the next tier
{lostStreak}the streak they lost last time (0 = none)
{streamsChatted}streams they chatted in
{messages}chat messages counted
{messagesThisStream}chat messages in the current (or last) stream
{messagesRank}place by chat messages (– when none)
{watchHours}hours watched (one decimal under 100)
{watchTime}time watched, e.g. "12h 40m"
{watchHoursThisYear}hours watched this year
{watchRank}place by watch time (– when none)
{sender}/cmd only: who typed the command (user=)
{channel}channel name
{link}leaderboard link
{top1}name of the #1 current streak
{top1Streak}the #1 current streak
{top3}top three, e.g. "a 40 · b 32 · c 30"
{longest}who holds the longest streak ever
{longestStreak}the longest streak ever
{totalViewers}viewers tracked
{activeStreaks}viewers with a streak right now
{sessions}streams counted
{counted}chatters counted in the current stream
{totalMessages}chat messages counted in this channel
{topChatter}who sent the most chat messages
{topChatterMessages}their chat messages
{live}"live" or "offline"
{list}leaderboard / top / tiers: the rows, fitted to 400 characters

Channel variables ({top1}, {totalViewers}…) work in every endpoint’s template.

Public reads & API keys

Reads are public unless the streamer turns Public read API off in the dashboard. Keys are made in the dashboard’s API section (streamer or site owner), up to 5 per channel, shown once and stored only as a SHA-256 hash. Scopes:

  • read: read while the public API is off.
  • write: the write endpoints below.

Send a key as Authorization: Bearer stk_…. Chatbots that can’t set headers may add &key=stk_… for reads (keep that command private; writes only accept the header).

Writes

POST /api/streaks/v1/{channel}/manage/{action} with a write key and a JSON body. Every change uses the same engine as the dashboard, is written to the audit log as “API key <name>”, and can be undone from the dashboard.

ActionBody
restore{ "user": "name", "reason"?: "…" }: gives back the last lost streak
set{ "user": "name", "value": 0–100000, "reason": "at least 3 characters" }
block / unblock{ "user": "name", "reason"?: "…" }
sync-livenone: asks Twitch whether the channel is live and fixes a missed online/offline event
curl -X POST https://www.hxs01.net/api/streaks/v1/hxs01/manage/set \
  -H "Authorization: Bearer stk_…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: outage-2026-10-24-viewer123" \
  -d '{"user":"viewer123","value":12,"reason":"Twitch outage"}'

Answer: { ok, action, auditId, undoable, user, before, after }. With an Idempotency-Key (1–64 letters, digits, _ . : -) a retried request returns the first answer (header Idempotent-Replayed: true) for 24 hours instead of changing anything twice.

Errors

JSON errors always look like { "error": { "code": "user_not_found", "message": "…" } }. In text mode the message itself is the body.

StatusCodeWhen
400bad_requestA parameter is missing or out of range
400template_too_longtemplate or none is longer than 300 characters
401unauthorizedPrivate API without a key, or a revoked / wrong key
403forbiddenThe key lacks the scope (read on a private API, write for writes)
404channel_not_foundThe channel isn’t tracked
404user_not_foundNo streak record (text mode answers 200 with a friendly line)
404unknown_variable/u or /c: no such variable (the JSON error lists the valid names)
404not_foundUnknown endpoint or action
409conflictThe change can’t be made now (e.g. nothing to restore, stream still settling, Idempotency-Key in use)
422idempotency_mismatchIdempotency-Key reused with a different request
429rate_limitedToo many requests; wait Retry-After seconds
502upstream_errorTwitch didn’t answer (sync-live)
503server_errorSomething went wrong on our side, try again

Rate limits & caching

  • Per IP and channel: 60 requests a minute. Per key: 120 a minute; writes 20 a minute per key.
  • Over the limit: 429 with Retry-After (seconds); text mode answers “Slow down a little…”. X-RateLimit-Limit / X-RateLimit-Remaining come with every answer.
  • Public GETs are cached at the edge for 15 s per full URL (and served stale for up to 30 s more while refreshing), so data can be up to about 45 s old. Keyed reads are never cached.

Flame tiers

LevelKeyNameStreaksColours
1sparkSpark1–2
2kindledKindled3–9
3blazeBlaze10–24
4arcaneArcane25–49
5voltaicVoltaic50–99
6white-hotWhite-hot100–199
7gildedGilded200–299
8emeraldEmerald300–364
9full-yearFull Year365–399
10frostfireFrostfire400–499
11plasmaPlasma500–599
12venomVenom600–699
13voidVoid700–799
14solarSolar800–899
15auroraAurora900–999
16eternalEternal1000+