Skip to content

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.

Terminal
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.

ParameterValues
periodtoday, yesterday, 24h, 7d (default), 30d, 90d, mtd, lastmonth, ytd, 12mo, all, custom
from, toYYYY-MM-DD in the site’s timezone, inclusive, with period=custom
compareprevious (default), year, none
intervalminute, hour, day, week, month (chosen for you when omitted)
fRepeatable 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

GET/api/sites/:siteId/stats/:report
ReportExtra parametersReturns
overviewKPIs, previous period, timeseries, online now
timeseriesVisitors, visits, pageviews, bounce, duration, conversions, revenue per bucket
breakdowndim, limit, page, searchRows for a dimension with share and change
heatmapVisitors by weekday × hour
eventsevent, propEvents, or one event’s props
goalsConversions per goal
funnelid, or steps (JSON), window, dimSteps, drop-off, median times, live count per step
retentioninterval, cohortsCohort grid
pathsstart, goal or end, depthJourneys (Sankey links)
vitalsp75 and rating split per metric, score, pages
errorsGrouped JavaScript errors
engagementpathScroll depth, rage, dead and top clicks, outbound links
revenueRevenue by channel, source, campaign, country, page
aiAI-assistant traffic per assistant, AI vs other visitors
Terminal
# 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"
GET/api/sites/:siteId/explain?metric=Drivers of a change (visitors, pageviews, sessions, conversions, revenue, bounceRate)
GET/api/sites/:siteId/insightsAnomalies and the digest

Live data

GET/api/sites/:siteId/liveSnapshot: online visitors, recent events, counters
GET/api/sites/:siteId/live/streamServer-Sent Events: snapshot, then deltas
GET/api/sites/:siteId/live/replay?from=&to=Events of a range (≤ 7 days) with a 60-bucket histogram
Terminal
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 s

Message 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

GET/api/sites/:siteId/sessionsVisits, newest first (cursor, limit + query parameters)
GET/api/sites/:siteId/sessions/:sessionIdOne visit with its event timeline
GET/api/sites/:siteId/visitors/:visitorIdVisitor profile

Configuration

ResourceEndpoints
SitesGET/POST /api/sites · GET/PATCH/DELETE /api/sites/:siteId
GoalsGET/POST /api/sites/:siteId/goals · PATCH/DELETE …/goals/:goalId
FunnelsGET/POST /api/sites/:siteId/funnels · PATCH/DELETE …/funnels/:funnelId
AlertsGET/POST /api/sites/:siteId/alerts · PATCH/DELETE …/alerts/:alertId · POST …/test
AnnotationsGET/POST /api/sites/:siteId/annotations · PATCH/DELETE …/:annotationId
SharingPOST (enable or rotate) / DELETE /api/sites/:siteId/share
Tracking healthGET /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

GET/api/sites/:siteId/export?report=&format=CSV or JSON of any report, or format=jsonl for raw events
Terminal
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.jsonl

Errors

Errors use HTTP status codes and one JSON shape:

{ "error": { "code": "not_found", "message": "Site not found" } }
StatusMeaning
400Invalid parameter (the message names it)
401Missing or invalid key
403Not allowed (for example a write with a share token)
404Unknown site, or a site you don’t own
429Too many requests; retry after the Retry-After header