Skip to main content
POST
/
hit
Increment and return hits for an id (POST)
curl --request POST \
  --url https://nums.advay.ca/hit
{
  "id": "<string>",
  "hits": 123,
  "source": "<string>"
}
Increment the counter for an id and return the updated value. Authentication
  • Send your secret via X-Auth-Token header or ?token= query.
Before you test
  • Use your own deployment URL (e.g., https://<project>.vercel.app) and your secret token from the server env (SECRET_TOKEN).
  • The public instance at https://nums.advay.ca is read-friendly; incrementing requires your own secret.
Example (self-hosted)
curl -H "X-Auth-Token: $SECRET_TOKEN" "https://<project>.vercel.app/hit?id=home"
Tip
  • Viewing counts does not require any token. See /count and /count.txt.

Headers

X-Auth-Token
string

Secret token for authentication (required unless token query provided)

Query Parameters

id
string

Counter id (default home)

token
string

Secret token (alternative to header)

url
string

Optional custom deployment URL (defaults to https://nums.advay.ca)

Response

OK

id
string
hits
integer
source
string

Optional source indicator (redis or memory)

I