> For the complete documentation index, see [llms.txt](https://docs.akenza.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.akenza.io/reference/api-documentation/querying-device-data.md).

# Querying Device Data

Data stored in the [akenza DB](/device-management/your-data-flow/connectors/databases/akenza-db.md) can be retrieved with the [Query REST API](https://docs.api.akenza.io/#e754213a-147a-4a0f-a823-95042ff54531). The API returns the data in different formats, called *data products*. Choose the one that fits your use case:

* **Aggregations** combine data from one or many devices over a time range into a new output:
  * *Single metric*: one value, for example the average temperature of 10 devices over the last 7 days.
  * *Time series*: a list of values with timestamps, for example the maximum daily CO2 of one device from October to November 2026.
  * *Calendar grouping*: a list of values grouped into calendar buckets, for example the average occupancy of 20 desks per day of the week.
* **Raw samples** are the data as the device sent it, as JSON documents.

{% hint style="warning" %}
Do not use the REST API to pull all of your data on a schedule. If your application needs every data point, use an [output connector](/device-management/your-data-flow/connectors.md) instead. akenza then forwards data to your application as it arrives, for example through Kafka, Azure Event Hubs, AWS Kinesis, Google Cloud Pub/Sub or an SQL database.
{% endhint %}

## Querying aggregations

See [Querying aggregations](/reference/api-documentation/querying-device-data/querying-aggregations.md).

## Querying raw samples

See [Querying raw samples](/reference/api-documentation/querying-device-data/querying-raw-samples.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.akenza.io/reference/api-documentation/querying-device-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
