Electric Utility Companies, Rates, and Locations: An Essential Understanding for Environmental Justice

Ryan Kmetz
5 min readMay 31, 2023

TL;DR
Electric utility companies, their rates, and locations play a crucial role in achieving environmental justice. Understanding utility rates empowers individuals, promotes energy conservation, and guides corporate social responsibility. Policymakers benefit from this knowledge to promote energy equity and advocate for affordable renewable energy. The National Renewable Energy Laboratory’s Utility Rates by Census Region API provides valuable data for analysis and transparency. Leveraging this API with tools like Google Colab enables efficient data retrieval, analysis, and visualization. Transparent data stimulates a fair market and supports a sustainable and cost-effective energy future.

Gaining insight into the specifics of utility companies and their associated rates within a given region is a vital component in the quest for environmental justice. This understanding empowers individuals and communities, allowing them to champion the cause of equal access to affordable and sustainable energy options.

For marginalized and low-income households, comprehension of utility rates can shed light on their energy usage patterns, facilitate more effective management of energy expenses, and underscore the true affordability or unaffordability of renewable energy alternatives. These households, often burdened disproportionately by elevated energy costs, are also typically at higher risk of exposure to pollutants released by the energy sector. Consequently, strategies for energy conservation and the potential switch to renewable sources can bring about significant change, fostering a stronger sense of energy security and environmental health.

In the business sphere, especially for those enterprises established within or serving under-resourced communities, an understanding of utility rates can guide their corporate social responsibility initiatives. Companies can choose to actively invest in energy-efficient practices and renewable energy technologies. Such investments do not only lower operational costs but also lessen environmental impact, contributing to the welfare of the communities in which they operate.

Policymakers and activists can benefit tremendously from a comprehensive grasp of regional utility rates. This data is integral to promoting energy equity. A nuanced understanding of these rates aids in the formation of fair energy policies, targeted allocation of subsidies, reduction of pollution, and advocacy for affordable access to renewable energy for all.

By making this information accessible, we can shine a spotlight on the discrepancies in energy costs and systemic inequalities, consequently driving policy alterations and market changes that affirm the principles of environmental justice. By striving to ensure that every community, irrespective of socio-economic standing, gains access to affordable, clean, and sustainable energy, we can collectively move towards a more equitable and sustainable future.

Leveraging the Data

The National Renewable Energy Laboratory’s (NREL) Utility Rates by Census Region API is a significant asset in energy data analysis and understanding the economics of utility companies. This API aids in achieving a deeper understanding of the utility landscape, the costs of energy across different regions, and identification of primary electricity providers in each region. NREL’s commitment to open data promotes complete transparency — a fundamental requirement for a functioning democracy. Transparency in government data not only fosters accountability but also enlightens citizens about government actions. Open data enables monitoring of government activities, informed public decision-making, and unlocks opportunities for economic innovation and growth. With regard to utility rates, transparent data can stimulate a fair market, enabling consumers, researchers, and policymakers to have a clear view of the rates being charged and where. This transparency sparks competition and motivates utility companies to offer more cost-effective solutions.

The Utility Rates API from NREL is an invaluable tool in advancing transparency, providing access to detailed, region-specific data about utility rates. This API can be harnessed along with a data analysis tool like Google Colab to efficiently fetch, analyze, and visualize data.

The API operates by returning data in GeoJSON format, which can subsequently be employed to create interactive maps or perform location-specific analyses. For instance, relationships between geographical location, population density, and utility rates can be analyzed, or changes in rates over time in different regions can be tracked.

As our focus increasingly shifts towards energy efficiency and sustainability, tools like NREL’s Utility Rates by Census Region API become more important than ever. They provide crucial insights for consumers and businesses and facilitate policymaking and research that can propel us towards a future of sustainable and cost-effective energy.

Technical Introduction

To fully appreciate how the Utility Rates API can be used and its significance, it’s crucial to define a few key concepts:

What is an API?

An API, or Application Programming Interface, is a set of rules facilitating communication between different software applications. It specifies the types of requests that can be made, the procedure to make these requests, the data formats that should be used, and the conventions to be adhered to. APIs essentially allow diverse systems to interact and share information, enabling the creation of more flexible and integrated software systems.

What is Google Colab?

Google Colaboratory, commonly referred to as Google Colab, is a free cloud service supporting Python programming language. It is an effective tool for machine learning education and research, offering an interactive platform that smoothly integrates with Google Drive and other Google Cloud services. It permits anyone to write and execute Python code through their browser, and is especially popular for data analysis, visualization, and machine learning.

What is a GeoJSON?

GeoJSON is a format designed for encoding a variety of geographic data structures. Based on JavaScript Object Notation (JSON), a lightweight data-interchange format that is easy for humans to read and write and machines to parse and generate. GeoJSON supports the encoding of spatial features, collections, and geometries, making it an indispensable tool for mapping and location-centric services.

CODE TIME

Open your new Google Colab notbook.

#Install libraries
%pip install folium requests

# Import required libraries
import folium
import requests
import json

Let’s get started!

Add your GEOJSON (in this workflow it is hosted on Github and the code reflects that)

# Load a GeoJSON file from GitHub
url='https://raw.githubusercontent.com/xyz123'# replace with your file
geojson_data = requests.get(url).json()

NREL API

# Make a GET request to NREL Utility Rates API endpoint
nrel_api_endpoint= 'https://developer.nrel.gov/api/utility_rates/v3.json'
nrel_api_key = 'xyz123' # replace with your actual NREL API key

Folium Map

# Create a map centered at the first point
first_point = geojson_data['features'][0]
latitude = first_point['geometry']['coordinates'][1]
longitude = first_point['geometry']['coordinates'][0]
m = folium.Map(location=[latitude, longitude], zoom_start=5)

# Extract the name of the point from the GeoJSON feature
point_name = feature['properties']['Prime_name']

Call the NREL API (this step may take sometime if you have numerous points of interest)

# For each point in the GeoJSON file, call the NREL API and add a marker to the map
for feature in geojson_data['features']:
try:
latitude = feature['geometry']['coordinates'][1]
longitude = feature['geometry']['coordinates'][0]

# Call the NREL API
params = {
'api_key': nrel_api_key,
'lat': latitude,
'lon': longitude,
}
response = requests.get(nrel_api_endpoint, params=params)

# Check if the request was successful
if response.status_code == 200:
data = response.json()

# Add a marker to the map with the utility rate as the popup
utility_name = data['outputs']['utility_name']
utility_rate = data['outputs']['residential']
point_name = feature['properties']['Prime_name']

folium.Marker([latitude, longitude], popup=str((point_name, utility_name, utility_rate))).add_to(m)
else:
print(f'Failed to get data for point at ({latitude}, {longitude}):', response.status_code)
except Exception as e:
print(f'Failed to process feature at ({latitude}, {longitude}):', e)

Display your Map

# Display the map
m
A folium map showing various towns and a popup with the NREL Data

By leveraging tools like APIs, Google Colab, and data formats like GeoJSON, we can democratize access to important government data. This leads to increased transparency, better decision-making, and ultimately, a more informed public.

--

--

Ryan Kmetz

Climate Change | Environmental Intelligence | GIS | Resiliency | Sustainability | https://linktr.ee/rkmetz