Skip to main content
Use the aggregation endpoint to summarize and analyze data by computing advanced metrics and bucketed distributions. For example, you can use the aggregation endpoint to generate data for dashboards and summaries, create numeric summaries, and obtain grouped statistical insights. The aggregation endpoint supports:
  • Group by: partition or group data based on specified properties. For instance, to see the average temperature for equipment, you can group by the equipment property.
  • Aggregation functions: compute metrics on the grouped data. This includes calculating sums, averages, minimums, maximums, counts, and histograms.
  • Filters and sorting: like the search endpoint, the aggregation endpoint supports filtering and sorting. This allows you to refine your data set before performing aggregations.

Recommendations

  • Combine filters and aggregations: to minimize the volume of data to process, always apply filters before running aggregations.
  • Use groupBy efficiently: restrict grouping to properties that are meaningful for your analysis. Excessive grouping can make results difficult to interpret and reduce performance.
  • Understand tokenization for text queries: when searching for text, refer to the search endpoint’s tokenization rules.
  • Plan around indexing delays: because of indexing delays, it may take a few seconds for new or updated data to be available for aggregation.

Example aggregation request

The aggregation request below groups by equipment and computes an average of the temperature property.
Example aggregation request
Where:
  • view: defines which view the query will read from. Required.
  • aggregates: lists one or more aggregation operations. Maximum five operations in a single request.
  • groupBy: is an array of property names used for grouping.
  • query and properties: combine to perform text-based matching on the specified properties (name, description).
  • filter: restricts data before aggregation. Only results with temperature between 15 and 25 are included.

Aggregating a single type

The examples below show different aggregations for a type called Company with these properties:

Average head_count across all companies

Calculate the average head_count across every company in the dataset.
Request
Response

Average head_count grouped by industry

Group companies by industry and compute the average head_count for each distinct industry value.
Request
Response

Histogram aggregation

Use the histogram function to divide a numeric property (head_count) into buckets. Below, each bucket has a width of 10. The result shows how many companies fall into each bucket, grouped by industry.
Request
Response (abbreviated)

Text search within an aggregation

Similar to the search endpoint, you can combine text-based queries with aggregations. You can also use the operator field to control whether all ("AND") or any ("OR") query terms must match. See Search features documentation for details. This example computes the average head_count for companies where name starts with “Inc”.
Request
Response

GraphQL examples

You can also perform the examples above through the GraphQL API as well:
Last modified on April 23, 2026