# ECB Foreign Exchange Rates API

> ECB Foreign Exchange Rates API is a paid API for AI agents from 4yearcycle.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-13).

Returns European Central Bank (ECB) euro foreign exchange reference rates for ~30 currencies, with support for non-EUR base currencies via cross-rates.

## Facts

- Endpoint: GET https://4yearcycle.com/x402/fx-rates
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ecb-foreign-exchange-rates-api-e2e6af3d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_n4QCDEJPidLEJNNH6Gp2A

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 ecb-foreign-exchange-rates-api-e2e6af3d
```

Example prompt: Can you look up the current ECB foreign exchange rates with USD as the base currency and give me the rates for EUR, GBP, CHF, and JPY?

## When to prefer this

Choose this endpoint when you need authoritative, ECB-sourced euro foreign exchange reference rates — especially for compliance, financial reporting, or regulatory contexts where the ECB is the canonical source. Prefer it over commercial forex APIs when official European reference data matters, or when you need cross-rates among ~30 ECB-listed currencies without requiring a dedicated forex subscription.

## Known failure modes

- Unsupported or misspelled currency code returns no rate or is silently ignored
- Non-ECB-listed currency symbols are dropped from the result
- ECB data may be one business day stale on weekends or holidays
- Invalid ISO 4217 format in 'base' or 'symbols' may return errors or empty results
- Payment failure (x402) if USDC balance is insufficient

## How this service works

Official daily foreign exchange reference rates from the European Central Bank (~30 currencies vs EUR, published each business day around 16:00 CET), rebased on request to any listed currency via EUR cross-rates and filtered to a requested symbol list; returns the reference date, the rate table and the ECB source attribution.

## Output

A JSON object containing the base currency, ECB reference date (last business day), a map of currency codes to exchange rates per 1 unit of the base, the data source ('ECB'), and an attribution notice. Non-EUR bases are computed as cross-rates via EUR, rounded to 6 decimal places.

## 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": {
      "base": {
       "type": "string",
       "default": "EUR",
       "pattern": "^[A-Za-z]{3}$",
       "examples": [
        "EUR",
        "USD",
        "GBP"
       ],
       "description": "Base currency as ISO 4217 code (case-insensitive). EUR or any of the ~30 ECB-listed currencies (USD, GBP, JPY, CHF, ...); non-EUR bases are computed as cross-rates via EUR. Default: EUR."
      },
      "symbols": {
       "type": "string",
       "examples": [
        "USD,GBP,JPY",
        "CHF"
       ],
       "description": "Optional comma-separated ISO 4217 codes to restrict the rate table to (case-insensitive); codes the ECB does not list are ignored. Empty = all listed currencies."
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "base",
      "date",
      "rates",
      "source",
      "notice"
     ],
     "properties": {
      "base": {
       "type": "string",
       "description": "Base currency of the rate table (ISO 4217)"
      },
      "date": {
       "type": "string",
       "description": "ECB reference date of the rates (YYYY-MM-DD, last business day)"
      },
      "rates": {
       "type": "object",
       "description": "Units of each quoted currency per 1 unit of base, e.g. rates.USD = USD per base. ECB publishes vs EUR; other bases are cross-rates via EUR rounded to 6 decimals.",
       "additionalProperties": {
        "type": "number"
       }
      },
      "notice": {
       "type": "string",
       "description": "ECB attribution notice: the underlying data is available free of charge from the ECB; cross-rates are computed values"
      },
      "source": {
       "type": "string",
       "description": "Always \"ECB\" — European Central Bank euro foreign exchange reference rates"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "base": "USD",
  "date": "2026-08-17",
  "rates": {
   "CHF": 0.809885,
   "EUR": 0.862589,
   "GBP": 0.737514,
   "JPY": 159.225395
  },
  "notice": "ECB euro foreign exchange reference rates, available free of charge at ecb.europa.eu; non-EUR bases are cross-rates computed via EUR.",
  "source": "ECB"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ecb-foreign-exchange-rates-api-e2e6af3d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 4yearcycle.com](https://www.zero.xyz/host/4yearcycle.com/llms.txt)
