Geo
Geo answers "what is near here", and for two kinds of answer that is the same data a paid group covers:
| GET | /geo/nearby/networks | Nearby Networks |
| GET | /geo/nearby/nodes | Nearby Nodes |
| GET | /geo/nearby/power-grid/conditionsstandard+ | Nearby Grid Conditions |
| GET | /geo/nearby/power-grid/load-forecaststandard+ | Nearby Load Forecast |
| GET | /geo/nearby/power-grid/renewablesstandard+ | Nearby Renewables |
| GET | /geo/nearby/sensors | Nearby Sensors |
| GET | /geo/zip/{zip} | Zip Lookup |
| GET | /geo/zip/{zip}/emission-rates | Zip Emission Rates |
| GET | /geo/zip/{zip}/utility-ratesstandard+ | Zip Utility Rates |
How geo behaves
Geo answers "what is near here", and for two kinds of answer that is the same data a paid group covers:
/geo/nearby/power-grid/**— conditions, load-forecast and renewables are thepower_gridgroup, the same restriction as/power-grid/**/geo/zip/{postal_code}/utility-rates— thetariffsgroup, the same published rates as/utilities/**
A free account gets 403 plan_required on those. Everything else here —
nearby sensors, nodes and networks, the postal-code lookup, and
/geo/zip/{postal_code}/emission-rates — is on every plan. Emission factors
are reference data about a grid region, not a price anyone is charged, so
they are not a tariff.
Gating the /power-grid folder alone would have left these as a way round
the restriction; they are gated with it rather than separately, so there is
one answer to "does this customer get market data" instead of two that can
disagree.
Nearby Networks
/api/v2/geo/nearby/networksThe networks that have a node within a radius.
Query parameters
latrequirede.g. 41.9lonrequirede.g. -87.6radius_milesrequirede.g. 50zipoptionale.g. 60601node_typeoptionale.g. zone
Same origin and filter parameters as Nearby Nodes.
nearest_node, distance_miles and nodes_in_radius say why the
network is in the result — whether it is here because one node is a mile
away or because forty are. Returning the networks alone discards that.
Worth knowing
One statement, not a lookup per matched node. The grouping is a
GROUP BY in the same statement that resolved the nodes, so a transient
failure cannot append a network with a nil id and an empty name alongside
real data.
The ordering is total: distance, then the id. Sorting by distance alone permutes nodes that tie, which makes three identical requests return three different orderings and makes paging over them unsound.
Example: ?lat=41.9&lon=-87.6&radius_miles=50 returns incentives, noaa and
pjm, with Cook County containing the origin.
Errors
| as Nearby Nodes |
- Security
- a read behind the v2 capability gate (`v2` + `read`, no role).
- Cache
- slow tier.
curl "https://utility-api-86672132515.us-east1.run.app/api/v2/geo/nearby/networks?lat=41.9&lon=-87.6&radius_miles=50" \
-H "Authorization: $GRIDBASE_API_KEY"{
"meta": { "source": "network", "class": "computed", "count": 3, "total": 3, "notes": [...] },
"items": [
{
"id": "78d7c518-a8d8-43ad-83b9-0981b7159ad2",
"name": "incentives",
"description": "Geographic regions that energy incentives and programs apply to: ...",
"nearest_node": { "id": "83b7f6cd-...", "name": "Cook County, IL" },
"distance_miles": 0,
"nodes_in_radius": 46
}
]
}Nearby Nodes
/api/v2/geo/nearby/nodesNodes within a radius of a point, nearest first.
Query parameters
ziprequirede.g. 60601radius_milesrequirede.g. 25limitrequirede.g. 25latoptionale.g. 41.9lonoptionale.g. -87.6node_typeoptionale.g. countyoffsetoptionale.g. 0
Origin: either lat and lon, or zip. Giving both is refused rather
than silently preferring one and dropping the other.
Parameters: lat, lon, zip, radius_miles (1–1000, default 100),
node_type (a slug), limit, offset. Anything else is refused.
distance_miles is measured to the node's footprint where it has one,
and to its coordinates otherwise. matched_on says which. contains_origin
distinguishes "0 miles because you are standing inside this zone" from
"0 miles because the node is at this exact point" — two different facts, and
collapsing them is how a distance bug hides.
Ordering is containment first, then distance, then the node id, so it is total and paging cannot repeat or skip a row.
Every value is bound; the bounding-box expansion is computed in Go from a range-checked radius and bound as float8. Data class: computed distance over reference topology.
milliseconds of PostGIS, so caching is worth more than freshness.
Worth knowing
One query answers both origins. zip and lat/lon resolve through
the same path, so the two cannot disagree about what "nearby" means or
about how a node with a footprint is ranked.
A node with a footprint is not automatically at distance zero. Treating
containment as distance 0 makes every geometry-bearing node pass any
radius, which returns the whole country ranked as though all of it were
underfoot. Containment and distance are reported separately — see
distance_miles and the containment flag above.
lat and lon are each parsed into their own error and both are
range-checked, so a bad lat with a good lon is a 400 rather than a
search of the equator.
One name for each parameter. radius_miles for the radius and zip
for the postal origin, and anything else is refused — a caller who sends
radius or miles is told, instead of silently getting the 100-mile
default.
Errors
| 400 | missing_param | no origin given |
| 400 | missing_param | lat without lon, or lon without lat |
| 400 | invalid_param | lat or lon is not a number, or out of range |
| 400 | invalid_param | both zip and lat/lon given |
| 400 | invalid_param | radius_miles outside 1–1000 |
| 400 | invalid_param | an unrecognised parameter |
| 404 | not_found | the zip is not in the reference table |
| 422 | invalid_param | the zip has no coordinates (645 of 41,533) |
- Security
- a read behind the v2 capability gate (`v2` + `read`, no role).
- Cost
- 403ms for 50 miles of Chicago.
- Cache
- slow tier — the topology is static but the search is a few hundred
curl "https://utility-api-86672132515.us-east1.run.app/api/v2/geo/nearby/nodes?zip=60601&radius_miles=25&limit=25" \
-H "Authorization: $GRIDBASE_API_KEY"{
"meta": {
"source": "node", "class": "computed",
"count": 1, "limit": 100, "offset": 0, "total": 1,
"notes": [
"measured from 41.8858,-87.6181 (postal code 60601) within 5 miles",
"distance_miles is to the node's footprint where it has one and to its coordinates otherwise; ..."
]
},
"items": [
{
"id": "83b7f6cd-9b09-596d-9bca-b3446fc24272",
"name": "Cook County, IL",
"description": "County: Cook County. Source: Census TIGERweb, January 2026 vintage.",
"lat": 41.820378500000004, "lon": -87.55569057349786,
"network": { "id": "78d7c518-...", "name": "incentives" },
"node_type": { "id": "ac5a0ee9-...", "slug": "county", "name": "County" },
"distance_miles": 0,
"contains_origin": true,
"matched_on": "footprint"
}
]
}Nearby Grid Conditions
/api/v2/geo/nearby/power-grid/conditionsGrid conditions at a location: real-time price, day-ahead price and the renewable share, from the nearest node carrying each.
Query parameters
ziprequirede.g. 60601radius_milesrequirede.g. 50latoptionale.g. 41.9lonoptionale.g. -87.6
Every member is nullable and resolved independently, so a location with a real-time price and no day-ahead price gets the one it has, with a warning naming the other. An absent sensor is null, never 0 — a zero here reads as "the price is $0".
source says which node answered and how far away it is, so a caller can
tell whether a price 40 miles away is close enough for its purpose.
Data class: measured, per member.
Edge cases, all of which this route answers rather than refuses:
More than one node in the radius is the normal case, not an error. Searching 60601 within even one mile already matches several nodes; a route whose job is to search a radius cannot treat that as a 400.
An empty radius is a 404 naming what was searched for. Adak, Alaska within one mile has no nodes at all, and that is an answer, not a fault.
A reading in no configured band gives band: null, with a warning. A
sensor that has reported but has no band rows is a different case from one
that has never reported, and both have to be survivable.
A stale reading is still returned. Each reading carries its own
timestamp and meta.as_of carries the newest, so a caller decides what is
too old for its purpose rather than being handed nothing at all.
Errors
| as Nearby Nodes, plus | ||
| 404 | not_found | no price or renewable sensor within the radius |
- Security
- a read behind the v2 capability gate (`v2` + `read`, no role).
- Cache
- live tier — prices move every five minutes.
curl "https://utility-api-86672132515.us-east1.run.app/api/v2/geo/nearby/power-grid/conditions?zip=60601&radius_miles=50" \
-H "Authorization: $GRIDBASE_API_KEY"{
"meta": {
"source": "sensor_num_series_latest", "class": "measured",
"as_of": "2026-11-08T04:00:00Z",
"warnings": ["no renewable-generation sensor within the radius"],
"notes": ["measured from 41.8858,-87.6181 (postal code 60601) within 50 miles", ...]
},
"item": {
"source": {
"node": { "id": "cac36285-...", "name": "COMED" },
"network": { "id": "f1fd9f51-...", "name": "pjm" },
"distance_miles": 0, "contains_origin": true,
"sensor": { "id": "1232001d-...", "name": "Real-Time LMP" }
},
"real_time_price": {
"price_mwh": 17.75,
"at": "2026-11-07T17:50:00Z",
"band": { "name": "low", "recommendation": "..." },
"next_price_mwh": null, "next_at": null
},
"day_ahead_price": { ... },
"renewables": null
}
}Nearby Load Forecast
/api/v2/geo/nearby/power-grid/load-forecastThe daily load forecast for the next 30 days at a location.
Query parameters
ziprequirede.g. 60601radius_milesrequirede.g. 50latoptionale.g. 41.9lonoptionale.g. -87.6
This is load, not capacity. The sensor type is ldfct — Load Forecast —
and the fields are named for load. The two are different quantities, and
conflating them in a field name is how a caller sizes a battery against the
wrong number.
One object rather than a collection, because source describes the whole
answer; repeating it on every day would be the only other way to carry it.
readings is how many forecast points each day rests on. Without it, a day
built from one reading and a day built from 24 look identical.
Worth knowing
The days are in date order, every time. Bucketing rows into a map and iterating it returns them in a different order on each call, which is not a property a client can build a chart on.
One sensor answers, and source names it. Concatenating the forecasts
of every matched node into one "summary" mixes several nodes' numbers with
nothing saying which contributed — so the resolution picks one sensor and
says which it picked.
Aggregation happens in SQL, not by reading 1000 raw rows per node and bucketing them in the application.
Errors
| as Nearby Nodes, plus | ||
| 404 | not_found | no load-forecast sensor within the radius |
- Security
- a read behind the v2 capability gate (`v2` + `read`, no role).
- Cache
- live tier — the forecast is re-published hourly.
curl "https://utility-api-86672132515.us-east1.run.app/api/v2/geo/nearby/power-grid/load-forecast?zip=60601&radius_miles=50" \
-H "Authorization: $GRIDBASE_API_KEY"{
"meta": {
"source": "sensor_num_series_v2", "class": "forecast",
"coverage": { "from": "...", "to": "..." }, "total": 8, "notes": [...]
},
"item": {
"source": {
"node": { "id": "cac36285-...", "name": "COMED" },
"network": { "id": "f1fd9f51-...", "name": "pjm" },
"distance_miles": 0, "contains_origin": true,
"sensor": { "id": "...", "name": "Load Forecast" }
},
"days": [
{
"date": "2026-11-07",
"avg_load_mw": 9268.333333333334,
"min_load_mw": 8998, "max_load_mw": 9861,
"min_at": "2026-11-07T20:00:00Z",
"max_at": "2026-11-07T23:00:00Z",
"readings": 6
}
]
}
}Nearby Renewables
/api/v2/geo/nearby/power-grid/renewablesThe current renewable share of generation at a location.
Query parameters
latrequirede.g. 42.09lonrequirede.g. -78.46radius_milesrequirede.g. 25zipoptionale.g. 10001
The reading is a percentage, not a fraction — the sensor type is rwgnp,
Renewable Generation Percentage. age_seconds lets a caller judge staleness
without comparing clocks, and a reading over an hour old is warned about.
There are exactly two of these sensors in the fleet: ISO-NE's at 42.4072,-71.3824 and NYISO's at 42.089498,-78.457328. Anywhere else answers 404 naming the radius it searched.
Read from sensor_num_series_latest, the trigger-maintained per-sensor
latest row that CLAUDE.md names as the right source for a "latest" query.
Worth knowing
One shape, always. {meta, item} whether the nearest renewable sensor
is a mile away or the radius is empty — there is no fallback branch that
answers with a different shape.
The radius is the question, and it is not quietly widened. If nothing in range carries a renewable-generation sensor, that is a 404 naming what was searched for. Falling back to every renewable sensor on the nearest node's network answers a different question, and a result hundreds of miles from the origin would look like a local one.
source.distance_miles is explicit, so a caller can judge whether the
answering sensor is close enough for its purpose.
Example: NYISO's renewable mix read 26.596% at 2026-11-07T17:30Z for
?zip=10001&radius_miles=50.
Errors
| as Nearby Nodes, plus | ||
| 404 | not_found | no renewable-generation sensor within the radius |
| 404 | not_found | the nearest one has never reported a value |
- Security
- a read behind the v2 capability gate (`v2` + `read`, no role).
- Cache
- live tier.
curl "https://utility-api-86672132515.us-east1.run.app/api/v2/geo/nearby/power-grid/renewables?lat=42.09&lon=-78.46&radius_miles=25" \
-H "Authorization: $GRIDBASE_API_KEY"{
"meta": {
"source": "sensor_num_series_latest", "class": "measured",
"as_of": "2026-11-07T17:35:00Z", "notes": [...]
},
"item": {
"source": {
"node": { "id": "bf6879ce-...", "name": "nyiso" },
"network": { "id": "cbace340-...", "name": "nyiso" },
"distance_miles": 0.14132630794907738,
"contains_origin": false,
"sensor": { "id": "fb8978ef-...", "name": "Renewable Generation Mix" }
},
"mix": {
"percent_of_generation": 26.60834223720786,
"at": "2026-11-07T17:35:00Z",
"age_seconds": 1417
}
}
}Nearby Sensors
/api/v2/geo/nearby/sensorsThe sensors on nodes within a radius.
Query parameters
ziprequirede.g. 60601radius_milesrequirede.g. 2limitrequirede.g. 50latoptionale.g. 41.9lonoptionale.g. -87.6node_typeoptionale.g. pricing-nodeoffsetoptionale.g. 0
Same origin and filter parameters as Nearby Nodes. distance_miles is the
sensor's node's distance. Archived sensors are excluded, matching
/api/v2/sensors.
Worth knowing
It pages. 60601 within 2 miles is 554 sensors; without paging that is one 208,355-byte response, and a node that happens to hold a full page worth of sensors is not a client error.
A search matching no nodes returns [], never null.
One join, not a query per matched node.
The ordering is total: distance, then the node id, then the sensor id. Sorting by distance alone is non-deterministic where distances tie — three identical requests can return three different orderings — and paging over that repeats and skips rows.
Errors
| as Nearby Nodes |
- Security
- a read behind the v2 capability gate (`v2` + `read`, no role).
- Cache
- slow tier.
curl "https://utility-api-86672132515.us-east1.run.app/api/v2/geo/nearby/sensors?zip=60601&radius_miles=2&limit=50" \
-H "Authorization: $GRIDBASE_API_KEY"Zip Lookup
/api/v2/geo/zip/{zip}The reference row for a 5-digit US ZIP.
Path parameters
ziprequirede.g. 60601
Returns city, state, county, FIPS, eGRID subregion, zone, coordinates and the ASHRAE/IECC climate zone. Every nullable field is an explicit null, so a ZIP at 0,0 is distinguishable from one with no coordinates.
meta.warnings says when a ZIP is missing something a caller is likely to
need next: 645 of 41,533 have no coordinates (so the /geo/nearby routes
cannot resolve them) and 1,120 have no climate zone (which the load-profile
estimate needs).
The response is a hand-written shape rather than the generated model, so a new database column cannot leak into the contract.
ZIP is validated against ^\d{5}$ before it reaches the database and is bound. Data class: reference, third-party.
A 404 carries a machine code and says how many ZIPs the table covers.
Errors
| 400 | invalid_param | postal_code is not 5 digits |
| 404 | not_found | no such postal code |
- Security
- a read behind the v2 capability gate (`v2` + `read`, no role). The
- Cache
- static tier.
curl "https://utility-api-86672132515.us-east1.run.app/api/v2/geo/zip/60601" \
-H "Authorization: $GRIDBASE_API_KEY"Zip Emission Rates
/api/v2/geo/zip/{zip}/emission-ratesThe EPA eGRID emission factor and generation mix for a ZIP's subregion.
Path parameters
ziprequirede.g. 60601
Data class: reference, third-party (EPA eGRID).
Worth knowing
The postal code is validated against ^\d{5}$ before it reaches the
database.
A ZIP with no eGRID subregion is a 404 naming the reason. No ZIP lacks one today — 0 of 41,533 — but one ingest of an unmapped ZIP should not take the route down.
A database error is a 500, never a 200. This is the response a caller computes carbon from; a zero-valued subregion served with a 200 reads as "this grid is perfectly clean", which is the most expensive possible way to be wrong here.
One row, so {meta, item}. egrid_subregion is keyed by its code.
The fuel columns are fractions and say so. The columns are
numeric(5,4), so 0.3421 means 34.21% — the fields are named *_fraction
rather than *_percent, and a warning fires when the nine do not sum to 1,
so an incomplete published mix is not charted as though it totalled 100%.
Errors
| 400 | invalid_param | postal_code is not 5 digits |
| 404 | not_found | no such postal code |
| 404 | not_found | the ZIP is not mapped to an eGRID subregion |
| 404 | not_found | the subregion has no emission-factor row |
- Security
- a read behind the v2 capability gate (`v2` + `read`, no role).
- Cache
- static tier.
curl "https://utility-api-86672132515.us-east1.run.app/api/v2/geo/zip/60601/emission-rates" \
-H "Authorization: $GRIDBASE_API_KEY"{
"meta": { "source": "egrid_subregion", "class": "reference" },
"item": {
"subregion": "RFCW",
"subregion_name": "...",
"description": "...",
"emission_factor_kg_co2_per_kwh": 0.42,
"fuel_mix": {
"coal_fraction": 0.3421, "natural_gas_fraction": 0.28,
"nuclear_fraction": 0.31, "hydro_fraction": 0.01,
"wind_fraction": 0.05, "solar_fraction": 0.005,
"biomass_fraction": 0.0, "geothermal_fraction": 0.0,
"other_fraction": 0.0
}
}
}Zip Utility Rates
/api/v2/geo/zip/{zip}/utility-ratesThe EIA-published utility rates for a ZIP.
Path parameters
ziprequirede.g. 60601
Query parameters
limitrequirede.g. 25offsetoptionale.g. 0
Data class: reference, third-party (EIA).
Worth knowing
The rates name their unit: USD per kWh, in the field names. Neither the columns nor the published source state it, so the field names have to.
The postal code is validated against ^\d{5}$, so
/geo/zip/abcde/utility-rates is refused rather than answered with an
empty list.
An empty result says which fact it is. A ZIP that does not exist is a
404; a ZIP with no EIA utility mapped to it is an empty list with a
warning. Returning [] for both leaves a caller unable to tell a typo
from an unserved area.
The ordering is total: utility name, then the primary key. The EIA id is not unique across this join, so ordering on it alone lets paging repeat a row.
limit defaults to 100 and caps at 1000, refusing above the cap rather
than clamping.
updated_at is stored timestamp without time zone, so it carries no
offset; it is read as UTC, which is what the ingest writes.
Errors
| 400 | invalid_param | postal_code is not 5 digits |
| 400 | limit_exceeded | limit above 1000 |
| 404 | not_found | no such postal code |
- Security
- a read behind the v2 capability gate (`v2` + `read`, no role).
- Cache
- static tier.
curl "https://utility-api-86672132515.us-east1.run.app/api/v2/geo/zip/60601/utility-rates?limit=25" \
-H "Authorization: $GRIDBASE_API_KEY"{
"meta": {
"source": "eia_utility_rate", "class": "reference",
"count": 2, "limit": 25, "offset": 0, "total": 2
},
"items": [
{
"eiaid": 4110,
"utility_name": "Commonwealth Edison Co",
"service_type": "Bundled",
"ownership": "Investor Owned",
"description": "...",
"residential_rate_usd_per_kwh": 0.1512,
"commercial_rate_usd_per_kwh": 0.0981,
"industrial_rate_usd_per_kwh": 0.0672,
"updated_at": "2026-01-14T00:00:00Z"
}
]
}