# Power

> Documentation index: [llms.txt](https://westkite.com/docs/llms.txt). Every page is also at its URL plus `.md`.

Returns power infrastructure for a property or a point: power plants with capacity and fuel, substations with voltage and operator, transmission lines, the serving electric utilities with rates and reliability, and published grid capacity. $0.05 per report.

```endpoint
GET /v1/power
```

## Parameters

| Name | Type | Description |
|---|---|---|
| `property_id` | string | A property ID. Or send `lat` and `lng`. |
| `lat`, `lng` | number | A point in the United States, in decimal degrees, instead of `property_id`. |
| `kinds` | string | Comma-separated, any of `power_plants`, `substations`, `transmission_lines`, `electric_utilities`, `power_capacity`, `interconnection_queues`. Default: all of them. |
| `radius_m` | number | Keep features within this many meters, 50 to 200,000, never wider than each source is searched. |
| `limit` | integer | Features per kind, 1 to 50. Default 10. |
| `max_cost_usd` | number | Refuse the call if it costs more. |

## Request

```curl
curl --get "https://api.westkite.com/v1/power" \
  -H "Authorization: Bearer $WESTKITE_API_KEY" \
  --data-urlencode "property_id=property:08cdd01c-64d6-8ed2-b7b8-8158ccadf8a0"
```

```typescript
const params = new URLSearchParams({ property_id: "property:08cdd01c-64d6-8ed2-b7b8-8158ccadf8a0" });
const res = await fetch(`https://api.westkite.com/v1/power?${params}`, {
  headers: { Authorization: `Bearer ${process.env.WESTKITE_API_KEY}` },
});
const { data, missing } = await res.json();
```

```python
import os, requests

res = requests.get(
    "https://api.westkite.com/v1/power",
    params={"property_id": "property:08cdd01c-64d6-8ed2-b7b8-8158ccadf8a0"},
    headers={"Authorization": f"Bearer {os.environ['WESTKITE_API_KEY']}"},
)
body = res.json()
```

## Response

```json 200
{
  "data": {
    "point": { "lat": 29.7604, "lng": -95.3698, "label": "1840 Industrial Way", "property_id": "property:3f2b9c1e-…" },
    "features": [
      {
        "kind": "substations",
        "name": "Example Substation",
        "detail": null,
        "distance_m": 1287,
        "distance_miles": 0.8,
        "direction": "west",
        "facts": [{ "label": "Voltage", "value": "138 kV" }],
        "source": { "id": "osm-substations", "label": "Electrical substations", "publisher": "OpenStreetMap contributors via Overture Maps" }
      },
      {
        "kind": "power_plants",
        "name": "Example Energy Center",
        "detail": null,
        "distance_m": 9978,
        "distance_miles": 6.2,
        "direction": "south",
        "facts": [{ "label": "Capacity", "value": "620 MW" }, { "label": "Fuel", "value": "Natural gas" }],
        "source": { "id": "eia-power-plants", "label": "Power plants (10 MW and larger)", "publisher": "U.S. Energy Information Administration (Form EIA-860)" }
      }
    ],
    "searched": [{ "kind": "substations", "radius_m": 16093 }, { "kind": "transmission_lines", "radius_m": 8047 }, { "kind": "power_plants", "radius_m": 24140 }],
    "headlines": { "power": "…" },
    "sources": [{ "id": "eia-power-plants", "label": "Power plants (10 MW and larger)", "publisher": "U.S. Energy Information Administration (Form EIA-860)" }],
    "note": "Distances are straight-line from the point. A utility or service area at 0 m covers the point; its provider confirms service to the parcel."
  },
  "missing": [],
  "billing": { "operation_id": "op_7f02…", "operation": "power_report", "charged_usd": 0.05, "balance_usd": 9.85 },
  "request_id": "req_7f02…"
}
```

The example's names and figures are placeholders.

- **Reach.** Substations are searched to 10 miles, transmission lines to 5 and power plants to 15. `searched` says how far each kind was searched; `radius_m` only narrows it.
- **The serving utility.** `electric_utilities` is the utility whose territory covers the point, at 0 m, with commercial and industrial rates and reliability. The utility confirms service to the parcel.
- **Grid capacity.** `power_capacity` is hosting or load capacity from the utilities that publish capacity maps. Elsewhere it's in `missing`.
- **Interconnection queue.** `interconnection_queues` is the county's queue of generation and storage waiting to connect to the grid: megawatts waiting, how much has a signed agreement, the busiest connection points, and what connected or withdrew since 2015, from public queue data compiled by a national laboratory and, inside Texas's grid, the grid operator.

A kind that found nothing in its reach is in `missing` as `not_found`. A report that finds nothing at all costs nothing. For roads, rail, water, sewer, gas and brands, see [nearby](https://westkite.com/docs/api/nearby.md).

## Errors

| Code | When |
|---|---|
| [`invalid_request`](https://westkite.com/docs/api/errors.md#invalid_request) | Both or neither of `property_id` and `lat`/`lng`, a point outside the United States, an unknown kind, or a `radius_m` or `limit` out of range. |
| [`not_found`](https://westkite.com/docs/api/errors.md#not_found) | No published property with a location has that ID. |
| [`insufficient_balance`](https://westkite.com/docs/api/errors.md#insufficient_balance) | Your balance can't cover $0.05. |
