Skip to content

Query data in tabular format

Returns requested dimensions and metrics as either JSON array or CSV table. Data is limited by default to 1000 entries and pagination information can be found from X-Zoined-* headers.

Query data as JSON

Request

POST https://api.zoined.com/v2/query/table

Retrieve tabular data in JSON format (flat array with one element per group).

Security
bearerAuth
Bodyapplication/json
contextobject

Context for the queries

Example:
{ "locale": "en", "currency": "EUR" }
queryobject

Query parameters

Example:
{ "grouping": [ "day", "store" ], "metrics": [ "sales", "sales_margin" ], "filters": {}, "seriesType": "actual", "sort": [ "day" ], "limit": 1000, "offset": 0, "label": "forecast", "fillTimeSeries": true }
curl -i -X POST \
  https://zapi-api.zoined.com/_mock/v2/query/table \
  -H 'Authorization: Bearer <YOUR_token_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "context": {
      "locale": "en",
      "currency": "EUR"
    },
    "query": {
      "grouping": [
        "day",
        "store"
      ],
      "metrics": [
        "sales",
        "sales_margin"
      ],
      "filters": {},
      "seriesType": "actual",
      "sort": [
        "day"
      ],
      "limit": 1000,
      "offset": 0,
      "label": "forecast",
      "fillTimeSeries": true
    }
  }'

Responses

Request has been processed successfully.

Headers
X-Zoined-Total-Itemsstring
Example:"30"
X-Zoined-Limitstring
Example:"1000"
X-Zoined-Offsetstring
Example:"0"
Bodyapplication/json
Array [
dimensionsobject

All dimensions from grouping list

metricsobject

Aggregated metric values for set of dimensions

sortobject

List of items (dimension and metrics from above) to be used for sorting

]
Response
[ { "dimensions": { … }, "metrics": { … }, "sort": { … } } ]