# DataNexusAI Energy Changes by Country

> DataNexusAI Energy Changes by Country 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-10).

Returns year-over-year changes in energy balance and electricity metrics for a specified EU/EEA country between two years.

## Facts

- Endpoint: GET https://api.datanexusai.org/api/v1/energy/changes/%7Bgeo%7D?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/datanexusai-energy-changes-by-country-df2b5a86
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_reoq9fbdvBNm4OUiHEV0b

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-changes-by-country-df2b5a86
```

Example prompt: Show me how Bulgaria's total energy balance and electricity production changed between 2020 and 2024, using KTOE for the balance and GWH for electricity.

## When to prefer this

Choose this endpoint when you need computed year-over-year energy change metrics (absolute and percentage deltas, direction) for a specific EU/EEA country sourced from Eurostat, rather than raw time-series data. Ideal for dashboards, policy analysis, or investment research where the delta between two specific years matters more than the full historical series. Prefer over raw Eurostat queries when you want pre-computed comparisons with both energy balance and electricity scope in a single call.

## Known failure modes

- Invalid or unsupported ISO2 country code returns an error or empty result
- Missing required 'from' or 'to' query parameters causes a 400 or validation error
- Requested year range has no available Eurostat data for the given country or SIEC product
- Unsupported SIEC or unit code results in no metrics returned
- Payment not settled (x402) returns 402 Payment Required before data is served

## 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 country code, from/to period labels, and nested metrics for both the energy balance and electricity scope. Each metric includes the base and comparison period values with units, the direction of change (up/down), absolute change, and percentage change. Availability flag indicates whether data exists for the requested parameters.

## 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",
     "required": [
      "from",
      "to"
     ],
     "properties": {
      "to": {
       "type": "string",
       "example": "2024",
       "description": "Compare year YYYY"
      },
      "from": {
       "type": "string",
       "example": "2020",
       "description": "Base year YYYY"
      },
      "siec": {
       "type": "string",
       "example": "TOTAL",
       "description": "Balance product (default TOTAL)."
      },
      "unit": {
       "type": "string",
       "example": "KTOE",
       "description": "Balance unit (default KTOE)."
      },
      "scope": {
       "type": "string",
       "example": "both",
       "description": "balance | electricity | both (default both)."
      },
      "electricity_siec": {
       "type": "string",
       "example": "E7000",
       "description": "Electricity product (default E7000)."
      },
      "electricity_unit": {
       "type": "string",
       "example": "GWH",
       "description": "Electricity unit when scope includes electricity (default GWH)."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "geo": "BG",
  "balance": {
   "metrics": {
    "primary_production": {
     "to": {
      "unit": "KTOE",
      "value": 11000,
      "period": "2024"
     },
     "from": {
      "unit": "KTOE",
      "value": 10000,
      "period": "2020"
     },
     "direction": "up",
     "abs_change": 1000,
     "pct_change": 10
    }
   }
  },
  "endpoint": "energy_changes",
  "available": true,
  "to_period": "2024",
  "electricity": {
   "metrics": {
    "gross_production": {
     "direction": "up",
     "pct_change": 5.2
    }
   }
  },
  "from_period": "2020"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/datanexusai-energy-changes-by-country-df2b5a86/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)
