# DataNexusAI Energy Balance API

> DataNexusAI Energy Balance API 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).

Returns Eurostat energy balance metrics (primary production, gross inland consumption, import dependency) for a given EU country and optional product/unit/period filters.

## Facts

- Endpoint: GET https://api.datanexusai.org/api/v1/energy/balance/%7Bgeo%7D?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-balance-api-762014a9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MUewE7JmE0L0_qEDihq-w

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-balance-api-762014a9
```

Example prompt: What's Bulgaria's total energy balance for 2024 — I need primary production and gross inland consumption in KTOE, plus the import dependency percentage and the fuel mix breakdown.

## When to prefer this

Choose this endpoint when you need structured Eurostat energy balance data for a specific EU country, including primary production, gross inland consumption, and import dependency metrics. It is ideal for energy policy research, sustainability reporting, country-level comparisons, and automated analytics pipelines that require machine-readable Eurostat data with optional fuel-mix granularity. Prefer it over scraping Eurostat directly when you need clean, pre-parsed JSON with derived metrics like import dependency percentage.

## Known failure modes

- Invalid or unsupported ISO2 country code returns an error or available:false
- Unsupported SIEC product code may return empty or error
- Data not yet available for the requested period returns available:false or empty metrics
- Invalid unit value falls back to default or returns validation error
- Missing or failed USDC micropayment (x402) returns HTTP 402 Payment Required

## 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

A JSON object containing the requested country code, the endpoint name, an availability flag, key energy balance metrics (primary production and gross inland consumption with unit and period), and a derived import dependency percentage. Optionally includes a fuel-mix breakdown by SIEC product code when view=mix is specified.

## 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"
    },
    "pathParams": {
     "type": "object",
     "required": [
      "geo"
     ],
     "properties": {
      "geo": {
       "type": "string",
       "example": "BG",
       "description": "ISO2 country code"
      }
     }
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "siec": {
       "type": "string",
       "example": "TOTAL",
       "description": "Product code (default TOTAL)."
      },
      "unit": {
       "type": "string",
       "example": "KTOE",
       "description": "Unit (default KTOE; also TJ, GWH)."
      },
      "view": {
       "type": "string",
       "example": "mix",
       "description": "Optional view=mix to include GIC fuel-mix by siec."
      },
      "period": {
       "type": "string",
       "description": "Optional year, e.g. 2024."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "geo": "BG",
  "derived": {
   "import_dependency_pct": 42.1
  },
  "metrics": {
   "primary_production": {
    "unit": "KTOE",
    "value": 9633.8,
    "period": "2024"
   },
   "gross_inland_consumption": {
    "unit": "KTOE",
    "value": 17277.5
   }
  },
  "endpoint": "energy_balance",
  "available": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/datanexusai-energy-balance-api-762014a9/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)
