API Reference
The Antlytics API lets you read your analytics data programmatically — useful for building dashboards, automations, and AI tool integrations.
Base URL: https://www.antlytics.com/api/v1
Authentication
All requests require an API token in the Authorization header:
Authorization: Bearer ant_<your-token>
Create tokens in Settings → API tokens. Each token is shown once — copy it to a secure location immediately.
Rate limits
60 requests per minute per token. Exceeded requests receive 429 Too Many Requests with a Retry-After header.
Endpoints
GET /v1/stats
Summary statistics for a site over a time range.
Query parameters:
| Parameter | Required | Description |
|---|---|---|
site_id | Yes | UUID of the site |
from | No | ISO 8601 datetime (inclusive) |
to | No | ISO 8601 datetime (exclusive) |
Response:
{
"visitors": 1240,
"pageviews": 3820,
"bounce_rate": 42,
"sessions": 1240
}
Example:
curl "https://www.antlytics.com/api/v1/stats?site_id=YOUR_SITE_ID&from=2024-01-01T00:00:00Z&to=2024-02-01T00:00:00Z" \
-H "Authorization: Bearer ant_YOUR_TOKEN"
GET /v1/pages
Top pages by pageviews for a site.
Query parameters:
| Parameter | Required | Default | Description |
|---|---|---|---|
site_id | Yes | — | UUID of the site |
from | No | — | ISO 8601 datetime |
to | No | — | ISO 8601 datetime |
limit | No | 10 | 1–100 |
Response:
[
{ "path": "/", "pageviews": 1820, "visitors": 940 },
{ "path": "/pricing", "pageviews": 410, "visitors": 310 }
]
Example:
curl "https://www.antlytics.com/api/v1/pages?site_id=YOUR_SITE_ID&limit=5" \
-H "Authorization: Bearer ant_YOUR_TOKEN"
GET /v1/referrers
Top referrers by visit count for a site.
Query parameters:
| Parameter | Required | Default | Description |
|---|---|---|---|
site_id | Yes | — | UUID of the site |
from | No | — | ISO 8601 datetime |
to | No | — | ISO 8601 datetime |
limit | No | 10 | 1–100 |
Response:
[
{ "referrer": "google.com", "visits": 620 },
{ "referrer": "reddit.com", "visits": 180 }
]
Example:
curl "https://www.antlytics.com/api/v1/referrers?site_id=YOUR_SITE_ID" \
-H "Authorization: Bearer ant_YOUR_TOKEN"
Error responses
All errors return JSON:
{ "error": "Unauthorized" }
| Status | Meaning |
|---|---|
401 | Missing or invalid token |
404 | Site not found or doesn't belong to this token |
422 | Invalid query parameters |
429 | Rate limit exceeded |
Something missing? Get in touch and we will update these docs.