# DataNexusAI Energy Compare

> DataNexusAI Energy Compare is a paid API for AI agents from api.datanexusai.org, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-11).

Compares Eurostat energy indicator values across multiple EU countries for a given dataset and period, returning ranked observations per geography.

## Facts

- Endpoint: GET https://api.datanexusai.org/api/v1/energy/compare?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/datanexusai-energy-compare-b9457411
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_nrItGLzGMRggcSrFVP6wt

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 datanexusai-energy-compare-b9457411
```

Example prompt: Can you compare the energy intensity indicator (dataset nrg_ind_ei) for Bulgaria, Romania, Greece, and Germany for the year 2022 and show me how they rank against each other?

## When to prefer this

Use this endpoint when you need to cross-compare a specific Eurostat energy dataset across multiple EU member states and receive a ranked output in one call. It is best suited for comparative analytics, policy research, or dashboards that require per-country energy indicator rankings rather than a single-country time series. Prefer it over raw Eurostat API access when you want pre-ranked, normalized results and are comfortable with USDC micropayments.

## Known failure modes

- Invalid or unknown dataset_id returns an error or empty observations
- Requesting more than 15 country codes may be rejected or truncated
- Invalid ISO2 country codes produce missing or empty geo entries
- Unsupported period or frequency combination may return no data
- Missing required parameters (dataset_id or geos) returns a 400-level error
- Payment failure via x402/USDC results in a 402 Payment Required response

## How this service works

Public data API for SEBRA payments, PTP road accidents, EU agri-food prices, Eurostat energy (+ ETS), and trade/market analytics. Paid data endpoints use x402 (USDC micropayments). HTML docs at `/api/` are free and are intentionally omitted from this OpenAPI document so discovery scanners do not probe them as paid resources.

Machine-readable discovery: `https://api.datanexusai.org/openapi.json`, `https://api.datanexusai.org/llms.txt`, `https://api.datanexusai.org/.well-known/x402`.

Human docs: `/docs` and `/api/`.

## Output

Returns a JSON object containing the queried period, endpoint identifier, and a list of observations — each with a country ISO2 code, a numeric observed energy value, and an integer rank indicating relative position among the requested geographies.

## 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",
     "required": [
      "dataset_id",
      "geos"
     ],
     "properties": {
      "freq": {
       "type": "string",
       "example": "A",
       "description": "Frequency filter"
      },
      "geos": {
       "type": "string",
       "example": "BG,RO,GR,DE",
       "description": "Comma-separated ISO2 codes (max 15)"
      },
      "unit": {
       "type": "string",
       "description": "Unit filter"
      },
      "period": {
       "type": "string",
       "example": "2022",
       "description": "Period (default: latest)"
      },
      "dataset_id": {
       "type": "string",
       "example": "nrg_ind_ei",
       "description": "Eurostat dataset id"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "period": "2022",
  "endpoint": "energy_compare",
  "observations": [
   {
    "geo": "BG",
    "rank": 1,
    "obs_value": 175
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/datanexusai-energy-compare-b9457411/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.datanexusai.org](https://www.zero.xyz/host/api.datanexusai.org/llms.txt)
