Documentation
REST API reference and server-side events
Read your analytics as JSON from any server, script or spreadsheet job. Every route lives under /api/v1 and needs an API token.
Create a token
- Open your website in the dashboard and go to Settings → API.
- Choose the scopes the token needs. Bind it to one site if it should only ever see that site.
- Copy the token. It starts with
afx_api_and is shown once, so store it in a secret manager or environment variable.
Send it on every request:
Authorization: Bearer afx_api_...
Browser session cookies are not accepted here, so a missing or wrong token returns 401. Your public Site ID is not a credential either.
| Scope | Allows |
|---|---|
sites:read | List sites and read one site |
analytics:read | Overview, breakdowns, visitors and revenue |
events:write | Send server-side events (POST /api/v1/events) |
payments:write | Send payments and refunds (POST /api/v1/payments) |
identify:write | Attach a user to a visitor (POST /api/v1/identify) |
A workspace token can read every site in its workspace. A site-bound token lists and reads only that site. Any other site returns 404, so a token never confirms that someone else's site exists.
Endpoints
| Method and path | Returns |
|---|---|
GET /api/v1/sites | The sites this token can read |
GET /api/v1/sites/:id | One site |
GET /api/v1/sites/:id/overview | Headline totals (visitors, pageviews, revenue) and a time series |
GET /api/v1/sites/:id/breakdown?dim=source | Top values for one dimension |
GET /api/v1/sites/:id/visitors?search=ada | Recent visitors, optionally filtered |
GET /api/v1/sites/:id/visitors/:visitorId | One visitor's sessions, pages, goals and payments |
GET /api/v1/sites/:id/revenue?dim=source | Revenue, customers and conversion per value |
Date ranges and filters
| Parameter | Values |
|---|---|
period | today, yesterday, 24h, 48h, 7d, 30d, 90d, 12m, all or custom |
from, to | YYYY-MM-DD, used with period=custom (to is optional) |
filters | A JSON object of session fields, such as {"utm_source":"newsletter"} |
limit | Maximum rows for breakdowns and visitor lists |
Breakdown dimensions: channel, source, campaign, keyword, utm_source, utm_medium, utm_content, ref, country, region, city, browser, os, device, entry_page, exit_page, hostname, referrer, page, exit_link and goal.
Revenue dimensions: channel, source, campaign, keyword, utm_source, utm_medium, utm_content, ref, country, device, entry_page and referrer.
Example
curl https://app.analyticfast.com/api/v1/sites/SITE_ID/revenue?dim=source&period=30d \
-H "Authorization: Bearer $ANALYTICFAST_TOKEN"
Money is always integer minor units with an ISO 4217 currency, so 4900 with USD is $49.00. Responses send Cache-Control: no-store. The workspace needs an active plan; a lapsed plan returns an error rather than stale data.
Next: ask the same questions in plain English through the MCP server.
Questions, answered.
How do I use read api with AnalyticFast?
Follow the Read API instructions on this page using your own website’s Site ID and configuration. Verify a real event before relying on the reports.
Where can I get setup help?
Contact support@analyticfast.com with the website domain and a redacted description. Do not send API tokens, signing secrets or personal customer data.