cURL
curl --request GET \
--url https://api.electra.systems/v1/public/devices/{deviceId}/analysed-data \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.electra.systems/v1/public/devices/{deviceId}/analysed-data"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.electra.systems/v1/public/devices/{deviceId}/analysed-data', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.electra.systems/v1/public/devices/{deviceId}/analysed-data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.electra.systems/v1/public/devices/{deviceId}/analysed-data"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.electra.systems/v1/public/devices/{deviceId}/analysed-data")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.electra.systems/v1/public/devices/{deviceId}/analysed-data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Analysed data retrieved",
"data": [
{
"_id": "<string>",
"deviceId": "<string>",
"type": "daily",
"date": "<string>",
"month": 123,
"year": 123,
"points": 123,
"co2": 142.5,
"data": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}{
"error": 123,
"message": "<string>"
}Endpoints
Get device analysed data
Returns analysed/processed data for a specific device.
GET
/
devices
/
{deviceId}
/
analysed-data
cURL
curl --request GET \
--url https://api.electra.systems/v1/public/devices/{deviceId}/analysed-data \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.electra.systems/v1/public/devices/{deviceId}/analysed-data"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.electra.systems/v1/public/devices/{deviceId}/analysed-data', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.electra.systems/v1/public/devices/{deviceId}/analysed-data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.electra.systems/v1/public/devices/{deviceId}/analysed-data"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.electra.systems/v1/public/devices/{deviceId}/analysed-data")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.electra.systems/v1/public/devices/{deviceId}/analysed-data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Analysed data retrieved",
"data": [
{
"_id": "<string>",
"deviceId": "<string>",
"type": "daily",
"date": "<string>",
"month": 123,
"year": 123,
"points": 123,
"co2": 142.5,
"data": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}{
"error": 123,
"message": "<string>"
}Working Hours
TheworkingHours metric in the analysed data represents the total duration (in seconds) that a device was actively operating. Specifically, it is calculated by measuring the time periods where the device was powered ON and met at least one of the following conditions:
- Active Load: The device was drawing an active electrical load (
kW > 0). - Energy Consumption: There was a positive increase in energy consumption (
kWhdelta > 0) during that time interval.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The device ID or alias
Query Parameters
The maximum number of results to return
Page number for pagination
Start date for data retrieval (ISO 8601 format)
End date for data retrieval (ISO 8601 format)