Analytics Comparisons
Use the analytics endpoint when OpenClaw needs a direct comparison between the current window and a previous window for one event definition.
When to use analytics
Use analytics when the task is:
- compare the last hour with the previous hour
- compare the last hour with the same hour yesterday
- compare the last day with the same day last month
- inspect percent change or delta before deciding whether to alert
Do not invent new event names for these comparisons. Keep the stable agent + event identity and query analytics on the existing event definition.
Endpoint
GET /v1.0/events/:eventID/analyticsUse:
view=windowperiod=1h|1d|7d|1mprevious=previous_window|previous_1d|previous_7d|previous_1m
OpenClaw examples
tool.errors.countlast hour vs previous hourtask.duration_mslast hour vs same hour yesterdaytokens.usedlast day vs previous day
Example request:
Raw API
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_window"Analytics vs policies
- use analytics when you need comparison data
- use policies when you need threshold-based alerting
- use dashboards or the public dashboard page when a human needs to inspect trends directly
For the generic contract, see Analytics API. For the OpenClaw workflow layer, continue with Starter Dashboards and Destinations for OpenClaw Alerts.
Last updated on