For developers

Events, REST API, and MCP

Browser events, server events, OpenAPI, and the analytics MCP server.

Browser: window.spx

After the script loads, call window.spx(name, properties). Names max 80 characters; up to 12 properties per event. Names must not start with $ (reserved).

window.spx('identify', userId, traits) sets who later events belong to and does not write an event by itself. Requires identified mode where applicable.

javascript
window.spx?.('signup', { plan: 'pro' });

// Optional queue before the script loads:
window.spx = window.spx || function () { (window.spx.q = window.spx.q || []).push(arguments); };

Server: POST /api/v1/event

Use a full-scope API key. Body needs domain and name. Optional properties, user_id, visitor_id, path, country. Returns 202 when accepted.

Do not invent visitor IPs from your server — omit identity unless you pass a real user id.

The script records two things without being asked: how long each page was on screen, and links that lead off your site (shown as "Outbound link"). A followed link counts as an event; add data-outbound="off" to the script tag to stop recording them.

bash
curl -X POST https://asuito.com/api/v1/event \
  -H "Authorization: Bearer spx_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "yoursite.com",
    "name": "purchase",
    "user_id": "user_4821",
    "properties": { "revenue": 49, "currency": "USD" }
  }'

Read APIs

GET /api/v1/stats/{domain}?range=7d — totals.

GET /api/v1/breakdown/{domain}?dimension=path&range=7d — dimensions: path, referrer, referrerUrl, country, city, device, browser, os, event, source, medium, campaign, term, content.

GET /api/v1/filter-values/{domain}?dimension=path&q=blog — the values a site has recorded, for building a filter that matches something.

GET /api/v1/funnels/{domain} and /api/v1/funnels/{domain}/{funnelId} — each step's users, drop-off and conversion.

GET /api/v1/users/{domain} and /api/v1/users/{domain}/{userId} — the people a site has identified, and one person's recent events.

GET /api/v1/mentions/{domain} — brand mentions.

GET /api/v1/search?q=... — web search through an independent index.

range is one of 1h, 24h, 7d, 30d, 90d, 6m, 12m, or chosen dates as custom_2026-09-01_2026-09-07, read in the site's own timezone. A value that is not understood is refused with a 400, not guessed at. Every answer says how much of the minute's budget is left in X-RateLimit-Remaining.

Badge image and shape endpoints under /api/v1/badge and /b/{domain}.

Full schema: https://asuito.com/openapi.json and https://asuito.com/openapi.yaml. Same dashboard filters often work as query params (e.g. country=DE, path=contains:/blog).

bash
curl "https://asuito.com/api/v1/stats/yoursite.com?range=7d" \
  -H "Authorization: Bearer spx_YOUR_KEY"

curl "https://asuito.com/api/v1/breakdown/yoursite.com?dimension=referrer&range=30d" \
  -H "Authorization: Bearer spx_YOUR_KEY"

MCP server (agents reading analytics)

Streamable HTTP MCP at https://asuito.com/api/mcp. Use a read-only API key. Tools: list_sites, get_traffic, get_breakdown, get_sources, get_top_pages, get_revenue, get_live, get_badge, list_mentions, get_mention_summary, list_keywords, list_funnels, list_goals, recent_events, get_speed, get_site_audit and growth_report. Operators can switch the server off for a whole deployment by setting MCP_DISABLED=1.

This is not Chrome WebMCP. WebMCP actuates the Asuito UI in the browser; /api/mcp reads your numbers over HTTP.

json
{
  "mcpServers": {
    "asuito": {
      "url": "https://asuito.com/api/mcp",
      "headers": { "Authorization": "Bearer spx_YOUR_READONLY_KEY" }
    }
  }
}

Claude Code one-liner

Add the same endpoint with an Authorization header:

bash
claude mcp add --transport http asuito https://asuito.com/api/mcp --header "Authorization: Bearer spx_YOUR_READONLY_KEY"