Counter GET / Returns: 200 text/plain (this documentation) GET /?domain= domain is required Returns: 200 application/json { "domain": string, "totalVisits": number, "paths": [...], "referrers": [...], "dailyCounts": [...] } Errors: 400 { "error": "domain is required" } GET /?domain=&path= domain is required path is optional Returns: 200 application/json { "domain": string, "path": string, "totalVisits": number, "referrers": [...], "dailyCounts": [...] } Errors: 400 { "error": "domain is required" } or { "error": "path is invalid" } POST / Content-Type: application/json Body: { "domain": string, "path"?: string, "title"?: string, "referrer"?: string, "type": "visit" } Returns: 200 application/json { "status": "ok" | "rejected", "totalVisits": number } Errors: 400 { "error": "invalid json" } 400 { "error": "invalid payload" } 429 { "error": "rate limited" } WebSocket / Subscribe to real-time updates for a domain/path Message: { "action": "subscribe", "domain": string, "path"?: string } Responses: { "type": "snapshot", "data": stats } - initial stats snapshot { "type": "increment", "domain": string, "path": string, "increment": number } - when visit recorded { "type": "error", "message": string } - on invalid message Global errors: 429 rate limited (per-ip rate limits) 401 blocked by reputation check (proxy/vpn/tor) 500 { "error": "internal_error" } Examples: curl "http://count.gloss.moe/?domain=example.com" curl "http://count.gloss.moe/?domain=example.com&path=/pricing" curl -X POST http://count.gloss.moe/ -H "content-type: application/json" -d '{"domain":"example.com","path":"/","type":"visit"}'