Get Device History Data
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}

Use case example:

You live in Sydney and have 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. Garage door opener is Blynked and it uses Datastream with ID 20 and virtual pin 6 for open/close commands. Also you want to get the list of all the events occured during this period. So API request for this case looks like:
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:
1
{
2
"meta":
3
[
4
{
5
"name": "data_stream_name",
6
"type": "String"
7
},
8
{
9
"name": "ts",
10
"type": "UInt32"
11
},
12
{
13
"name": "value",
14
"type": "Float64"
15
}
16
],
17
18
"data":
19
[
20
{
21
"data_stream_name": "",
22
"ts": 2021-05-14 12:25:00,
23
"value": 1.6100000000000003
24
}
25
],
26
27
"rows": 1,
28
29
"rows_before_limit_at_least": 1
30
}
Copied!
Last modified 5mo ago
Copy link