A free, open-source, tracking-free, minimalistic, self-hostable counter API. https://countarr.eu
  • TypeScript 32%
  • HTML 29.8%
  • CSS 18.8%
  • Python 9.7%
  • JavaScript 9.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
AlexInABox b7978ed6fe
All checks were successful
Deploy to Cloudflare / deploy (push) Successful in 1m56s
added a license
2026-07-31 12:04:23 +02:00
.forgejo/workflows fix run command in deploy workflow 2026-07-29 11:42:24 +02:00
src fix source url 2026-07-29 11:47:26 +02:00
.env.drizzle.example added deploy workflow! 2026-07-29 11:39:26 +02:00
.gitignore added deploy workflow! 2026-07-29 11:39:26 +02:00
drizzle.config.ts added deploy workflow! 2026-07-29 11:39:26 +02:00
LICENSE added a license 2026-07-31 12:04:23 +02:00
package-lock.json added deploy workflow! 2026-07-29 11:39:26 +02:00
package.json added deploy workflow! 2026-07-29 11:39:26 +02:00
README.md added deploy workflow! 2026-07-29 11:39:26 +02:00
tsconfig.json initial commit 2026-07-28 00:39:04 +02:00
worker-configuration.d.ts redesigned frontend and adjusted schemathesis testing with custom hook! 2026-07-28 15:38:44 +02:00
wrangler.jsonc redesigned frontend and adjusted schemathesis testing with custom hook! 2026-07-28 15:38:44 +02:00

Countarr

Countarr is a minimalistic, tracking-free web counter API running on Cloudflare Workers.

API Endpoints

All counter endpoints accept a path parameter id matching ^[A-Za-z0-9-]+$ with a length of 5 to 40 characters.

Method Endpoint Description Response
GET /api/:id Fetch current counter value (returns 0 if ID does not exist). {"count": number}
POST /api/:id Atomically increment counter by 1 via SQL upsert. {"count": number}
GET /docs Interactive Scalar API Reference page. HTML
GET /openapi.json Generated OpenAPI 3.0 specification. JSON

Database Schema

Defined in src/db/schema.ts for SQLite/D1 (counters table):

Column Type Constraints
id TEXT Primary Key
count INTEGER Not Null, Default: 0

Local Development

Prerequisites

  • Node.js & npm
  • uv (for running Python test suite)

Commands

# Initialize local D1 database, generate types, and start Wrangler dev server
npm start

# Run Schemathesis API tests, this requires a local instance running at http://localhost:8787 (npm start)
npm test