all projects

nums

a small Go API for page views, downloads, and badges.

nums — project preview

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.

built withGo

try the counting flow

API reference

Choose a common use, then send a sample hit. This preview updates locally; it doesn’t change a live counter.

1,840page views

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.

live request lab

send a real request

nums.advay.ca

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.

GET /count

Query

Change the ID to read a different public counter.

cURL
curl "https://nums.advay.ca/count?id=portfolio-demo"
responseJSON
{
  "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.