A practical guide to the free hourly US grid carbon intensity API, with working code for two use cases: backtesting demand response and timing EV charging. It is a timing and analysis tool, not a source of Scope 2 reporting factors.
GET /api/intensity?zip=94105&hours=24 for up to 168 hours (7 days) for the balancing authority serving that ZIP. Data lags up to about a day; it is not real-time. For live or forecast intensity, WattTime and Electricity Maps offer commercial APIs.
ba_basis says which rule applied, and ba_note appears when the ZIP's utilities sit in different balancing authorities. 47 balancing authorities are mapped; 46 currently report to EIA-930 (WACM has not reported since April 2, 2026, and returns a 404 that says so).Fuel factors (direct, operational CO₂e; not lifecycle):
| Fuel | EIA code | kg CO₂e per MWh | Source (EPA eGRID2023) |
|---|---|---|---|
| Coal | COL | 1,018 | US coal output rate (USCC2ERT, 2,244.545 lb/MWh) |
| Natural gas | NG | 408 | US gas output rate (USGC2ERT, 900.028 lb/MWh) |
| Petroleum | OIL | 708 | US oil output rate (USOC2ERT, 1,560.637 lb/MWh) |
| Other | OTH | 579 | US all-fossil output rate (USFSC2ERT); EIA-930 does not say what "other" burns. Exception: NYISO reports its solar, biomass and landfill gas as "other", so for NYIS it counts as 0. |
| Geothermal | GEO | 28 | Geothermal plants' CO₂e over their net generation (60.7 lb/MWh) |
| Nuclear / hydro / wind / solar / biomass | - | 0 | No combustion; biomass CO₂ is biogenic |
Because these are US-average rates applied to in-region generation only (imports are not counted), hourly values do not add up to the annual eGRID subregion factor. Use them to compare hours, not to report Scope 2.
It depends on the grid's mix. Where solar is a large share (CAISO), midday intensity falls far below the night-time level, a several-fold swing. Where gas runs around the clock (NYISO), the hours differ little, so shifting load in time changes carbon less than shifting it in place. Texas (ERCOT) sits in between, with sun and wind pulling midday down.
The pattern moves with the season and the weather, so this page doesn't quote a fixed week. Ask the API for the last 7 days:
curl "https://emission-factors.com/api/cleanest-hours?zip=94105&duration=4"
# cleanest_window / dirtiest_window: local time (the ZIP's time zone) and UTC
# savings_vs_daily_avg_pct, savings_vs_dirtiest_pct: how much the timing matters
# hours_ranked_local: all 24 hours, cleanest first
Run it for zip=78701 (Austin, ERCOT) and zip=10001 (New York, NYISO) to compare grids. For the hour-by-hour series and fuel mix, use /api/intensity?zip=94105&hours=168.
Say your ops team moved a 1 MWh (1,000 kWh) batch job in ERCOT from the evening to late morning. How much CO₂e did that avoid? Compare the two hours' intensity (both within the last 168 hours; hour_utc is the start of each hour):
import requests
r = requests.get("https://emission-factors.com/api/intensity", params={"ba": "ERCO", "hours": 168})
hours = {h["hour_utc"]: h["intensity_kg_co2e_per_kwh"] for h in r.json()["hourly"]}
def intensity_at(hour_utc):
"""kg CO2e/kWh for one past hour, e.g. "2026-10-17T01:00Z"; None if outside the last 168 hours."""
return hours.get(hour_utc)
dirty = intensity_at("2026-10-17T01:00Z") # 8pm CDT, the old slot
clean = intensity_at("2026-10-17T16:00Z") # 11am CDT, the new slot
kwh = 1000
print(f"Carbon avoided: {kwh * (dirty - clean):.0f} kg CO2e ({(1 - clean / dirty) * 100:.0f}% less)")
Use hours from the last 7 days: older hours return None. For a typical saving rather than one day's, compare the two hours' averages in /api/cleanest-hours (hours_ranked_local).
A 20-vehicle fleet in San Francisco charging 100 kWh per vehicle (2 MWh a day). When is the grid cleanest?
import requests
from collections import defaultdict
# cleanest_hours does this in one call, in local time:
r = requests.get("https://emission-factors.com/api/cleanest-hours",
params={"zip": "94105", "duration": 4})
print(r.json()["cleanest_window"])
# or build the hour-of-day profile yourself from the hourly series (UTC):
r = requests.get("https://emission-factors.com/api/intensity",
params={"zip": "94105", "hours": 168})
by_hour = defaultdict(list)
for h in r.json()["hourly"]:
by_hour[int(h["hour_utc"][11:13])].append(h["intensity_kg_co2e_per_kwh"])
for hour in sorted(by_hour):
print(f"{hour:02d}:00 UTC {sum(by_hour[hour]) / len(by_hour[hour]):.3f}")
Multiply the difference between the cleanest window and the hours you charge now by the kWh moved to get the daily saving. In California the midday window is usually far cleaner than the night; note that utility time-of-use rates often price midday as peak. Grids differ, so run it for your own ZIP rather than assuming. For a depot where vehicles are parked overnight, limit the window with between, e.g. &between=20-06.
/api/calculate). Hourly values use US-average fuel rates and in-region generation only.The annual eGRID factor (e.g. CAMX 0.195 kg/kWh) is EPA's generation-weighted rate for a subregion over a year, from plant-level data, and is the standard input for GHG Protocol Scope 2 location-based reporting. The hourly intensity here applies US-average fuel rates to each hour's in-region fuel mix, so it shows how the grid varies through the day but is not comparable to, or a substitute for, the eGRID factor.
On sunny days solar makes up most of CAISO's midday generation, and solar, wind, hydro and nuclear burn no fuel, so the remaining gas output is a small share and the hourly intensity can approach zero.
47 Lower-48 balancing authorities are mapped (46 currently report to EIA-930). A ZIP maps to one of them through its utility, then its state and eGRID subregion, then its state; you can also call ?ba=CISO directly.
No. The API is free and keyless - no signup, no header, no auth token. Just call the endpoint. Full API docs.
curl "https://emission-factors.com/api/intensity?zip=94105&hours=24"