Data that is stored in the can be retrieved via the . akenza builds different data products that can be retrieved:
Raw: The raw sensor data
Time series: Time series aggregations based on the raw data (Bucketing, Resampling)
Aggregations: Hourly aggregates of the raw data as a single kpi (number) or time-series (efficient for larger timespans)
akenza automatically generates hourly aggregates of data, which can be used to easily visualize trends over a longer period of time. The aggregates can be queried via a specific API for aggregated historical data.
If all data should be accessible at any point, a pull-based loading mechanism via REST API is not the recommended approach. Instead, an event-based output connector should be considered, where data is automatically forwarded to the client application using a data sink output connector (Kafka, Azure Events Hub, AWS Kinesis, GCP Pub/Sub, SQL database, etc.).
1. Endpoint selection
Please follow the diagram below to select the right data product for your use case:
Examples:
Query the temperature measured by one sensor yesterday, with high time resolution
finding the right endpoint
querying a single device
no aggregation function is required
high time resolution is needed
resulting endpoint would be /v3/devices/$DEVICE_ID/query
Query the average temperature measured by one sensor today from 08:00 to 18:00
finding the right endpoint
querying a single device
aggregation functions are required (average)
the timespan is less than 24h (08:00 to 18:00 ⇒ 10 hours)
a single metric is needed (the average)
resulting endpoint would be /v3/devices/$DEVICE_ID/query/raw/kpi
Query the maximum daily CO2 concentration measured by one sensor during the last 3 three months
finding the right endpoint
querying a single device
aggregation functions are required (maximum)
the timespan is more than 24h (3 months)
a time series is needed (daily maximum)
the resulting endpoint would be /v3/devices/$DEVICE_ID/query/aggregated/hourly/time-series
Query the minimum temperature of several sensors having a common tag today from 08:00 to 18:00
finding the right endpoint
querying multiple devices using tag
the timespan is less than 24h (08:00 to 18:00 ⇒ 10 hours)
a single metric is needed (the minimum)
the resulting endpoint is /v3/tags/$TAG_ID/query/raw/accumulated-kpi
2. Consult specific endpoint documentations
Below you can find the request/response pair for the endpoints documented above.
Prerequisites:
create an akenza api key that has the asset.read permission for the required scope
export API_KEY=<your api key>
export DEVICE_ID=<target device id>
export TAG_ID=<target tag id>
# universal - using pip
python -m pip install --upgrade pip wheel
python -m pip install httpie
# on macOS
brew update
brew install httpie
# on Windows
choco install httpie