nums
a small Go API for page views, downloads, and badges.
about the project
Nums is an open-source hit counter and badge API. A Go server handles `/hit` and `/count`, and Redis stores the counts without tracking visitors.
I built it in summer 2025, and it counts visits on this site. The demo below shows the API in use; the docs cover live requests and server-side tokens.
try the counting flow
API referenceChoose a common use, then send a sample hit. This preview updates locally; it doesn’t change a live counter.
request
POST /hit?id=portfolio-home X-Auth-Token: [server-side secret] GET /count?id=portfolio-home
JSON response
{
"id": "portfolio-home",
"hits": 1,840,
"source": "redis"
}Keep the token on your backend; never ship it in browser code. Redis holds the count, while the small Go service handles the API request.
send a real request
These read requests reach the hosted Go API through a secure same-origin proxy. Try a counter ID and inspect the response without leaving the page.
Query
Change the ID to read a different public counter.
curl "https://nums.advay.ca/count?id=portfolio-demo"
JSON{
"id": "<your counter id>",
"hits": 0,
"source": "redis"
}Writes stay server-side. The /hit endpoint needs X-Auth-Token; use the API docs to configure it safely.