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%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
Deploy to Cloudflare / deploy (push) Successful in 1m56s
|
||
| .forgejo/workflows | ||
| src | ||
| .env.drizzle.example | ||
| .gitignore | ||
| drizzle.config.ts | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| worker-configuration.d.ts | ||
| wrangler.jsonc | ||
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