# US Electricity Rates by State

> US Electricity Rates by State is a paid API for AI agents from 2s.io, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-12).

Returns historical electricity rates, sales volume, customer counts, and revenue for a given US state, filtered by sector and time range, sourced from the US Energy Information Administration (EIA).

## Facts

- Endpoint: GET https://2s.io/api/energy/electricity-rates?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/us-electricity-rates-by-state-53192d98
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_8KRtlvQIrzKtshDnM_YG0

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability us-electricity-rates-by-state-53192d98
```

Example prompt: What are the residential electricity rates in Texas over the last 24 months, using EIA data?

## When to prefer this

Use this endpoint when you need official, government-sourced US electricity rate data broken down by state and sector over time. Prefer this over generic energy APIs when you need EIA ground-truth data with per-kWh pricing, MWh sales volume, and customer counts at the state level with historical depth up to 10 years.

## Known failure modes

- Missing required 'state' parameter returns validation error
- Invalid or unrecognized 2-letter state code returns error or empty result
- Requesting more than 120 months exceeds the maximum limit
- Invalid sector enum value returns validation error
- No data available for the requested period or state returns empty items array
- Payment failure via x402 (insufficient USDC balance) blocks the request

## How this service works

Retail electricity price and sales for a US state by customer sector (residential, commercial, industrial, transportation, all), monthly, newest first, from EIA. Returns average price (cents/kWh), sales (MWh), revenue ($M), and customer count per month. Public-domain, live-wrap. More granular than energy.prices (which is the national all-sector benchmark only).

## Output

A JSON array of monthly records, each containing: time period (YYYY-MM), electricity sales in MWh, number of customers, price in cents per kWh, and revenue in million USD. Also includes total record count and source metadata (EIA URL, license, provider name).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "queryParams"
   ],
   "properties": {
    "type": {
     "const": "http"
    },
    "method": {
     "const": "GET"
    },
    "queryParams": {
     "required": [
      "state"
     ],
     "properties": {
      "state": {
       "type": "string",
       "description": "2-letter US state code."
      },
      "months": {
       "type": "integer",
       "maximum": 120,
       "minimum": 1
      },
      "sector": {
       "enum": [
        "residential",
        "commercial",
        "industrial",
        "transportation",
        "all"
       ],
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/us-electricity-rates-by-state-53192d98/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
