Skip to content
trackd.one

API

Collect & read API

Send events directly to the collect endpoint and read statistics with an API key.

Collect endpoint

The script and all SDKs send data to POST /api/collect (alias /api/v1/collect). No authentication — the website ID is the public identifier. Web requests must come from the registered domain or a subdomain.

curl -X POST https://trackd.one/api/collect \
  -H "Content-Type: application/json" \
  -d '{
    "website_id": "YOUR_WEBSITE_ID",
    "context": { "platform": "server", "app_version": "1.0.0" },
    "events": [
      { "type": "screen_view", "name": "Home" },
      { "type": "event", "event_name": "signup", "event_data": { "plan": "pro" } }
    ]
  }'

Apps should send batches (max. 50 events per request); context fields are merged into every event.

Field Types Notes
type all pageview, event, screen_view, app_event, vitals, heatmap, ab_assign, ab_convert
website_id all UUID, required
url pageview, event full URL (web), required for pageview
name screen_view screen name, stored as path /Home
event_name / event_data event max. 200 chars / flat object, max. 4 KB
session_id all optional, ephemeral, in memory only; never persist it
timestamp all optional, for queued events, max. 72 h old

Responses: 202 { "ok": true, "accepted": 3, "rejected": 0 } · 400 invalid · 403 origin mismatch (web) · 404 unknown website · 413 body > 64 KB · 429 rate limit or monthly event limit (Retry-After). Rate limits: 600 requests/min per IP, 120 per IP and website.

API keys

Create a key under Account → API keys (user menu, bottom left) (Pro and above). It is shown only once.

Read API (v1)

curl "https://trackd.one/api/v1/websites/YOUR_WEBSITE_ID/stats?from=2026-01-01T00:00:00Z" \
  -H "Authorization: Bearer tp_xxxxxxxx"
Method Path Result
GET /api/v1/websites all projects
GET /api/v1/websites/:id/stats?from&to key figures
GET /api/v1/websites/:id/timeseries?from&to&interval=day|hour&tz=Europe/Berlin time series
GET /api/v1/websites/:id/top/:field?from&to&limit top list
GET /api/v1/websites/:id/events?from&to events
GET /api/v1/websites/:id/realtime active visitors and pages

:field ∈ pathname referrer country browser os device language hostname utm_source utm_medium utm_campaign platform app_version os_version. Filters: filter_<field>=<value>, e.g. ?filter_platform=android.

Ready in minutes

Create a free account, add your website or app, copy the snippet.

Start for free