cURL
curl --request GET \
--url https://api.home.datanumia.com/api/v2/sites/{site-id}/forecast-consumptionsimport requests
url = "https://api.home.datanumia.com/api/v2/sites/{site-id}/forecast-consumptions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.home.datanumia.com/api/v2/sites/{site-id}/forecast-consumptions', 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.home.datanumia.com/api/v2/sites/{site-id}/forecast-consumptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.home.datanumia.com/api/v2/sites/{site-id}/forecast-consumptions"
req, _ := http.NewRequest("GET", url, nil)
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.home.datanumia.com/api/v2/sites/{site-id}/forecast-consumptions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.home.datanumia.com/api/v2/sites/{site-id}/forecast-consumptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"energy": 1056.38742032702,
"cost": 159.2361759474585,
"units": {
"energy": "KWH",
"cost": "EUR"
}
}{
"errorCode": "<string>",
"errorDescription": "<string>"
}{
"errorCode": "<string>",
"errorDescription": "<string>"
}{
"errorCode": "<string>",
"errorDescription": "<string>"
}{
"errorCode": "<string>",
"errorDescription": "<string>"
}Forecast consumptions
Get sites forecast consumptions
This API estimates energy (gas or electricity) consumption according to the chosen calculation strategy over a given input period. It returns:
- estimated consumption
- consumption cost
- units used for energy and cost
Two strategies are supported:
- ESTIMATION_AFTER_REAL:
- This strategy estimates energy (gas or electricity) consumption from the called date until the end of the period passed as a parameter.
- It needs a 15 days + X days of actual energy consumption before the called date. (The X variable is configured by the marketer).
- It returns the sum of actual and estimated energy consumption and the cost over the requested period.
- ESTIMATION_FOR_FULL_PERIOD:
- This strategy makes it possible to estimate energy consumption over the period passed as a parameter.
- It needs a 15 days + X days of actual energy consumption before the start date of the period. (The X variable is configured by the marketer).
- It returns the estimated consumption and the cost over the requested period.
GET
/
sites
/
{site-id}
/
forecast-consumptions
cURL
curl --request GET \
--url https://api.home.datanumia.com/api/v2/sites/{site-id}/forecast-consumptionsimport requests
url = "https://api.home.datanumia.com/api/v2/sites/{site-id}/forecast-consumptions"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.home.datanumia.com/api/v2/sites/{site-id}/forecast-consumptions', 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.home.datanumia.com/api/v2/sites/{site-id}/forecast-consumptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.home.datanumia.com/api/v2/sites/{site-id}/forecast-consumptions"
req, _ := http.NewRequest("GET", url, nil)
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.home.datanumia.com/api/v2/sites/{site-id}/forecast-consumptions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.home.datanumia.com/api/v2/sites/{site-id}/forecast-consumptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"energy": 1056.38742032702,
"cost": 159.2361759474585,
"units": {
"energy": "KWH",
"cost": "EUR"
}
}{
"errorCode": "<string>",
"errorDescription": "<string>"
}{
"errorCode": "<string>",
"errorDescription": "<string>"
}{
"errorCode": "<string>",
"errorDescription": "<string>"
}{
"errorCode": "<string>",
"errorDescription": "<string>"
}Path Parameters
The site identifier
Query Parameters
The type of consumption (electricity or gas)
Available options:
ELEC, GAS The specific strategy to be selected to calculate the forecasted energy consumption
Available options:
ESTIMATION_FOR_FULL_PERIOD, ESTIMATION_AFTER_REAL The starting date to estimate the consumption from
The ending date (excluded) until which to estimate the energy consumption