Repository navigation
REST API, Bot pixel tracking & Page Transitions
REST API v1
Statalog now exposes a read API so you can pull your analytics data into your own dashboards, scripts, or integrations.
Authentication
Set STATALOG_API_KEY in your .env file and pass it on every request:
Authorization: Bearer YOUR_API_KEY
Endpoints
| Endpoint | Description |
|---|---|
GET /api/v1/stats |
Summary: visitors, pageviews, sessions, bounce rate, avg duration |
GET /api/v1/stats/timeseries |
Visitors and pageviews grouped by day |
GET /api/v1/pages |
Top pages by pageviews |
GET /api/v1/referrers |
Top referrer domains |
GET /api/v1/channels |
Traffic by channel |
GET /api/v1/locations |
Visitors by country |
GET /api/v1/devices |
Device type, browser, and OS breakdown |
GET /api/v1/events |
Custom events |
GET /api/v1/campaigns |
UTM campaign stats |
GET /api/v1/live |
Visitors active in the last N minutes |
Other changes
- SEO Tools collapsible sidebar group
- Viewer role enforcement — write routes protected
- Fix: visitor map blank on page load
- Fix: New vs Returning showing 0
- Fix: Page Transitions
analyticsFor()undefined method - Fix:
sites/createreturning 404