Skip to content

Instantly share code, notes, and snippets.

@riccardolardi
Created April 27, 2023 08:24
Show Gist options
  • Save riccardolardi/f7fcd2f2db4ef1e4710ae7ea1942f5dd to your computer and use it in GitHub Desktop.
Save riccardolardi/f7fcd2f2db4ef1e4710ae7ea1942f5dd to your computer and use it in GitHub Desktop.
const inputBody = {
"mobility": {
"car": {
"petrol": 0,
"biogas": 0,
"diesel": 0,
"electric": 0,
"hydrogen": 0,
"naturalGas": 0,
"syntheticFuel": 0,
"syntheticGas": 0
},
"deliveryTruck": {
"petrol": 0,
"biogas": 0,
"diesel": 0,
"electric": 0,
"hydrogen": 0,
"naturalGas": 0,
"syntheticFuel": 0,
"syntheticGas": 0
},
"truck": {
"petrol": 0,
"biogas": 0,
"diesel": 0,
"electric": 0,
"hydrogen": 0,
"naturalGas": 0,
"syntheticFuel": 0,
"syntheticGas": 0
}
},
"heat": {
"shares": {
"buildingHeat": {
"biogas": 0,
"electricResistanceHeating": 0,
"heatPump": 0,
"fuelOil": 0,
"solarThermal": 0,
"syntheticGas": 0,
"syntheticOil": 0,
"woodAbroad": 0,
"woodInland": 0,
"fuelOilLight": 0,
"naturalGas": 0,
"electric": 0,
"fuelOilHeavy": 0,
"coal": 0,
"industryWaste": 0
},
"hotWater": {
"biogas": 0,
"electricResistanceHeating": 0,
"heatPump": 0,
"fuelOil": 0,
"solarThermal": 0,
"syntheticGas": 0,
"syntheticOil": 0,
"woodAbroad": 0,
"woodInland": 0,
"fuelOilLight": 0,
"naturalGas": 0,
"electric": 0,
"fuelOilHeavy": 0,
"coal": 0,
"industryWaste": 0
},
"industry": {
"biogas": 0,
"coal": 0,
"electric": 0,
"fuelOilLight": 0,
"heatPump": 0,
"fuelOilHeavy": 0,
"industryWaste": 0,
"naturalGas": 0,
"syntheticGas": 0,
"syntheticOil": 0,
"woodAbroad": 0,
"woodInland": 0
}
},
"annualRenovationRate": 0.01
},
"electricity": {
"riverHydropower": {
"smallPowerPlants": 0
},
"pv": {
"roofs": 0,
"facades": 0,
"streets": 0,
"parkingLots": 0,
"motorwayShoulders": 0,
"openSpacesAlpine": 0
},
"wind": {
"windPower": 0
},
"biomass": {
"biogas": 0,
"wood": 0
},
"naturalGas": {
"gasPower": 0,
"monthlyCapacityImportReduction": 0,
"maxAnnualImportReduction": 0
},
"nuclear": {
"nuclearPower": 40
},
"storagePowerPlants": {
"expansionOfCapacity": 0,
"simpleLake": 0,
"pumpedStorage": 0
},
"powerToGas": {
"additionalCapacityGasStorage": 0
},
"annualEfficiencyGains": {
"efficiencyGains": 0
}
},
"settings": {
"targetYear": 2030
}
};
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://deka.ela.ge/v1/all.json', {
method: 'POST',
body: inputBody,
headers: headers
}).then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment