Skip to content

REST API, Bot pixel tracking & Page Transitions

Choose a tag to compare

@chimilevschi chimilevschi released this 25 Apr 01:16
· 72 commits to main since this release

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/create returning 404