curl -H "X-Auth-Token: $SECRET_TOKEN" "https://nums.advay.ca/hit?id=home"
{ "id": "home", "hits": 73, "source": "redis" }
Base URL: https://nums.advay.ca/
Only /hit requires authentication via X-Auth-Token (or ?token=). Read endpoints are public on the hosted instance and serverless deployments. When running the standalone server in ./cmd/server, setting a SECRET_TOKEN also protects read endpoints.

Increment (GET/POST /hit)

id
string
Counter id. Defaults to home.
X-Auth-Token
string
required
Secret token for write access. Alternatively use ?token=.
token
string
Secret token (alternative to header).
curl -H "X-Auth-Token: $SECRET_TOKEN" "https://nums.advay.ca/hit?id=home"
{ "id": "home", "hits": 73, "source": "redis" }

Read (JSON) — GET /count

id
string
Counter id. Defaults to home.
format
string
Optional txt or text to return plain text instead of JSON.
curl "https://nums.advay.ca/count?id=home"
{ "id": "home", "hits": 73, "source": "redis" }

Read (Text) — GET /count.txt

id
string
Counter id. Defaults to home.
curl "https://nums.advay.ca/count.txt?id=home"
73

Badge (SVG) — GET /badge

id
string
Counter id. Defaults to home.
label
string
Left-side text. Defaults to views.
style
string
Badge style: terminal or default classic.
color
string
Classic badge color (e.g., blue).
bg
string
Terminal background (hex #rrggbb or allowed names).
labelColor
string
Terminal label color (hex or allowed names).
valueColor
string
Terminal value color (hex or allowed names).
font
string
Custom font family.
open "https://nums.advay.ca/badge?id=home&style=terminal&label=hits&bg=%23101414&valueColor=%233cffb3"

Badge (Shields endpoint) — GET /badge.json

id
string
required
Counter id.
label
string
Left-side text. Defaults to views.
color
string
Badge color (e.g., blue).
cacheSeconds
integer
default:"60"
Cache TTL in seconds (30–3600 enforced).
open "https://img.shields.io/endpoint?url=https%3A%2F%2Fnums.advay.ca%2Fbadge.json%3Fid%3Dhome%26label%3Dhits%26cacheSeconds%3D30"
{ "schemaVersion": 1, "label": "views", "message": "73", "color": "blue", "cacheSeconds": 30 }