/ Apps For Energy Behind the Scenes Tech

The U.S. Energy Department issued a challenge to software developers to create an app to help utility customers make the most out of the Green Button electricity usage data. At Genability, we work hard to gather energy pricing data across the United States and structure it in a way that developers can use. So we took on the challenge and decided to make a quick hack that we coded in a few hours over a couple of days. You can look through our code and implement it yourself!

Using our api, we wanted to combine the usage data from the Green Button initiative and create an app for electric vehicle owners to know how much it would cost to charge their cars.

We started by using our data uploader to take Green Button data and create an account (a home) for each new user. We thought the easiest way to do this was through email so we set up an email address that accepts Green Button files as attachments! Try it out, send a Green Button file to If you like traditional HTML forms, you can go straight to, enter your e-mail address, and upload your Green Button file that way too.

API Call: POST /rest/beta/loader/account/up.html

<form id=”upload” action=”[your appId]&appKey=[your appKey]&redirectPath=” method=”post” enctype=”multipart/form-data”>
<input type=”file” name=”fileData” id=”fileinput” />
<input type=”hidden” name=”fileFormat” value=”espi” />
<input type=”hidden” name=”customerClass” value=”RESIDENTIAL” />
<input type=”hidden” name=”providerAccountId” class=”providerAccountId” />

If you already have an account with us, we recognize your e-mail address as soon as you type it using our find account by providerAccountId call.

API Call: GET /rest/beta/accounts?providerAccountId={accountID}

With that file, we quickly parse the information and send you back a link to our CostButton app with your account id (ex: With that account id, we can hit our api and retrieve your likely tariff and show a graph visualizing your personal usage data.

API Call: GET /rest/beta/accounts/{accountId}

API Call: GET /rest/public/tariffs/{masterTariffId}

var url = “” + tariffId + “?appId=[your appId]&appKey=[your appKey]”;
$.getJSON(url, function(data) {
if (data.status == “success”) {
if (data.results[0].lseName) {
lseName = data.results[0].lseName;

if (data.results[0].tariffName) {
tariffName = data.results[0].tariffName;

if (data.results[0].tariffCode) {
tariffCode = data.results[0].tariffCode;

API Call: GET /rest/beta/usage/profiles/{usageProfileId}

Now, you can select an electric vehicle (we started with the Chevy Volt, Nissan Leaf, Toyota Prius, Tesla Roadster, and Tesla Model S), tell us how full your battery is, and let us do all the rest. Not only do we tell you how long it’s going to take to charge your batter, but we tell you the dollar amount you can epect to see on your electricity bill using our price call!

API Call: GET /rest/public/prices/{masterTariffId}

We also let you know how much you can expect to pay in an avearge year…this is very useful if you’re trying to decide which electric vehicle to purchase. Simple and easy…taking the hard work and guessing out of electricty charges. The app is live and our submission is in so you can vote for us daily on the apps for energy website here.

There are also other great apps using our api to do the dirty work…check them out!

This entry was posted in API, Developers, News and tagged , , , . Bookmark the permalink. Both comments and trackbacks are currently closed.
  • Categories

  • Archives