trend_get
Retrieve hourly aggregated min, average, and max trend values for Zabbix items over long time ranges. Filter by item IDs and time bounds to get a compact view without pulling full history.
Instructions
Retrieve trend data (hourly aggregated min/avg/max values). Trends are calculated from history and provide a compact, long-term view of metric behaviour. Each record covers a one-hour period and includes the minimum, average, and maximum values as well as the number of values collected. Use trends instead of history for time ranges spanning days or more to reduce data volume. Filter by 'itemids' and use 'time_from' / 'time_till' to bound the time range. The item IDs have to be looked up first with item_get (output itemid, name, key_, value_type, units); only numeric items (value_type 0 or 3) have trends. trend.get cannot sort: the hours come oldest first, so a 'limit' keeps the start of the period; bound the period with 'time_from' / 'time_till' instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of results to return. | |
| output | No | Properties of the trend object to return. Pass 'extend' for all, 'count' for the number of matches only, or a list of property names. Default when omitted: 'extend'. Properties: clock, itemid, num, value_avg, value_max, value_min. | |
| server | No | Target Zabbix server. Available: default. Defaults to 'default' if omitted. | |
| itemids | No | Return only trend data for the given item IDs (from item_get; never guessed). Needed for a scoped answer: without them the call returns trends of every item. | |
| raw_json | No | Strips the security disclaimer preamble from the response so it is pure JSON. Default: false. Requires the bearer token to have 'allow_raw_json' explicitly enabled by an operator in the admin portal - tokens without that policy receive a PolicyError instead. WARNING: setting true bypasses the prompt-injection mitigation marker that wraps untrusted Zabbix data (host names, item descriptions, problem text). LLM clients (Claude, GPT, Cursor, ...) should leave this false; only programmatic non-LLM consumers (Python scripts, n8n workflows that json.loads the result) should set true. | |
| time_from | No | Return only trend data after this time (Unix timestamp, ISO 8601 date-time such as 2026-04-01T08:00:00Z, or a relative time such as now-1h, now/d or now-7d/d; a value without a zone is read in the zone resolved for the call) (inclusive). | |
| time_till | No | Return only trend data before this time (Unix timestamp, ISO 8601 date-time such as 2026-04-01T08:00:00Z, or a relative time such as now-1h, now/d or now-7d/d; a value without a zone is read in the zone resolved for the call) (inclusive). | |
| countOutput | No | Return the count of matching results instead of the actual data. | |
| extra_params | No | Other native trend.get parameters, merged into the request as-is. trend.get has no parameters beyond the typed ones. Any other key is refused here, because Zabbix would silently ignore it. For a parameter you are sure exists on your release but is not listed, use zabbix_raw_api_call. |