# 2s Energy Prices API

> 2s Energy Prices API is a paid API for AI agents from 2s.io, paid per call via x402, $0.00288/call, status unknown (last checked 2026-09-13).

Returns current and historical benchmark energy prices (crude oil, natural gas, gasoline, diesel, electricity) as time-series or snapshot data.

## Facts

- Endpoint: GET https://2s.io/api/energy/prices
- Price: $0.00288/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-energy-prices-api-bdc40125
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_jkghGOPQkea1GwT7cB6-z

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 2s-energy-prices-api-bdc40125
```

Example prompt: What are the last 12 price readings for Henry Hub natural gas? I want the full time series.

## When to prefer this

Use this endpoint when you need ground-truth, regularly updated benchmark energy prices (WTI crude, Brent crude, Henry Hub gas, retail gasoline, diesel, electricity) without needing to sign up for an API key. Ideal for AI agents that need pay-per-call access to official energy price data for financial analysis, cost modeling, or market monitoring.

## Known failure modes

- Invalid series enum value returns a validation error
- limit out of range (below 1 or above 100) returns a 400-level error
- Upstream data provider unavailable may return stale or empty items array
- Missing payment or insufficient USDC balance returns HTTP 402

## How this service works

US energy benchmark prices from the EIA (Energy Information Administration) open data API. Omit series for a one-call snapshot of the latest value of every benchmark; pass series for its recent time series (newest first). Benchmarks: wti_crude / brent_crude ($/barrel), henry_hub_gas ($/MMBtu), gasoline_regular / diesel ($/gallon), electricity_retail (cents/kWh). Each observation has date, value, units, and frequency. Public-domain US government data.

## Output

A JSON object with an array of price observations, each containing the benchmark series ID, human-readable label, date, numeric value, units (e.g. USD/barrel), and reporting frequency. Also includes metadata about the query mode (snapshot or series), total row count, and data source provenance (provider name, URL, license).

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "limit": 12,
   "series": "henry_hub_gas"
  }
 }
}
```

## 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": {
     "type": "object",
     "properties": {
      "limit": {
       "type": "integer",
       "default": 12,
       "maximum": 100,
       "minimum": 1,
       "description": "Observations to return in single-series mode (1-100). Default 12. Ignored in snapshot mode."
      },
      "series": {
       "enum": [
        "wti_crude",
        "brent_crude",
        "henry_hub_gas",
        "gasoline_regular",
        "diesel",
        "electricity_retail"
       ],
       "type": "string",
       "description": "Optional benchmark id. Omit for a snapshot of all benchmarks. One of: wti_crude, brent_crude, henry_hub_gas, gasoline_regular, diesel, electricity_retail."
      }
     },
     "additionalProperties": false
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-energy-prices-api-bdc40125/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)
