prices
Get CO2 Savings
Returns the saved CO2 amount for given energy amount for given year.
GET
/
v3
/
prices
/
get_co2_savings
/
Get CO2 Savings
curl --request GET \
--url https://api.lumenaza.de/v3/prices/get_co2_savings/import requests
url = "https://api.lumenaza.de/v3/prices/get_co2_savings/"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.lumenaza.de/v3/prices/get_co2_savings/', 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.lumenaza.de/v3/prices/get_co2_savings/",
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.lumenaza.de/v3/prices/get_co2_savings/"
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.lumenaza.de/v3/prices/get_co2_savings/")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lumenaza.de/v3/prices/get_co2_savings/")
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{
"saved_co2": 123
}Query Parameters
Yearly consumption in kWh.
Required range:
x >= 0Requested calendar year; defaults to the current year.
Available options:
2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026 Response
200 - application/json
OK
Saved CO2 amount in grams.
⌘I
Get CO2 Savings
curl --request GET \
--url https://api.lumenaza.de/v3/prices/get_co2_savings/import requests
url = "https://api.lumenaza.de/v3/prices/get_co2_savings/"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.lumenaza.de/v3/prices/get_co2_savings/', 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.lumenaza.de/v3/prices/get_co2_savings/",
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.lumenaza.de/v3/prices/get_co2_savings/"
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.lumenaza.de/v3/prices/get_co2_savings/")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lumenaza.de/v3/prices/get_co2_savings/")
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{
"saved_co2": 123
}
