| Param | Description | Required |
|---|---|---|
chan | Channel name | * |
user | Username — @ prefix stripped automatically | Yes |
id | Counter name, e.g. deaths | Yes |
mode | Operation mode (see Modes) | No |
num | Integer value for set mode | No |
* chan is optional when called from Nightbot — the channel is read automatically from the Nightbot-Channel request header.
| mode= | Action | Returns |
|---|---|---|
| (omit) | Increment by 1 | New count |
query | Read current value | Current count |
reset | Set to 0 | Count Reset |
set | Set to num | Count set to N |
overlay | OBS browser source | HTML page |
Increment (e.g. death counter):
$(urlfetch /api?user=$(user)&id=deaths)
Query current count:
$(urlfetch /api?user=$(user)&id=deaths&mode=query)
Reset counter:
$(urlfetch /api?user=$(user)&id=deaths&mode=reset)
chan is not needed — Nightbot sends it automatically.
Increment:
/api?chan=mychan&user=myuser&id=deaths
Set to a specific value:
/api?chan=mychan&user=myuser&id=deaths&mode=set&num=10
OBS overlay source URL:
/api?chan=mychan&user=myuser&id=deaths&mode=overlay