Get Historical Data From Device
How to get historical data from a single device for a specified time range
Last updated
How to get historical data from a single device for a specified time range
Last updated
GET
https://{server_address}/external/api/data/get?token={token}&period={PERIOD}&granularityType={TYPE}&sourceType={SOURCE_TYPE}&tzName={tzName}&format={FORMAT}&output=FILE&pin={pin}
Name | Type | Description |
---|
Let's say you live in Sydney, Australia and there is a garage door opener and want to get an exact time you departed today in one file. The accuracy you need is up to 1 minute and it should be in "YYYY-MM-DD HH:MM:SS" format. Your device uses Datastream with ID 20 and virtual pin 6 for open/close commands. Let's say you also need to get the list of all the Events that were recorded during this period.
API call will look like this:
https://blynk.cloud/external/api/data/get?token=HjKjfij84050fege&period=DAY&granularityType=MINUTE&sourceType=AVG&tzName=America/New_York&format=ISO_SIMPLE&sendEvents=true&output=FILE&dataStreamId=20`
JSON Output example:
period | string | Is |
granularityType | string | Is |
sourceType | string | Is |
tzName | string | Is |
format | string | Is TS by default. Other possible values: ISO_US "04/10/19 11:45:41 AM" ISO_SIMPLE "2018-06-07 22:01:20" |
sendEvents | string | Is false by default |
dataStreamId or pin | string | Are optional parameteres, which are used to get data for the specific pin |
output | string | Is FILE by default. Other possible value: JSON |