Trace
Settings

API and MCP

Read your analytics programmatically with the REST API, or connect an AI assistant over MCP.

Trace has a read-only REST API for your stats and an MCP endpoint for AI assistants. Both use the same API keys. Settings → API / MCP shows the site's ID and links to where keys are created.

API keys

There are two kinds of key:

KeyWhere to create itActs as
Personal API keyYour Account pageYou, with your own role and site access.
Workspace API keyThe Workspace settings page (admins and owners)An admin on every site in the workspace.

To create one, click Create API Key, give it a name (up to 32 characters) and click Create. Tick Restrict permissions to limit the key to chosen resources (Analytics, Sessions, Events, Users, Goals, Funnels, Session replay, Sites, Workspace), each with read or write access.

The key is shown once — copy it before closing the dialog. Revoke keys you no longer need.

Authentication

Send the key as a bearer token on every request:

curl "https://data.whos1.bid/api/v1/sites" \
  -H "Authorization: Bearer YOUR_API_KEY"

Every endpoint except /sites needs a site_id query parameter — your site's ID, shown in Settings → API / MCP (it's the same as data-website-id).

StatusMeaning
400site_id is missing — list your sites with GET /api/v1/sites.
401The API key is invalid or missing.
403The key's permissions or your role don't allow this.
404The site wasn't found.

Endpoints

Base URL: https://data.whos1.bid/api/v1. Responses are JSON with the results in data; most also include the site name and the resolved date range.

EndpointParametersReturns
GET /sites—Your sites: id, name, domain, timezone.
GET /analytics/overviewrange, optional fieldsOne row with visitors, sessions, pageviews, bounceRate (0–1) and avgSessionDurationSeconds.
GET /analytics/realtime—visitors active in the last 45 seconds.
GET /analytics/breakdowndimension (required), rangeTop values for a dimension (see below).
GET /analytics/goalsrangeEvery goal with visitors (unique conversions), events (total, null for scroll goals) and conversionRate.
GET /analytics/properties—The custom properties shown on the dashboard.
GET /analytics/funnels—Your funnels: id, name, stepsCount.
GET /analytics/funnels/{id}range, optional compare=1The funnel report, optionally compared with the previous period.
curl "https://data.whos1.bid/api/v1/analytics/overview?site_id=YOUR_WEBSITE_ID&range=last7d" \
  -H "Authorization: Bearer YOUR_API_KEY"

Ranges

range accepts now (last 30 minutes), today, yesterday, last24h, last7d, last30d (the default), last12months, weektodate, monthtodate, yeartodate and alltime. Dates follow the site's timezone.

Breakdown dimensions

dimensionReturns
channel, referrer, campaign, keyword, country, region, city, browser, os, deviceThe top 10 values with their visitors.
event:page, visit:entry_page, visit:exit_pageUp to 100 pages with their metrics.
visit:country, visit:region, visit:cityUp to 100 locations with codes, names and metrics.
event:props:<key>Up to 100 values of a custom property, with visitors, events and share.

MCP

Connect an MCP-capable AI assistant to https://data.whos1.bid/api/mcp, sending your API key as a bearer token. It offers these tools:

ToolWhat it does
list_sitesLists the sites the key can read.
get_overviewHeadline stats for a site and range.
get_breakdownTop values for one of the basic dimensions (channel, referrer, campaign, keyword, country, region, city, browser, os, device).
list_goalsGoals with their conversions and conversion rate.

On this page