v1

latestOpenAPI 3.1.0Apache 2.02026-07-2685126228.9 KB
Queries

Get a Query

Retrieve a query by its ID.

get/1/queries/{datasetSlug}/{queryId}

Response

Success

idstring
breakdownsstring[]

the columns by which to break events down into groups

filter_combination'AND' | 'OR'

Set to "OR" to match ANY filter in the filter list

granularityinteger

The time resolution of the query's graph, in seconds. Given a query time range T, valid values (T/1000...T/1). If left blank, granularity may be set to a sub-second value for queries with short time ranges.

limitinteger

The maximum number of unique groups returned in 'results'. Aggregating many unique groups across a large time range is computationally expensive, and too high a limit with too many unique groups may cause queries to fail completely. Limiting the results to only the needed values can significantly speed up queries. The normal allowed maximum value when creating a query is 1_000. When running 'disable_series' queries, this can be overridden to be up to 10_000, so the maximum value returned from the API when fetching a query may be up to 10_000.

start_timeinteger

Absolute start time of query, in seconds since UNIX epoch. Must be <= end_time.

end_timeinteger

Absolute end time of query, in seconds since UNIX epoch.

time_rangeinteger

Time range of query in seconds. Can be used with either start_time (seconds after start_time), end_time (seconds before end_time), or without either (seconds before now).

compare_time_offset_seconds1800 | 3600 | 7200 | 28800 | 86400 | 604800 | 2419200 | 15724800

When set, offsets the query's time range by this number of seconds into the past, allowing comparison with historical data from an earlier time period. For example, setting this to 86400 (24 hours) will compare current results against data from 24 hours ago.

Note
  • The offset must be greater than or equal to the query's time range duration.
Allowed values
  • same time range as query time range
  • 1800 - 30 minutes
  • 3600 - 1 hour
  • 7200 - 2 hours
  • 28800 - 8 hours
  • 86400 - 24 hours
  • 604800 - 7 days
  • 2419200 - 28 days
  • 15724800 - 6 months
usage_modeboolean

If true, query results will return aggregates without correcting for sample rates. This is useful for understanding the actual volume of data stored rather than the estimated original event counts. By default, aggregates are adjusted to reflect the estimated original event volume based on sample rates. Note: This field is not supported for triggers.