Skip to Content
API ReferenceAnalytics API

Analytics API

Use the analytics endpoint when you need a precomputed window comparison for a single event definition.

Endpoint:

GET /v1.0/events/:eventID/analytics

Required query parameters:

  • view=window
  • period=1h|1d|7d|1m
  • previous=previous_window|previous_1d|previous_7d|previous_1m

Supported window combinations

PeriodPreviousWhat it compares
1hprevious_windowThis hour vs the previous hour
1hprevious_1dThis hour vs the same hour yesterday
1hprevious_7dThis hour vs the same hour 7 days ago
1hprevious_1mThis hour vs the same hour 30 days ago
1dprevious_windowToday vs yesterday
1dprevious_7dToday vs the same day last week
1dprevious_1mToday vs the same day last month
7dprevious_windowThis week vs last week
7dprevious_1mThis week vs the same week last month
1mprevious_windowThis month vs last month

If a combination is not supported, the API returns 400.

Example request

curl -G https://api.chirpier.co/v1.0/events/$EVENT_ID/analytics \ -H "Authorization: Bearer $CHIRPIER_API_KEY" \ --data-urlencode "view=window" \ --data-urlencode "period=1h" \ --data-urlencode "previous=previous_7d"

Example response

{ "event_id": "f6d2cf72-9f46-4f19-84fb-ff8f8e97d095", "view": "window", "period": "1h", "previous": "previous_7d", "data": { "current_value": 1280, "current_count": 64, "previous_value": 910, "previous_count": 52, "value_delta": 370, "count_delta": 12, "value_pct_change": 40.65934065934066, "count_pct_change": 23.076923076923077, "current_mean": 20, "previous_mean": 17.5, "mean_pct_change": 14.285714285714285, "mean_delta": 2.5, "current_stddev": 6.1, "previous_stddev": 5.4 } }

Response fields

FieldDescription
current_valueSum of all values in the current window
current_countNumber of logs in the current window
current_meanAverage value per log (current_value / current_count)
current_stddevEstimated standard deviation from aggregated squares
previous_valueSum of all values in the comparison window
previous_countNumber of logs in the comparison window
previous_meanAverage value per log in the comparison window
previous_stddevStandard deviation in the comparison window
value_deltacurrent_value - previous_value
count_deltacurrent_count - previous_count
mean_deltacurrent_mean - previous_mean
value_pct_changePercentage change in value relative to the previous window
count_pct_changePercentage change in count relative to the previous window
mean_pct_changePercentage change in mean relative to the previous window

The response field names do not change by comparison type. For example, period=1h&previous=previous_7d still returns previous_value, not last_week_value.

Reading the response

Using the example response above (period=1h, previous=previous_7d):

  • Total value this hour: 1280 (sum of all logged values)
  • Total value same hour last week: 910
  • Value is up 40.7% from the same hour 7 days ago (value_pct_change)
  • Average per log: 20 now vs 17.5 last week, a 14.3% increase (mean_pct_change)
  • Volume: 64 logs now vs 52 last week, 23% more activity (count_pct_change)
  • Spread: standard deviation widened slightly (6.1 vs 5.4), meaning values are a bit more variable

If data is null, there were no logs in either window.

Notes

  • use previous, not compare
  • analytics windows are separate from rollup periods like minute, hour, and day
  • day and larger windows respect the event definition timezone
  • public event sharing uses event_id together with share_token, but analytics reads still use the authenticated control-plane API

Use API Reference for the broader control-plane contract, Event Taxonomy for generic naming guidance, chirpier-skills for the agent workflow layer, and Canonical Event Names for the OpenClaw-specific path.

Last updated on