Get realtime
Visitors online in the last 5 minutes, their top pages, referrers and countries, pageviews per minute for the last 30 minutes, and the latest pageviews and goals.
GET https://usedatasense.com/api/v1/analytics/realtime
Permission: analytics:read. MCP tool: datasense_analytics_realtime.
Request
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
websiteId |
query | string | With an account token | The website to query. Required with an account token or OAuth connection that can reach several websites; omit with a ds_sk_ website key. |
recent |
query | integer | No | How many of the latest pageviews and goals to include. Default 15. 0 to 40. |
sh
curl "https://usedatasense.com/api/v1/analytics/realtime" \
-H "Authorization: Bearer ds_sk_xxx"With an account token, add websiteId:
sh
curl "https://usedatasense.com/api/v1/analytics/realtime?websiteId=YOUR_SITE_ID" \
-H "Authorization: Bearer ds_at_xxx"Response
json
{
"status": "success",
"data": { … }
}Errors use the standard error format.