Stats
How to perform a stats query and how it works
Stats are numeric computations (based on specific operators) calculated over values extracted from a specific field of the selected resource. When performing a stats query on the Metrics API endpoint you get in the response the value of the computation (based on the selected operator
) on the selected field
.
Request
To perform a date breakdown query send a POST
request to the /{{resource_name}}/stats
endpoint specifying the query keys and filter parameters:
Query keys
field
String
The field you want the metrics or statistics computed on.
Response
The response of a stats query returns the value of the computation (based on the operator specified in the operator
key) on the field specified in the field
key. The value type depends on the operator itself — it can be an object made of multiple numeric values (stats
) or a simple integer/float number (any other operator):
Example
The following request performs a stats query to get the average order total amount:
Last updated