# EU Government Deficit as % of GDP (Eurostat)

> EU Government Deficit as % of GDP (Eurostat) is a paid API for AI agents from api.vextorium.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-15).

Returns the annual government deficit or surplus as a percentage of GDP for any European country, or a ranking of all countries, using official Eurostat data.

## Facts

- Endpoint: POST https://api.vextorium.com/v1/eu-government-deficit?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/eu-government-deficit-as-of-gdp-eurostat-138b9207
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3JswoO3zXmC5vwDrvI3FB

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 eu-government-deficit-as-of-gdp-eurostat-138b9207 -d '<json body>'
```

Example prompt: What is Spain's annual government deficit as a percentage of GDP according to Eurostat — can you pull the last 5 years of data?

## When to prefer this

Use this endpoint when you need official, Eurostat-sourced annual government deficit or surplus data expressed as a percentage of GDP for EU/EEA member states. Prefer this over general economic data APIs when you specifically need European fiscal balance figures with official provenance (CC BY 4.0). It also uniquely supports returning a cross-country ranking in a single call. For US federal deficit data, use the sibling endpoint covering US federal receipts and outlays instead.

## Known failure modes

- Invalid country ISO code returns an error or empty result
- Requesting a country outside the European statistical area may return no data
- Very recent years may not yet be available in Eurostat's published dataset
- Omitting required fields like 'type', 'method', or 'bodyType' in the input wrapper causes a schema validation error

## How this service works

Annual government deficit (-) or surplus (+) as % of GDP for any European country; without a country, a ranking. Official Eurostat data.

## Output

Returns a JSON object containing the country name, ISO code, the latest period and balance_pct_gdp value, a historical time series of annual deficit/surplus percentages, the Eurostat data source citation, and the last updated timestamp. When no country is specified, returns a ranked list of all European countries.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "years": {
   "type": "integer"
  },
  "country": {
   "type": "string",
   "description": "ISO code (ES, DE, FR...), EU, EA or omit for a ranking of all countries"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "last": {
   "period": "2025",
   "balance_pct_gdp": -2.4
  },
  "name": "Spain",
  "series": [
   {
    "period": "2021",
    "balance_pct_gdp": -6.7
   },
   {
    "period": "2022",
    "balance_pct_gdp": -4.6
   }
  ],
  "source": "Eurostat (gov_10dd_edpt1, CC BY 4.0)",
  "country": "ES",
  "updated": "2026-04-22T11:00:00+0200"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/eu-government-deficit-as-of-gdp-eurostat-138b9207/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.vextorium.com](https://www.zero.xyz/host/api.vextorium.com/llms.txt)
