Skip to main content
GET

Get Analytics with Comparison

Returns comprehensive analytics data along with comparisons to the previous period of the same length.
This endpoint is only accessible to users with manager or admin roles.

Request

string
required
Bearer token from authentication
string
default:"30d"
Time range for analytics. Options: 7d, 30d, 90dThe comparison is made against the previous period of the same length. For example, 30d compares the last 30 days to the 30 days before that.

Response

The response includes all fields from the base analytics endpoint, plus a comparisons object.

Comparison Object

Each comparison contains:
number
Current period value
number
Previous period value
number
Absolute change (current - previous)
number
Percentage change from previous period
string
Trend indicator: up, down, or stable
  • up: changePercent > 5%
  • down: changePercent < -5%
  • stable: -5% to +5%

Available Comparisons