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
- Action with a Command trigger
!streak. - Sub-action Core → Network → Fetch URL:
https://www.hxs01.net/api/streaks/v1/hxs01/cmd?user=%userName%&target=%input0%, Variable NamestreakReply. - 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.
| URL | Answers |
|---|---|
/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=streak | Same 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 (userandloginecho the name asked for). Blocked and ignored viewers look unknown. - Unknown variable: 404 with
unknown variable: x; withformat=jsonthe error also lists every valid name. - Booleans are
true/false; addbool=1for1/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
- Create an action with a Command trigger, e.g.
!streak. - Add Core → Network → Fetch URL. URL:
https://www.hxs01.net/api/streaks/v1/hxs01/u/%userName%. Variable Name:streak. Tick Parse as JSON. - 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). - 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
| Name | Meaning | Example |
|---|---|---|
exists | the viewer has a streak record in this channel (false = unknown, everything else 0 / empty) | true |
user | display name (Arabic and other scripts kept); for an unknown viewer, the name you asked for | محمد |
login | Twitch login | mohammed |
userId | Twitch user id | 123456789 |
avatar | profile picture URL | https://static-cdn.jtvnw.net/… |
channel | channel name | HXS01 |
link | leaderboard link | https://www.hxs01.net/streaks/hxs01 |
live | the channel is live right now | true |
streak | current streak | 12 |
highest | best streak ever | 30 |
pending | live, has a streak, and hasn’t chatted yet this stream | false |
countedToday | already counted in the current (or last) stream | true |
flame | flame level: 0 = none, 1 = Spark, 2 = Kindled … in tier order | 3 |
flamePhase | the streak where their current flame starts (1, 3, 10 … 300, 365 … 1000; 0 = none) | 10 |
flameName | current flame name | Blaze |
nextFlame | next flame level (0 at the top) | 4 |
nextFlamePhase | the streak where the next flame starts (0 at the top) | 25 |
nextFlameName | next flame name (empty at the top) | Arcane |
toNextFlame | streaks left to the next flame (0 at the top) | 13 |
maxFlame | already has the highest flame | false |
highestFlame | flame level of their best streak | 4 |
highestFlameName | flame name of their best streak | Arcane |
rank | place by current streak (0 = no streak) | 4 |
highestRank | place by best streak (0 = none) | 2 |
totalRanked | viewers with a streak right now | 120 |
topPercent | top x % by current streak, rounded up (0 = no streak) | 4 |
messages | chat messages counted in total | 1543 |
messagesThisStream | chat messages in the current (or last) stream | 37 |
messagesRank | place by chat messages (0 = none) | 9 |
watchHours | hours watched (one decimal under 100) | 126 |
watchTime | time watched, e.g. "126h 5m" | 126h 5m |
watchHoursThisYear | hours watched this year | 40.5 |
watchRank | place by watch time (0 = none) | 7 |
lost | the streak they lost last (0 = none) | 0 |
lostDate | when they lost it, YYYY-MM-DD (Riyadh date; empty = never) | 2026-10-01 |
canRestore | has a lost streak a moderator could restore | false |
isNewBest | their current streak is their best ever | false |
toBeatBest | streaks needed to beat their best (0 = no record yet) | 19 |
streamsChatted | streams they were counted in | 41 |
lastCounted | last date their streak went up, YYYY-MM-DD (empty = never) | 2026-10-24 |
firstSeen | first date they were counted, YYYY-MM-DD | 2026-03-02 |
daysSinceLast | calendar 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
| Name | Meaning | Example |
|---|---|---|
channel | channel name | HXS01 |
link | leaderboard link | https://www.hxs01.net/streaks/hxs01 |
live | live right now | true |
sessions | streams counted | 214 |
viewers | viewers tracked | 1890 |
activeStreaks | viewers with a streak right now | 120 |
countedToday | chatters counted in the current (or last) stream | 64 |
totalMessages | chat messages counted in total | 84213 |
messagesThisStream | chat messages in the current (or last) stream | 1260 |
chatters | viewers with at least one counted message | 640 |
messageMode | "live" (only while live) or "always" | live |
top1User | #1 current streak: name | Alice |
top1Streak | #1 current streak | 40 |
top2User | #2 current streak: name | Bob |
top2Streak | #2 current streak | 32 |
top3User | #3 current streak: name | محمد |
top3Streak | #3 current streak | 30 |
topChatterUser | most chat messages: name | Carl |
topChatterMessages | their chat messages | 5021 |
recordUser | longest streak ever: name | Alice |
recordStreak | the longest streak ever | 61 |
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}.
| Path | Returns | Parameters |
|---|---|---|
/user/{login} | One viewer’s streak. {login} is a login or display name (any case, a leading @ is fine, Arabic works). | format, template, none |
/cmd | Same 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 |
/leaderboard | Ranked rows, paginated (each row includes messages and watchHours). | sort=current|highest|messages|watch, limit=1–100 (25), offset=0–10000, format, template |
/top | Compact top list by current streak. | n=1–25 (10, text 5), format, template |
/stats | Channel totals: tracked viewers, active streaks, streams counted, live now, chatters counted this stream, top streak, longest ever. | format, template |
/tiers | Every 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.
| Endpoint | Default 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).
| Variable | Meaning |
|---|---|
{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.
| Action | Body |
|---|---|
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-live | none: 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.
| Status | Code | When |
|---|---|---|
| 400 | bad_request | A parameter is missing or out of range |
| 400 | template_too_long | template or none is longer than 300 characters |
| 401 | unauthorized | Private API without a key, or a revoked / wrong key |
| 403 | forbidden | The key lacks the scope (read on a private API, write for writes) |
| 404 | channel_not_found | The channel isn’t tracked |
| 404 | user_not_found | No streak record (text mode answers 200 with a friendly line) |
| 404 | unknown_variable | /u or /c: no such variable (the JSON error lists the valid names) |
| 404 | not_found | Unknown endpoint or action |
| 409 | conflict | The change can’t be made now (e.g. nothing to restore, stream still settling, Idempotency-Key in use) |
| 422 | idempotency_mismatch | Idempotency-Key reused with a different request |
| 429 | rate_limited | Too many requests; wait Retry-After seconds |
| 502 | upstream_error | Twitch didn’t answer (sync-live) |
| 503 | server_error | Something 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-Remainingcome 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
| Level | Key | Name | Streaks | Colours |
|---|---|---|---|---|
| 1 | spark | Spark | 1–2 | |
| 2 | kindled | Kindled | 3–9 | |
| 3 | blaze | Blaze | 10–24 | |
| 4 | arcane | Arcane | 25–49 | |
| 5 | voltaic | Voltaic | 50–99 | |
| 6 | white-hot | White-hot | 100–199 | |
| 7 | gilded | Gilded | 200–299 | |
| 8 | emerald | Emerald | 300–364 | |
| 9 | full-year | Full Year | 365–399 | |
| 10 | frostfire | Frostfire | 400–499 | |
| 11 | plasma | Plasma | 500–599 | |
| 12 | venom | Venom | 600–699 | |
| 13 | void | Void | 700–799 | |
| 14 | solar | Solar | 800–899 | |
| 15 | aurora | Aurora | 900–999 | |
| 16 | eternal | Eternal | 1000+ |