Platform
REST API
Authenticate with an API key and query every report, live data and exports over HTTP.
The REST API is the same one the dashboard uses: every report, live data, sessions, configuration and exports, as JSON. Requests are not metered on a self-hosted server.
Authentication
Create a key in Settings → API keys. It starts with glb_ and is shown once: Globatics only keeps its hash. Send it as a Bearer token. A key acts as its owner, on the sites they own.
export GLOBATICS_KEY=glb_YOUR_KEY
curl https://globatics.live/api/sites \
-H "Authorization: Bearer $GLOBATICS_KEY"Public share tokens also work for read-only endpoints (reports, live, sessions), with ?share=TOKEN or an x-share-token header. Identities are stripped from those responses.
Query parameters
Every report accepts the same parameters as the dashboard URL.
| Parameter | Values |
|---|---|
period | today, yesterday, 24h, 7d (default), 30d, 90d, mtd, lastmonth, ytd, 12mo, all, custom |
from, to | YYYY-MM-DD in the site’s timezone, inclusive, with period=custom |
compare | previous (default), year, none |
interval | minute, hour, day, week, month (chosen for you when omitted) |
f | Repeatable filter dim:op:value, op is is, is_not, contains or not_contains. Example: f=country:is:FR |
Filter dimensions: page, entry_page, exit_page, hostname, referrer, channel, utm_source, utm_medium, utm_campaign, utm_term, utm_content, country, region, city, device, browser, os, screen, language, event, goal.
Reports
| Report | Extra parameters | Returns |
|---|---|---|
overview | KPIs, previous period, timeseries, online now | |
timeseries | Visitors, visits, pageviews, bounce, duration, conversions, revenue per bucket | |
breakdown | dim, limit, page, search | Rows for a dimension with share and change |
heatmap | Visitors by weekday × hour | |
events | event, prop | Events, or one event’s props |
goals | Conversions per goal | |
funnel | id, or steps (JSON), window, dim | Steps, drop-off, median times, live count per step |
retention | interval, cohorts | Cohort grid |
paths | start, goal or end, depth | Journeys (Sankey links) |
vitals | p75 and rating split per metric, score, pages | |
errors | Grouped JavaScript errors | |
engagement | path | Scroll depth, rage, dead and top clicks, outbound links |
revenue | Revenue by channel, source, campaign, country, page | |
ai | AI-assistant traffic per assistant, AI vs other visitors |
# top 10 pages from France this month
curl -G https://globatics.live/api/sites/SITE_ID/stats/breakdown \
-H "Authorization: Bearer $GLOBATICS_KEY" \
--data-urlencode "dim=page" --data-urlencode "limit=10" \
--data-urlencode "period=mtd" --data-urlencode "f=country:is:FR"
# why did visitors change this week?
curl -G https://globatics.live/api/sites/SITE_ID/explain \
-H "Authorization: Bearer $GLOBATICS_KEY" \
--data-urlencode "metric=visitors" --data-urlencode "period=7d"Live data
curl -N https://globatics.live/api/sites/SITE_ID/live/stream \
-H "Authorization: Bearer $GLOBATICS_KEY"
# event: snapshot data: {"type":"snapshot","snapshot":{…}}
# event: event data: {"type":"event","event":{…}}
# event: counters data: {"type":"counters","counters":{…}} every 5 sMessage types: snapshot, visitor.upsert, visitor.leave, event, counters, moment, narration. Filters (f=) apply on the server. A : ping comment is sent every 15 seconds.
Sessions and visitors
Configuration
| Resource | Endpoints |
|---|---|
| Sites | GET/POST /api/sites · GET/PATCH/DELETE /api/sites/:siteId |
| Goals | GET/POST /api/sites/:siteId/goals · PATCH/DELETE …/goals/:goalId |
| Funnels | GET/POST /api/sites/:siteId/funnels · PATCH/DELETE …/funnels/:funnelId |
| Alerts | GET/POST /api/sites/:siteId/alerts · PATCH/DELETE …/alerts/:alertId · POST …/test |
| Annotations | GET/POST /api/sites/:siteId/annotations · PATCH/DELETE …/:annotationId |
| Sharing | POST (enable or rotate) / DELETE /api/sites/:siteId/share |
| Tracking health | GET /api/sites/:siteId/tracking-health |
Ask
POST /api/sites/:siteId/ask answers a question in plain language and streams the answer as Server-Sent Events. It is for signed-in owners in the dashboard; agents should use the MCP server.
Export
curl -G https://globatics.live/api/sites/SITE_ID/export \
-H "Authorization: Bearer $GLOBATICS_KEY" \
--data-urlencode "format=jsonl" --data-urlencode "period=30d" -o events.jsonlErrors
Errors use HTTP status codes and one JSON shape:
{ "error": { "code": "not_found", "message": "Site not found" } }| Status | Meaning |
|---|---|
| 400 | Invalid parameter (the message names it) |
| 401 | Missing or invalid key |
| 403 | Not allowed (for example a write with a share token) |
| 404 | Unknown site, or a site you don’t own |
| 429 | Too many requests; retry after the Retry-After header |