API reference

REST API: authentication, errors and rate limits

Send goals, payments and crawler hits from your server with a website API key: the base URL, authentication, endpoints, error codes and rate limits.

The REST API is for your server: send goals, payments and crawler hits. Base URL:

https://supranalytics.app/api/v1

Authentication

Use a website API key, from the website's Settings → API. Keys start with pk_, belong to one website, and can be named, rolled and deleted (up to 20). Send it as a bearer token:

Authorization: Bearer pk_YOUR_KEY
Content-Type: application/json

Keep keys on your server. The API has no CORS, on purpose: it's not meant to be called from browsers.

Endpoints

EndpointWhat it does
POST /api/v1/goalsRecord a goal for a visitor.
POST /api/v1/paymentsRecord a payment, a renewal or a refund.
POST /api/v1/crawlRecord crawler hits.

Errors

StatusMeaning
400A field is missing or invalid. The body says which: { "error": "…" }
401Missing or wrong API key: { "error": "Invalid API key" }
404Not found (for goals: the visitor has no visits yet).
429Too many requests. Wait the number of seconds in the Retry-After header.

Rate limits

3,000 requests a minute per key.

Reading your data

To read reports from code, use the read API with an account API key. From a terminal, use the CLI. For an AI assistant, use the MCP server.

AI agent or LLM? Read this page as Markdown