Skip to content

API

The API reads projects, visits, events and figures, for scripts and dashboards of your own.

Issue a token with abilian-analytics token issue you@example.com (it is shown once), then send it as a bearer token:

curl -H "Authorization: Bearer <token>" https://analytics.example.com/api/v1/projects

A token acts as its account, and reaches the projects it owns.

Endpoint Returns
GET /api/v1/me The token's account
GET /api/v1/projects Its projects, with their figures over the last 30 days
GET /api/v1/projects/{id}/stats A project's figures between start and end: ISO dates or datetimes, UTC unless an offset is given; the last 30 days by default
GET /api/v1/projects/{id}/visits Its visits, the latest first, those left out included
GET /api/v1/projects/{id}/events Its events, the latest first
  • Every endpoint and its parameters are documented at /docs on your instance.
  • The version is in the path (/api/v1): a change that would break clients comes as /api/v2.
  • Lists are paged: limit, at most 1,000, and offset.
  • The stats endpoint covers at most 50 years per call, and takes the same filters as the reports: site, page, referrer, country, device, browser, os, event.