Skip to main content

EP. Get Category Metrics Historical Values - CSV

Fetch the historical values of all metrics that are assigned a specific category, in CSV format.

URI

/api/v1/locations/{LOCATION_ID}/categories/{CATEGORY_ID}/csv?q={FILTER}

Request Query Parameters

Request ParameterDescription
LOCATION_IDUUID assigned to a specific location
CATEGORY_IDID of a target category
FILTERA base64 encoded filter query
The schema of filter query
{
"type": "object",
"properties": {
"period": {
"type": "string"
},
"scale": {
"type": "string"
},
"date_from": {
"type": "string"
},
"date_to": {
"type": "string"
},
"scale": {
"type": "string"
},
"show_average": {
"type": "boolean"
},
"show_min": {
"type": "boolean"
},
"show_max": {
"type": "boolean"
},
"show_summary": {
"type": "boolean"
},
"display_hours": {
"type": "string"
},
"hide_zero_buckets": {
"type": "boolean"
}
}
}
ParameterDescriptionExample/Valid Values
periodSpecifies the time period for the data.CustomRange, FixedRange, Today, Yesterday, ThisWeek, LastWeek, ThisMonth, LastMonth
scaleDetermines the time bucket for each data value.OneMinute, TenMinute, Hour, Day
date_fromThe RFC3339 date string representing the start of the data period. It should be the local time of the venue, represented in UTC. Only used if period is CustomRange or FixedRange.2022-06-01T15:00:00Z means "3pm in the time zone of the venue".
date_toThe end date for the data range. See comments above.See above.
show_averageA boolean indicating whether to show average values or not.true, false
show_minA boolean indicating whether to show minimum values or not.true, false
show_maxA boolean indicating whether to show maximum values or not.true, false
event_value_typeReserved. Always Count.Count
data_typeReserved. Always use example value.{"type": "Count", "value": "Count"}
display_hoursUse Venue Operating Hours or 24 hours (when period is e.g. Today)OH, 24H
show_summaryA boolean indicating whether to show a summary of data or not.true, false
hide_zero_bucketsValid for API requests that provide response with Content-Type: text/csv. A boolean indicating whether to exclude rows which have zero values only.true, false
Sample Filter Query
This query requests historical data in the timeframe from 26/01/2024 07:00:00 to 26/01/2024 07:15:00. The historical data shall be presented as an average of metric values over 1 minute buckets.
{
"period": "FixedRange",
"date_from": "2024-01-26T07:00:00.000Z",
"date_to": "2024-01-26T07:15:00.000Z",
"scale": "OneMinute",
"event_value_type": "Count",
"show_average": true,
"show_max": false,
"show_min": false,
"show_summary": false,
"hide_zero_buckets": false,
"extra_metrics": []
}

Response

The content of CSV response
Row 1: 
Column 1 : 'Time'
Column 2+: Name of a metric

Row 2+:
Column 1 : Time of a bucket as RFC3339 date string
Column 2+: Value of metric
Sample Response
Time,T2 Occupancy,T1 Occupancy,T5 Occupancy,T6 Occupancy
2024-01-26T07:01:00Z,1.27,0.50,0.00,0.00
2024-01-26T07:02:00Z,1.50,0.67,0.00,0.00
2024-01-26T07:03:00Z,0.67,0.67,0.00,0.00
2024-01-26T07:04:00Z,1.56,1.00,0.00,0.00
2024-01-26T07:05:00Z,1.33,0.50,0.00,0.00
2024-01-26T07:06:00Z,1.00,0.75,0.00,0.00
2024-01-26T07:07:00Z,1.50,0.50,0.33,0.00
2024-01-26T07:08:00Z,1.50,1.00,0.33,0.00
2024-01-26T07:09:00Z,1.44,0.50,0.00,0.00
2024-01-26T07:10:00Z,1.50,1.00,0.00,0.00
2024-01-26T07:11:00Z,1.40,1.00,0.00,0.00
2024-01-26T07:12:00Z,1.50,0.67,0.00,0.00
2024-01-26T07:13:00Z,0.67,0.67,0.00,0.00
2024-01-26T07:14:00Z,1.56,1.00,0.00,0.00
2024-01-26T07:15:00Z,1.45,1.00,0.00,0.00
2024-01-26T07:16:00Z,0.50,0.50,0.00,0.00