An API for REM, the Residential Electrification Model. The other Rewiring America APIs and methodology for REM are here.
This Typescript package is automatically generated by the OpenAPI Generator project:
- API version: 0.1.0
- Package version: 0.3.0
- Generator version: 7.10.0
- Build package: org.openapitools.codegen.languages.TypeScriptNodeClientCodegen
For more information, please visit https://www.rewiringamerica.org/
Typescript ^4.0 or ^5.0
Run:
npm install @rewiringamerica/rem
Then import the package:
import rem from '@rewiringamerica/rem';
Run:
yarn add @rewiringamerica/rem
Please follow the installation procedure and then run the following:
import { ResidentialElectrificationModelApi } from "@rewiringamerica/rem/api/apis";
import { SupportedUpgrade } from "@rewiringamerica/rem/model/supportedUpgrade";
import { HeatingFuelInput } from "@rewiringamerica/rem/model/heatingFuelInput";
import { HttpBearerAuth } from "@rewiringamerica/rem/model/models";
// Initialize the client and key
const key = new HttpBearerAuth()
key.accessToken = "key_example"
const rem_api = new ResidentialElectrificationModelApi();
rem_api.setDefaultAuthentication(key)
// Get savings by address
async function getRemByAddress(upgrade: SupportedUpgrade, address: string, heatingFuel: HeatingFuelInput) {
try {
const response = await rem_api.getByAddress(upgrade, address, heatingFuel);
console.log(response.body);
} catch (error) {
console.error("Error:", error.response.body);
}
}
// Call the async function
const address = "address_example"
getRemByAddress(SupportedUpgrade.BasicEnclosure, address, HeatingFuelInput.NaturalGas);
Sign up for an API key here.
Authentication schemes defined for the API:
- Type: Bearer authentication