Stats API
The Stats endpoints return the same data that powers your dashboard reports. All are GET, site-scoped and authenticated with an API key. Date ranges default to the trailing 30 days when omitted.
Overview
GET /api/v1/sites/{id}/analytics/overview
Headline traffic, engagement and conversion metrics for the period — visitors, pageviews, sessions, bounce rate and more, plus top channels, sources, countries, devices, and entry/exit pages. Powers the Overview report.
curl "https://app.otusanalytics.com/api/v1/sites/123/analytics/overview" \
-H "Authorization: Bearer sk_live_xxx"
Breakdown timeseries
GET /api/v1/sites/{id}/analytics/breakdown-timeseries?metric=sessions&dimension=channel
A metric broken down by a dimension over time (top series plus "Other").
| Parameter | Values |
|---|---|
metric | sessions, pageviews, bounce_rate, conv_rate, revenue |
dimension | channel, country, device, browser |
Engagement
GET /api/v1/sites/{id}/analytics/engagement
Engagement metrics — pages per session, average time on page, scroll-depth distribution and (in full tracking) returning-visitor data. Powers the Engagement report.
Realtime
GET /api/v1/sites/{id}/analytics/realtime
A snapshot of current activity — active visitors, recent pageviews and the live event stream. Powers the Realtime report.
Funnel
GET /api/v1/sites/{id}/analytics/funnel?steps=[...]&window_hours=24
Computes a funnel from an ordered list of steps.
| Parameter | Description |
|---|---|
steps | JSON array of ordered steps (pageview or event). |
window_hours | Completion window in hours, 1–168 (1 hour to 7 days). |
Powers the Funnels report.