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

  1. Issue a pk- public key from the XAPI console and embed it in your client or server code.
  2. Send POST /x-urls/{pk-...}/track whenever a visit occurs, optionally passing the referer header or JSON payload.
  3. Call GET /x-urls/{pk-...}/overview for high-level totals, or use top/referers endpoints for leaderboards.
  4. Need a reset? Authenticate with your sk- private key and invoke POST /x-urls/clear to 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

MethodPathDescription
POST/x-urls/{pk-...}/trackRecord a visit; accepts url in JSON or query/body, uses request Referer if present
GET/x-urls/{pk-...}/overviewFetch totals (visits, unique referrers, etc.)
GET/x-urls/{pk-...}/stats?url=Retrieve metrics for a specific URL
GET/x-urls/{pk-...}/top?limit=10Get Top-N URLs by visits
GET/x-urls/{pk-...}/referers?limit=10Get Top-N referer domains
POST/x-urls/clearClear 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.