> For the complete documentation index, see [llms.txt](https://docs.butlr.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.butlr.io/integrations-api-third-party-sensors/reporting-api/query-limits.md).

# Query Limits

## Time range limits

`stop` − `start` may not exceed the limit for the interval:

| Interval | Max range  | Max range with `fill_gaps` |
| -------- | ---------- | -------------------------- |
| `1m`     | 7 days     | not supported              |
| `5m`     | 60 days    | 10 days                    |
| `15m`    | 180 days   | 30 days                    |
| `30m`    | 180 days   | 90 days                    |
| `1h`     | 730 days   | 180 days                   |
| `1d`     | 1,825 days | 730 days                   |

Some measurements have an extra cap at every interval:

* [Temperature](/integrations-api-third-party-sensors/reporting-api/temperature.md) and [door/window activity](/integrations-api-third-party-sensors/reporting-api/door-window-activity.md): **180 days**
* Events ([touch events](/integrations-api-third-party-sensors/reporting-api/touch-events.md), [cleaning alerts](/integrations-api-third-party-sensors/reporting-api/cleaning-alerts.md)): **730 days** (the interval limits above don't apply to events)

A range over any limit returns `400` with code `-5012`. The error names the interval or measurement that is over.

Limits are exact elapsed time: a date-only range in a time zone that crosses a daylight-saving change can be one hour longer than the number of days suggests.

## How far back data goes

The limits above cap the *width* of a range. How far back you can reach depends on the measurement and interval:

| Data                                                            | Available for about                                       |
| --------------------------------------------------------------- | --------------------------------------------------------- |
| Occupancy and door/window activity at `1m`                      | The last 120 days                                         |
| Occupancy at `15m` / `30m`                                      | The last 180 days                                         |
| Temperature (any interval), door/window activity (`15m` and up) | The last 180 days. Temperature data starts on 2026-09-09. |
| Occupancy at `1h` / `1d`, `dt_heartbeat`, events                | Beyond 180 days, from long-term storage                   |

Requests for periods outside these windows are valid but return no data for them.

For events, if a range reaches back further than can be served, the request fails with `-5012` rather than returning partial data.

## Other limits

| Limit           | Value                                                                                  |
| --------------- | -------------------------------------------------------------------------------------- |
| `items`         | 500                                                                                    |
| `exclude_items` | 500                                                                                    |
| `fields`        | 50                                                                                     |
| Result size     | 1,000,000 rows per measurement per storage tier (`-5016` above that)                   |
| Rate            | See [Rate limits](/integrations-api-third-party-sensors/authentication.md#rate-limits) |
