# Petroleum & Energy Data API (x402 micropayment)

> Petroleum & Energy Data API (x402 micropayment) is a paid API for AI agents from x402helper.xyz, paid per call via x402, $0.013/call, status unknown (last checked 2026-10-31).

Returns US petroleum market data including retail gas/diesel prices, crude oil prices (WTI/Brent), and inventory stocks by PADD region, paid via USDC micropayment.

## Facts

- Endpoint: GET https://x402helper.xyz/89e509/energy/petroleum?utm_source=zero.xyz
- Price: $0.013/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/petroleum-energy-data-api-x402-micropayment-cb485d1c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WNsD9unS0D4OfYQlDrR6r

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 petroleum-energy-data-api-x402-micropayment-cb485d1c
```

Example prompt: What's the current average retail gasoline price in the US, and can you show me the last 20 data points for context?

## When to prefer this

Choose this endpoint when you need structured, machine-readable US petroleum market data (retail gas, diesel, crude oil, or inventory stocks) queryable by PADD region and time range, and you are operating in an x402 micropayment-capable environment. Prefer this over scraping EIA.gov directly when you need a clean API response without HTML parsing. Not suited for natural gas, electricity, or non-US petroleum data.

## Known failure modes

- Invalid metric enum value returns an error or empty result
- Region parameter not applicable to crude price metrics (crude_wti, crude_brent have no regional breakdown)
- History value exceeding 120 causes validation failure
- Payment not included or insufficient USDC causes 402 Payment Required response
- Service unavailable if underlying EIA data source is down

## How this service works

X402 micropayments server — AI agents pay USDC for OFAC screening, rates, and billing verification.

## Output

A JSON object with a 'success' boolean and a 'result' object containing the requested petroleum data series — price values or inventory levels for the selected metric, optionally filtered by PADD region and limited to the requested number of recent 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "metric": {
       "enum": [
        "gas_prices",
        "diesel_prices",
        "crude_wti",
        "crude_brent",
        "crude_stocks",
        "gasoline_stocks",
        "distillate_stocks"
       ],
       "type": "string",
       "default": null,
       "description": "Which petroleum series to return (default gas_prices)"
      },
      "region": {
       "enum": [
        "us",
        "east_coast",
        "midwest",
        "gulf_coast",
        "rocky_mountain",
        "west_coast"
       ],
       "type": "string",
       "default": null,
       "description": "PADD region for retail gasoline/diesel (default us)"
      },
      "history": {
       "type": "integer",
       "default": null,
       "maximum": 120,
       "minimum": 1,
       "description": "Number of recent data points to include"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {},
  "success": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/petroleum-energy-data-api-x402-micropayment-cb485d1c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402helper.xyz](https://www.zero.xyz/host/x402helper.xyz/llms.txt)
