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.
| Param | Type | Notes |
|---|---|---|
website_id | int64 | string | Required on /site/*. Numeric ID or site hash. |
period | string | 1r (realtime, 30 min), 1h–24h, 1d–365d, 1m–12m, c (custom), a (all time). |
start_date, end_date | YYYY-MM-DD | Required when period=c. |
interval | string | hour / day / week / month. Auto-resolved when omitted. |
limit, offset | int | Pagination. Defaults vary. Most list endpoints cap at 100. |
search | string | Substring match. Supported on pages, paths, hosts, similar list endpoints. |
filters | string | JSON or URL-encoded filter expression. Same grammar as the dashboard filter bar. |
sorting_by, sort_type | string | Column + ASC/DESC. Supported on tabular list endpoints. |
1. Auth & Profile
| Method | Path | Description |
|---|---|---|
| POST | /auth/send-otp | Request a 6-digit OTP to the given email. |
| POST | /auth/verify-otp | Verify OTP and receive auth_token + refresh cookies. |
| GET | /auth/verify | Email-link verification (alternative to OTP). |
| GET | /auth/google/login | Start Google OAuth login. |
| GET | /auth/google/callback | OAuth callback handler. |
| GET | /auth/me | Current user profile + monthly usage. |
| POST | /auth/me/edit | Update first/last name. |
| DELETE | /auth/me | Delete account (cascades all sites/data). |
| POST | /auth/logout | Revoke current refresh token, clear cookies. |
2. Sites
| Method | Path | Description |
|---|---|---|
| GET | /sites | List sites for the current user. Optional search, period, graph. |
| GET | /sites/recents | Top 5 most recently accessed sites. |
| POST | /add-site | Create a new site. |
| POST | /share-site | Share access with another email. |
| GET | /site | Site metadata (?website_id=…). |
| PUT | /site | Update site (timezone, URL). |
| DELETE | /site | Delete site and all data. |
3. Analytics, Top Stats & Graphs
| Method | Path | Description |
|---|---|---|
| GET | /site/top-stats | Headline KPIs: visitors, pageviews, bounce rate, visit duration, views/visit. |
| GET | /site/graphs | Time-series for any metric, bucketed by interval. |
| GET | /site/compare_periods | Current period vs previous period deltas. |
| GET | /site/has-hits | Boolean. Did this site receive any pageviews in the period? |
| GET | /site/current-visitors | Live count of visitors active in the last 5 minutes. |
4. Pages & Paths
| Method | Path | Description |
|---|---|---|
| GET | /site/pages | Top pages by pageviews. detailed=true adds bounce/exit metrics. |
| GET | /site/entry-pages | Top landing pages. |
| GET | /site/exit-pages | Top exit pages. |
| GET | /site/folders | Aggregated stats grouped by URL folder. |
| GET | /site/hosts | Pageviews broken down by hostname. |
| GET | /site/path_list | Autocomplete-style list of paths. Use with search. |
| GET | /site/status-pages | Pages broken down for a given status_code. |
| GET | /site/status-codes | Distribution of HTTP status codes. |
5. Sources & Channels
| Method | Path | Description |
|---|---|---|
| GET | /site/sources | Top traffic sources. |
| GET | /site/channels | Channel grouping (organic, paid, direct, referral, …). |
| GET | /site/referrers | Raw referrer URLs. |
| GET | /site/utm/source | UTM source breakdown. |
| GET | /site/utm/medium | UTM medium breakdown. |
| GET | /site/utm/campaign | UTM campaign breakdown. |
| GET | /site/utm/content | UTM content breakdown. |
| GET | /site/utm/term | UTM term breakdown. |
6. Tech & Geo
| Method | Path | Description |
|---|---|---|
| GET | /site/browsers | Browser breakdown. |
| GET | /site/os | Operating system breakdown. |
| GET | /site/devices | Device-type breakdown (desktop/mobile/tablet). |
| GET | /site/countries | Visitor countries. |
| GET | /site/regions | States / regions. |
| GET | /site/cities | Cities. |
| GET | /site/top-cities | Top 50 cities (lighter payload for sparkline UI). |
7. Goals & Custom
| Method | Path | Description |
|---|---|---|
| GET | /site/goals | List goals for the site. |
| GET | /site/goal | Fetch one goal (?id=…). |
| POST | /site/goal | Create a goal. |
| PUT | /site/goal | Update a goal. |
| DELETE | /site/goal | Delete a goal. |
| GET | /site/goals_stats | Conversion stats per goal. |
| GET | /site/events | Custom events report. |
| GET | /site/custom_event_list | List of distinct event names. |
| GET | /site/props/keys | Distinct custom property keys. |
| GET | /site/props/values | Distinct values for ?prop=key. |
8. Site Settings & GA4
| Method | Path | Description |
|---|---|---|
| GET / PUT | /site/settings/blacklisted-ips | IP blocklist. |
| GET / PUT | /site/settings/hostnames | Hostname allowlist. |
| PUT | /site/settings/public-dashboard | Toggle public dashboard. |
| GET | /auth/ga4/connect | Begin GA4 OAuth (CSRF-protected). |
| GET | /ga4/properties | List GA4 properties for the connected account. |
| GET | /ga4/imports/site/{hash} | Imports for a given site. |
| GET | /ga4/site/{hash}/imported-data | Imported data summary. |
| DELETE | /ga4/site/{hash}/imported-data | Remove imported GA4 data. |
Worked examples
GET /site/top-stats
{
"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,422mean 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.