Search API: Get counts, breakdowns, and trends in one call
Beginning in Orange Logic Rome, the Search API has an Aggregate endpoint that calculates counts, groupings, and metrics in a single call. It uses the same query grammar and field names as Search.
Use the endpoint to create KPI counts, breakdowns for pie and bar charts, and date-histogram time series. You can also calculate distinct counts and metrics using aggregation functions such as sum, avg, min, and max, without paging through search results or performing calculations client-side.
Aggregations include only records the caller is authorized to see. The server also resolves display values, so result buckets contain readable labels instead of internal IDs. A companion ListAggregatableFields endpoint identifies the fields available for aggregation and the functions each field supports. Both endpoints use the existing CanUseSearchAPI Security Function; no additional permission is required.

