Insights API reference
Query Insights data
Section titled “Query Insights data”This endpoint executes a BadgerQL query against your project’s Insights data and returns the results.
curl -u AUTH_TOKEN: -X POST -H 'Content-type: application/json' -d '{"query":"fields @ts, @preview | limit 3"}' https://app.honeybadger.io/v2/projects/ID/insights/queriesThe following fields can be provided in the request body:
| Field name | Type | Description |
|---|---|---|
query | string | A BadgerQL query string to execute against your Insights data |
ts | string | Optional timestamp range (defaults to PT3H). Accepts shortcuts (today, week) or ISO 8601 formats: durations (P8D), datetimes (2021-12-14T22:14:08), time intervals (2021-12-10T00:00/2021-12-12T00:00), or duration intervals (P1W/P0D). |
timezone | string | Optional timezone for timestamp interpretation. Must be a valid IANA timezone identifier (e.g., America/New_York, UTC, Europe/London). |
Returns the query results with the following format:
{ "results": [ { "@ts": "2025-11-18 11:40:05.802", "@preview": "{\"ctx.class\":\"UptimeWorker\",\"ctx.elapsed\":0.297,\"ctx.jid\":\"aed85cd96b60c142b8c9b835\",\"lvl\":\"INFO\",\"msg\":\"done\",\"pid\":1,\"tid\":\"1knd\"}" }, { "@ts": "2025-11-18 11:40:05.812", "@preview": "{\"ctx.class\":\"UptimeWorker\",\"ctx.elapsed\":0.198,\"ctx.jid\":\"dfb0be7609bb3d4747efb5fd\",\"lvl\":\"INFO\",\"msg\":\"done\",\"pid\":1,\"tid\":\"1kp5\"}" }, { "@ts": "2025-11-18 11:40:05.813", "@preview": "{\"ctx.class\":\"FaultMetricWorker\",\"ctx.elapsed\":0.22,\"ctx.jid\":\"f1f3b3a9b9d874ba82e97590\",\"lvl\":\"INFO\",\"msg\":\"done\",\"pid\":1,\"tid\":\"1ksp\"}" } ], "meta": { "query": "fields @ts, @preview | limit 3", "fields": [ "@ts", "@preview" ], "schema": [ { "name": "@ts", "type": "datetime" }, { "name": "@preview", "type": "json" } ], "row_count": 3, "total_count": 3, "start_at": "2025-11-18 11:11:26", "end_at": "2025-11-18 14:11:26" }}The response includes:
| Field name | Type | Description |
|---|---|---|
results | array | Array of objects containing the query results |
meta.query | string | The query that was executed |
meta.fields | array | List of fields included in the results |
meta.schema | array | Schema information for each field (name and type) |
meta.row_count | number | Number of rows returned in this response |
meta.total_count | number | Total number of rows matching the query |
meta.start_at | string | Start of the time range for the query |
meta.end_at | string | End of the time range for the query |
Please see the BadgerQL guide for the query syntax to use for the query field.