Calculator Widget Embed

If your main use-case for the API is to include incentive information in your own website, consider using our embeddable calculator widget directly.

Usage

Include the following markup on your page:

<script src="https://embed.rewiringamerica.org/state-calculator.js"></script>
<link
  rel="stylesheet"
  type="text/css"
  href="https://embed.rewiringamerica.org/rewiring-fonts.css"
/>
<rewiring-america-state-calculator
  api-key="YOUR_KEY_HERE"
></rewiring-america-state-calculator>

Be sure to swap out YOUR_KEY_HERE with an API key generated on our developer portal homepage. Sign up on our API website to accept the API Terms and Acceptable Use Policy. Contact us to discuss increased rate limits, SLAs, or additional feature requests.

Optional functionality

If you have analytics running in your page you can optionally listen for “calculate” events as follows:

<script>
  // NB:- place *after* the <rewiring-america-state-calculator> tag to ensure it exists:
  var calc = document.getElementsByTagName("rewiring-america-state-calculator")[0];
  calc.addEventListener("calculator-submitted", function (event) {
    // replace the following with a call to your event tracking system:
    console.log(event.detail.formData);
  });
</script>

You can optionally restrict the calculator to only accept zip codes in your state by passing in the state parameter:

<rewiring-america-state-calculator 
  api-key="YOUR_KEY_HERE"
  state="2_LETTER_STATE_ABBREVIATION"
>
</rewiring-america-state-calculator>

Be sure to replace "2_LETTER_STATE_ABBREVIATION" with a real state, e.g. "RI".

You can optionally pre-fill calculator fields such as income and zip code by passing them in as parameters. You can use this if you already have information about your user. Example:

<rewiring-america-state-calculator 
  api-key="YOUR_KEY_HERE"
  zip="15106"
  household-income="80000"
  tax-filing="single"
  household-size="2"
>
</rewiring-america-state-calculator>

Coverage

The calculator includes nationwide (U.S.) coverage of federal incentives from the IRA (Inflation Reduction Act), as well as state, utility and local incentives in some states. Check the changelog and roadmap for further planned coverage and releases.

Examples

An example of the calculator is available live at https://embed.rewiringamerica.org and includes support for previewing unreleased data from our API.

You can also see examples of third-party usage of our calculator at: