An API for REM, the Residential Electrification Model.
Rewiring America's other APIs can be found at our main API site.
Example code demonstrating how to use the APIs can be found in the api_demos Github repo.
This Typescript package is automatically generated by the OpenAPI Generator project:
- 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
You can install using:
npm install @rewiringamerica/rem
You can install using:
yarn add @rewiringamerica/rem
Sign up for an API key and follow the installation procedure. Then, run the following:
import { ResidentialElectrificationModelApi } from "@rewiringamerica/rem/api/apis";
import { SupportedUpgrade } from "@rewiringamerica/rem/model/supportedUpgrade";
import { HeatingFuel } from "@rewiringamerica/rem/model/heatingFuel";
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: HeatingFuel) {
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.Baseline, address, HeatingFuel.NaturalGas);
Sign up for an API key here.
Authentication schemes defined for the API:
- Type: Bearer authentication