News&Events
About
API Ref
API Directory
UserManual
nodeMCU
python
PC Software
EnergyMeter
WiFi HT
downloads

sensor/getHistoryData

Get history data of sensor

URL

http://www.lewei50.com/api/v1/sensor/GetHistoryData/{sensor ID}

UserKey Required

Yes

Parameter

  Required Default Value Type Range Description
StartTime No 2000-01-01 datetime < Now Start time
EndTime No 当前时间 datetime End time
Interval No 1 int <1 Interval
Start No 0 int Start
Limit No 1000 int 1-1000 Take the number of data at a time
Order No 1 int 0 or 1 0:desc 1:asc

Http Type

get

Return Data Format

json

Return Data Example

{
    "Data": [
        {
            "updateTime": "2012-08-22T21:15:18", 
            "value": 22
        }, 
        {
            "updateTime": "2012-08-22T22:11:28", 
            "value": 22
        }, 
        {
            "updateTime": "2012-08-23T10:51:31", 
            "value": 22
        }
    ], 
    "Successful": true, 
    "Message": null
}

Return Data Remark

  Type Description
Successful boolean Successful
Message string Message if error
Data/updateTime string Update time
Data/value string Value

Description

Sensor for the global identifier ID, not idName;

The time format is: ISO 8601.

Paging:

If one did not take all the data, use the Start parameter to obtain the next page of data, such as Start 1000, will be over 1000 have taken data, return 1001-2000 data.

About sorting:

If you need to access data in reverse chronological order, such as the nearest 1000 data, need to pass Order=0.

API Online Test Tool

Online Test