How to use historical data access API on QNAP QIoT Suite Lite

How to use historical data access API on QNAP QIoT Suite Lite


In this tutorial, you will learn how to use historical data access API on QNAP QIoT Suite Lite. Using the historical data access API, the limitation is that you have to create a thing on QIoT and confirm the data input type is numeric (int, float), and then it can output in count, sum, vmin, vmax, and vavg type normally.


And if your data received is from Node-RED (e.g., TCP, UDP, HTTP, and MQTT node), and you have to change it to thing from QIoT that can be used. As below picture.


There are two ways to receive the historical data:
a. Using the Node-RED QHistoricData node
b. Using a RESTful API

a. Using NodeRed QHistoricData node

The input node means “trigger” and the output node means “acquire history data”. The node can help users to acquire historical data from the QIoT Suite Lite database. Users can sconfigure options such as “Resolution”, “Interval”, “Range”, and more. According chosen, the API will return the historical data from “IoT Thing” and “Resources”.



  • Name: Self-defined node name
  • Thing: The thing to choose
  • Resources: Historical data of the chosen Resource
  • Resolution: Select minute, day or hour
  • Interval: The data interval. This depends on the Resolution and Range
  • Range: The range of the output data. This depends on the Resolution
  • API Key: You must establish an API Key to use. To configure the API Key, go to  “Settings” > “API Keys”




For example (the return format will be “JSON” ):


          "result": [


                              "totalCount": 1,

                              "data": [


                                                  "count": 6347,

                                                  "vmin": 1,

                                                  "sum": 316959,

                                                  "vmax": 100,

                                                  "_id": "2018-01-18T08:43:56",

                                                  "vavg": 49.93839609264219







b. Using RESTful API

Go to the QIoT Suite Lite page, click the upper right corner  and select “API Documentation” to acquire more information.



Related posts

6 thoughts on “How to use historical data access API on QNAP QIoT Suite Lite

  1. Aleksey


    How I cant insert the history charts on QDASHBOARD? How I cant request to history data for showing statistics for different ranges?

    1. Jeffrey Chang

      You need to parse the result in JSON format of QHistoricData node to get maximum, minimum, or average values, then send to QDashboard node.
      If range options in QHistoricData node don’t meet your requirement, you can use RESTful APIs to assign startdatetime and enddatetime.

  2. I can’t make this work. Would it be possible to show an end-end demo with a working example showing information being pulled from the database and displayed on a chart on a dashboard. My particular example is a Pi with a temperature sensor which is sending data over MQTT to QIOT. I can show the real time information but I can’t work out how to use this node to show a historical graph of the last X days of data on a line graph.

    1. tim

      Hi belgrat

      You can reference this tutorial:

      This Historic-chart-widget is new function of version 1.1.2xx. You can try it.

      Thank you.

  3. Bobazila

    My result:
    03.10.2019, 17:36:49node: d9d786d1.536da8
    msg.payload : Object
    result: array[0]
    It’s just not working.

    1. tim

      Hi Bobazila,

      I don’t quite understand your question.
      Could you tell me your step and show me your screenshot?

      Thank you.

Leave a Reply