X-STATS Website Analytics

Overview
X-STATS is a lightweight, cookie-free analytics layer that records URL pageviews, referrers, and trendsβperfect for teams that need privacy-friendly telemetry without shipping extra scripts.
Quick Start
- Issue a
pk-public key from the XAPI console and embed it in your client or server code. - Send
POST /x-urls/{pk-...}/trackwhenever a visit occurs, optionally passing the referer header or JSON payload. - Call
GET /x-urls/{pk-...}/overviewfor high-level totals, or usetop/referersendpoints for leaderboards. - Need a reset? Authenticate with your
sk-private key and invokePOST /x-urls/clearto wipe statistics.
Key Capabilities
- Cookie-free tracking: Captures only URL and referer metadata to stay privacy-aligned.
- Real-time aggregation: Redis-backed counters scale to high traffic while keeping queries fast.
- Built-in leaderboards: Top URLs and referers are available with adjustable limits.
- One-click resets: Admin endpoints let you clear data before launches or campaigns.
API Reference
| Method | Path | Description |
|---|---|---|
POST | /x-urls/{pk-...}/track | Record a visit; accepts url in JSON or query/body, uses request Referer if present |
GET | /x-urls/{pk-...}/overview | Fetch totals (visits, unique referrers, etc.) |
GET | /x-urls/{pk-...}/stats?url= | Retrieve metrics for a specific URL |
GET | /x-urls/{pk-...}/top?limit=10 | Get Top-N URLs by visits |
GET | /x-urls/{pk-...}/referers?limit=10 | Get Top-N referer domains |
POST | /x-urls/clear | Clear stats for the authenticated account (requires sk- key) |
Example: Track a Page View
export XAPI_PUBLIC_KEY="your-public-key" # pk- prefixed
curl -X POST "https://api.xabcstack.com/x-urls/${XAPI_PUBLIC_KEY}/track" \
-H "Content-Type: application/json" \
-H "Referer: https://www.google.com/" \
-d '{
"url": "https://blog.yoursite.com/articles/totp-security"
}'
FAQ
- Backend instrumentation? Yesβcall the track endpoint from your server code during request handling.
- Rate limiting? Add client-side throttling if needed; aggregated counters naturally deduplicate frequent views.
- Custom dashboards? All endpoints speak JSON, so plug them into BI tooling or your own visualizations.