Aggregate

Aggregation/Groupby of a collection using an aggregation query.
The aggregation query is a json body that follows the schema of:

{
"groupby" : [
{"name":

  • "groupby" is the fields you want to split the data into. These are the available groupby types:
    • category" : groupby a field that is a category
    • numeric: groupby a field that is a numeric
  • "metrics" is the fields you want to metrics you want to calculate in each of those, every aggregation includes a frequency metric. These are the available metric types:
    • For single fields: "avg"/"average"/"mean", "cardinality", "count", "kurtosis", "max", "min", "percentiles", "kurtosis", "std_deviation", "std_deviation_bounds", "sum", "sum_of_squares", "variance"
    • For multiple fields (the attribute "fields" must be used instead of "field"): "correlation", "covariance", "kurtosis", "mean", "skewness", "variance"

The response returned has the following in descending order.

IF you want to return documents, specify a "group_size" parameter and a "select_fields" parameter if you want to limit the specific fields chosen.
This looks as such:

{
'groupby':[
{'name':'Manufacturer','field':'manufacturer','agg':'category',
'group_size': 10, 'select_fields': ["name"]},
],
'metrics':[
{'name':'Price Average','field':'price','agg':'avg'},
],
}

{"title": {"title": "books", "frequency": 200, "documents": [{...}, {...}]}, {"title": "books", "frequency": 100, "documents": [{...}, {...}]}}

For array-aggregations, you can add "agg": "array" into the aggregation query.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required
length ≤ 240
^[a-zd._-]+$

ID of dataset

Body Params
aggregation_query
object

Aggregation query to aggregate data

filters
array
Defaults to []

Query for filtering the search results

filters
number
Defaults to 20

Size of each page of results

number
Defaults to 1

Page of the results

boolean
Defaults to false

Whether to sort results by ascending or descending order.

Response

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json