# EIA Electricity Data API

> EIA Electricity Data API is a paid API for AI agents from payai.agentstools.dev, paid per call via x402, $0.008/call, status unknown (last checked 2026-09-15).

Returns US electricity generation mix by fuel type, regional demand, and retail price by state/sector from EIA grid monitor and retail survey data.

## Facts

- Endpoint: GET https://payai.agentstools.dev/energy/electricity
- Price: $0.008/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/eia-electricity-data-api-6fe4a2e0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ABDrfjPlex2S2cCbq8_dX

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 eia-electricity-data-api-6fe4a2e0
```

Example prompt: What does the US electricity generation mix look like right now — break it down by fuel type with percentages, using the national grid region?

## When to prefer this

Use this endpoint when you need authoritative US electricity data sourced directly from EIA — including real-time generation mix by fuel type, regional demand tracking, or monthly retail price surveys. Prefer this over general web search when you need structured, cited, machine-readable energy data with consistent schema. Especially useful for energy policy analysis, sustainability reporting, utility cost benchmarking, or monitoring grid fuel composition over time.

## Known failure modes

- Invalid state code returns error (must be two-letter US state abbreviation or 'US')
- Invalid region enum value returns error
- Invalid metric enum value returns error
- EIA data source unavailability may cause empty or stale results
- history parameter out of range (1-120) returns validation error
- Payment not included or insufficient USDC returns 402 error

## How this service works

US electricity data from the EIA grid monitor and retail survey: generation mix by fuel type with percentage breakdown (latest hour), demand by region, and average retail price by state/sector (monthly).

## Output

Returns structured data on US electricity including: generation mix with percentage share by fuel type (coal, gas, solar, wind, nuclear, etc.) for the latest hour; electricity demand by grid region; or average retail electricity price by state and sector (residential, commercial, industrial), optionally with historical data points.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "state": {
       "type": "string",
       "description": "Two-letter state code or US for retail_price (default US)"
      },
      "metric": {
       "enum": [
        "generation_mix",
        "demand",
        "retail_price"
       ],
       "type": "string",
       "description": "Which electricity series (default generation_mix)"
      },
      "region": {
       "enum": [
        "us",
        "california",
        "carolinas",
        "central",
        "florida",
        "mid_atlantic",
        "midwest",
        "new_england",
        "new_york",
        "northwest",
        "southeast",
        "southwest",
        "tennessee",
        "texas"
       ],
       "type": "string",
       "description": "Grid region for generation_mix/demand (default us)"
      },
      "history": {
       "type": "integer",
       "maximum": 120,
       "minimum": 1,
       "description": "Recent data points for demand/retail_price"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/eia-electricity-data-api-6fe4a2e0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from payai.agentstools.dev](https://www.zero.xyz/host/payai.agentstools.dev/llms.txt)
