REST API

Public, read-only analytics API plus the ingestion endpoint used by p.js. All responses are JSON and CORS-enabled.

POST /api/v1/collect

Ingest a pageview or an engagement ping. Body (text/plain or JSON): {"t":"pv","s":"hub","p":"/","r":"https://google.com","l":"en-US"} → 202.

GET /api/v1/sites

Tracked sites with their 30-day pageviews.

Try it →
GET /api/v1/stats?site=hub&range=30d

Totals, period-over-period change, time series and breakdowns. range = today | 24h | 7d | 30d | 90d.

Try it →
GET /api/v1/realtime?site=hub

Visitors and pageviews in the last 5 minutes and the latest events.

Try it →
GET /api/v1/export.csv?site=all&range=7d

Time series as CSV.

Try it →
GET /api/health

Liveness probe.

Try it →

Example

curl -X POST https://pulse.fabiancollado.net/api/v1/collect \
  -H 'Content-Type: text/plain' \
  -d '{"t":"pv","s":"hub","p":"/pricing","r":"https://news.ycombinator.com"}'
Demo project · Portfolio