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.

The embeddable calculator uses the Rewiring America API, so its coverage of incentives will expand as the API's does. Its code is open source, under the Apache License 2.0.

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.

Layout and colors

We recommend ensuring that the widget is on top of a light-colored background. (There are dark-colored text and icons with nothing behind them.) If you are embedding it on a page that has, or could have, a dark background, you should put the widget inside an element with a light background color. The designed background color is #fffae7, but other colors can work. The widget does not adapt to the user's dark-mode preference.

We also recommend making the widget take up the entire width of the page, or as close to it as possible. It adapts its layout based on the viewport width, which may result in awkward layouts at some widths if the widget is significantly narrower than the viewport.

Customization

There are several supported ways to customize the calculator, including:

  • Prefilling form fields
  • Requiring that the ZIP code be in a specific state
  • Changing the language
  • Changing certain colors
  • Receiving JavaScript events on certain actions

Please see the README file in the open-source repo for full details.

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: