Skip to content

Insights API reference

View Markdown

This endpoint executes a BadgerQL query against your project’s Insights data and returns the results.

Terminal window
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/queries

The following fields can be provided in the request body:

Field nameTypeDescription
querystringA BadgerQL query string to execute against your Insights data
tsstringOptional 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).
timezonestringOptional timezone for timestamp interpretation. Must be a valid IANA timezone identifier (e.g., America/New_York, UTC, Europe/London).
stream_idsarrayOptional list of Insights stream IDs to query. Defaults to all streams on the project. IDs that don’t belong to the project are ignored.

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 nameTypeDescription
resultsarrayArray of objects containing the query results
meta.querystringThe query that was executed
meta.fieldsarrayList of fields included in the results
meta.schemaarraySchema information for each field (name and type)
meta.row_countnumberNumber of rows returned in this response
meta.total_countnumberTotal number of rows matching the query
meta.start_atstringStart of the time range for the query
meta.end_atstringEnd of the time range for the query

Please see the BadgerQL guide for the query syntax to use for the query field.