API Reference

Stats API

Query overview, breakdown, engagement, realtime and funnel data for a site.

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").

ParameterValues
metricsessions, pageviews, bounce_rate, conv_rate, revenue
dimensionchannel, 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.

ParameterDescription
stepsJSON array of ordered steps (pageview or event).
window_hoursCompletion window in hours, 1168 (1 hour to 7 days).

Powers the Funnels report.