Skip to content

A site's visitors, pageviews and breakdowns for a range

GET/api/v1/analytics/stats

Needs deploy.manage. Ranges over 31 days come from the daily totals: source is daily and the breakdowns they do not keep are listed in unavailable.

Needs an API key in the Authorization header.

On this page

Parameters

FieldInTypeDescription
scopeTyperequiredquerystring
  • one of: application, polaris, external
scopeIdquerystring
  • max length: 64
rangerequiredquerystring
  • one of: 24h, 7d, 30d, 90d, 12m
filtersquerystring
JSON list of filters, as the Analytics address carries them
  • max length: 4000
comparequerystring
  • one of: previous, year
breakdownquerystring
Comma list of breakdowns; all when omitted
  • max length: 400

Example request

curl -X GET "https://polaris.example.com/api/v1/analytics/stats" \
  -H "Authorization: Bearer $POLARIS_API_KEY"

Responses

StatusMeaning
200OK

Can also answer the common errors 400, 401, 403, 404, 429. See common errors