Skip to main content
TroopyDocs
Open Troopy
Troopy

API reference / Analytics

Get the visitors on the site now

Who is on the site now (a pageview in the last 10 minutes): each visitor's page, rough location, device and source, and the latest pageviews, goals, identifies and payments.

get/api/v1/analytics/realtime

Authorization

HeaderAuthorization: Bearer <API key>
Or the headerX-API-Key: <API key>
API keyMake one in Troopy under Settings > API keys. It acts as you, in its workspace.

Other ways to call it

CLItroopy analytics realtime
MCP tooltroopy_get_analytics_realtime
Rate limit120 calls in 60 seconds, for each key

Response

200 · application/json
data*object
3 properties
visitors*integer
list*array<object>
13 properties
visitor*string
name*string | null

From identify, when the site sent one

page*string
country*string | null
city*string | null
lat*number | null

Rounded to 0.1 degrees

lon*number | null
browser*string | null
os*string | null
device*string | null
referrer*string | null
channel*string
lastSeenAt*string

ISO 8601 date and time

events*array<object>
7 properties
at*string

ISO 8601 date and time

type*string
visitor*string
name*string | null
goal*string | null
page*string
country*string | null

Errors

401 unauthorizedSend an API key as `Authorization: Bearer tr_live_...`. Create one in Troopy under Settings.
403 forbiddenThe key lacks a scope this operation needs, or its owner lacks the role. detail says which; create a key with the scope, or ask an organization owner or admin.
429 rate_limitedWait the number of seconds in Retry-After, then retry.