Skip to content

Endpoints reference

The Stats API surface is grouped into eight families. Every endpoint below lives under https://statable.com/api and requires session cookie auth (see Authentication) unless marked public.

This page is a catalog. Common query parameters are documented once at the top. Worked examples follow for the five endpoints you'll hit first.


Common query parameters

These appear on virtually every analytics endpoint. They behave the same everywhere.

ParamTypeNotes
website_idint64 | stringRequired on /site/*. Numeric ID or site hash.
periodstring1r (realtime, 30 min), 1h24h, 1d365d, 1m12m, c (custom), a (all time).
start_date, end_dateYYYY-MM-DDRequired when period=c.
intervalstringhour / day / week / month. Auto-resolved when omitted.
limit, offsetintPagination. Defaults vary. Most list endpoints cap at 100.
searchstringSubstring match. Supported on pages, paths, hosts, similar list endpoints.
filtersstringJSON or URL-encoded filter expression. Same grammar as the dashboard filter bar.
sorting_by, sort_typestringColumn + ASC/DESC. Supported on tabular list endpoints.

1. Auth & Profile

MethodPathDescription
POST/auth/send-otpRequest a 6-digit OTP to the given email.
POST/auth/verify-otpVerify OTP and receive auth_token + refresh cookies.
GET/auth/verifyEmail-link verification (alternative to OTP).
GET/auth/google/loginStart Google OAuth login.
GET/auth/google/callbackOAuth callback handler.
GET/auth/meCurrent user profile + monthly usage.
POST/auth/me/editUpdate first/last name.
DELETE/auth/meDelete account (cascades all sites/data).
POST/auth/logoutRevoke current refresh token, clear cookies.

2. Sites

MethodPathDescription
GET/sitesList sites for the current user. Optional search, period, graph.
GET/sites/recentsTop 5 most recently accessed sites.
POST/add-siteCreate a new site.
POST/share-siteShare access with another email.
GET/siteSite metadata (?website_id=…).
PUT/siteUpdate site (timezone, URL).
DELETE/siteDelete site and all data.

3. Analytics, Top Stats & Graphs

MethodPathDescription
GET/site/top-statsHeadline KPIs: visitors, pageviews, bounce rate, visit duration, views/visit.
GET/site/graphsTime-series for any metric, bucketed by interval.
GET/site/compare_periodsCurrent period vs previous period deltas.
GET/site/has-hitsBoolean. Did this site receive any pageviews in the period?
GET/site/current-visitorsLive count of visitors active in the last 5 minutes.

4. Pages & Paths

MethodPathDescription
GET/site/pagesTop pages by pageviews. detailed=true adds bounce/exit metrics.
GET/site/entry-pagesTop landing pages.
GET/site/exit-pagesTop exit pages.
GET/site/foldersAggregated stats grouped by URL folder.
GET/site/hostsPageviews broken down by hostname.
GET/site/path_listAutocomplete-style list of paths. Use with search.
GET/site/status-pagesPages broken down for a given status_code.
GET/site/status-codesDistribution of HTTP status codes.

5. Sources & Channels

MethodPathDescription
GET/site/sourcesTop traffic sources.
GET/site/channelsChannel grouping (organic, paid, direct, referral, …).
GET/site/referrersRaw referrer URLs.
GET/site/utm/sourceUTM source breakdown.
GET/site/utm/mediumUTM medium breakdown.
GET/site/utm/campaignUTM campaign breakdown.
GET/site/utm/contentUTM content breakdown.
GET/site/utm/termUTM term breakdown.

6. Tech & Geo

MethodPathDescription
GET/site/browsersBrowser breakdown.
GET/site/osOperating system breakdown.
GET/site/devicesDevice-type breakdown (desktop/mobile/tablet).
GET/site/countriesVisitor countries.
GET/site/regionsStates / regions.
GET/site/citiesCities.
GET/site/top-citiesTop 50 cities (lighter payload for sparkline UI).

7. Goals & Custom

MethodPathDescription
GET/site/goalsList goals for the site.
GET/site/goalFetch one goal (?id=…).
POST/site/goalCreate a goal.
PUT/site/goalUpdate a goal.
DELETE/site/goalDelete a goal.
GET/site/goals_statsConversion stats per goal.
GET/site/eventsCustom events report.
GET/site/custom_event_listList of distinct event names.
GET/site/props/keysDistinct custom property keys.
GET/site/props/valuesDistinct values for ?prop=key.

8. Site Settings & GA4

MethodPathDescription
GET / PUT/site/settings/blacklisted-ipsIP blocklist.
GET / PUT/site/settings/hostnamesHostname allowlist.
PUT/site/settings/public-dashboardToggle public dashboard.
GET/auth/ga4/connectBegin GA4 OAuth (CSRF-protected).
GET/ga4/propertiesList GA4 properties for the connected account.
GET/ga4/imports/site/{hash}Imports for a given site.
GET/ga4/site/{hash}/imported-dataImported data summary.
DELETE/ga4/site/{hash}/imported-dataRemove imported GA4 data.

Worked examples

GET /site/top-stats

curl 'https://statable.com/api/site/top-stats?website_id=42&period=7d' \
  -b cookies.txt
{
  "visitors": 12480,
  "pageviews": 38192,
  "bounce_rate": 41.2,
  "visit_duration": 184,
  "views_per_visit": 3.06
}

Add compare=true to get prior-period deltas as a second object on the same payload.


GET /site/graphs

curl 'https://statable.com/api/site/graphs?website_id=42&period=30d&interval=day&metric=visitors' \
  -b cookies.txt
{
  "interval": "day",
  "metric": "visitors",
  "points": [
    { "t": "2025-04-01", "v": 380 },
    { "t": "2025-04-02", "v": 412 },
    { "t": "2025-04-03", "v": 451 }
  ]
}

interval is auto-resolved when omitted: period=24h defaults to hour, period=7d to day, period=12m to month.


GET /site/pages

curl 'https://statable.com/api/site/pages?website_id=42&period=7d&limit=10&detailed=true' \
  -b cookies.txt
{
  "data": [
    { "page": "/", "pageviews": 18402, "visitors": 9120, "bounce_rate": 38.1, "exit_rate": 22.4 },
    { "page": "/pricing", "pageviews": 4210, "visitors": 3088, "bounce_rate": 29.7, "exit_rate": 18.2 }
  ],
  "meta": { "total": 142 }
}

Drop detailed=true for a leaner payload (just page, pageviews, visitors).


POST /site/goal

curl -X POST 'https://statable.com/api/site/goal?website_id=42' \
  -b cookies.txt \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Signup Completed",
    "type": "event",
    "event_name": "Sign Up"
  }'
{
  "id": 87,
  "name": "Signup Completed",
  "type": "event",
  "event_name": "Sign Up",
  "created_at": "2025-04-28T10:14:22Z"
}

type accepts event (paired with event_name) or pageview (paired with path).


POST /add-site

curl -X POST https://statable.com/api/add-site \
  -b cookies.txt \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://example.com",
    "timezone": "Europe/Kyiv"
  }'
{
  "id": 53,
  "hash": "a1b2c3d4",
  "name": "example.com",
  "timezone": "Europe/Kyiv",
  "status": "Waiting"
}

Use hash in the tracking script and id (or hash) as website_id for analytics queries.


See also

  • Errors: what 401, 402, 403, 404, 422 mean and how to recover.
  • Rate limits: current state and what to expect.
  • More detailed per-endpoint pages will follow this MVP catalog.

Ready to take control of your web analytics? Try Statable free for 30 days — no credit card required, full feature access, GDPR-compliant by default. Start your free trial or view a live demo.