ECB Reference Rates: Euro FX with its limits
收藏资源简介:
The official European Central Bank euro foreign exchange reference rates, with every limit of the data written on the label: 29 currencies and not 170, an explicit null with a reason on the ~109 days a year the ECB does not publish, source decimals preserved per currency, and every non-euro cross rate flagged as derived with the rounding band it really carries.
数据集概述:ECB Reference Rates: Euro FX with its limits
本API提供欧洲央行(ECB)欧元外汇参考汇率(European Central Bank euro foreign exchange reference rates),数据来源为欧洲央行数据门户(ECB Data Portal),并明确标注了数据的各项限制,确保使用者能准确理解数据的真实含义与适用范围。
核心数据特点
- 涵盖货币数量:精确覆盖ECB发布的29种货币(非“170+”),另附10种已停用货币及其停用日期,以及7种刻意不提供的货币代码及原因。
- 数据不可用时的处理:ECB在周末及TARGET休市日(每年约109天)不发布汇率。API对这些日期返回
rate: null,并附带reason_code(如weekend、target_closing_day、currency_gap等)、休市日名称、上一个/下一个发布日,确保货币键始终存在,避免客户端因缺失键而崩溃。 - 基础货币与交叉汇率:基础货币为欧元(EUR)。所有非欧元对(如USD/JPY)均由本API从两个ECB汇率计算得出,并标记为
derived: true,附计算公式及舍入误差带(如USD/JPY在2026-08-14为159.0127,不确定度为±1.12日元),明确指出真正可信的小数位数。 - 小数精度保持:保留ECB发布的原始小数位数(如GBP为5位、JPY为2位、CZK为3位),
display字段保留原始精度(含尾随零),rate字段用于算术计算。 - 双时间戳:区分汇率参考时间(14:15 CET)与发布时间(约16:00 CET),并返回对应的UTC时刻,处理夏令时。
- 发布日历查询:提供
GET /v1/calendar/{date}端点,用于查询某日ECB是否发布数据,无需请求汇率数据。
数据局限与明确声明
- 非交易价格:ECB明确表示“强烈不建议将参考汇率用于交易”,本API在
meta.transaction_use中重申此声明,适用于发票政策、会计重估、监管报告和分析,不适用于实际支付定价(需Dealable Quote)。 - 不覆盖170种货币:仅覆盖ECB官方发布的29种货币,不整合其他央行数据。
- 不虚构周末数据:星期六永不返回汇率(返回null),不进行向前结转。
- 不伪造缺失数据:无发布日返回null(如ISK在2008-12-10至2018-01-31期间中断,返回
currency_gap原因),不提供冻结或重复值。 - 交叉汇率非ECB官方数据:所有非欧元交叉汇率明确标记为
derived: true,附公式与误差带。
API端点
| 方法 | 路径 | 说明 |
|---|---|---|
| GET | /v1/latest |
获取最近一次ECB发布 |
| GET | /v1/rates/{date} |
获取指定日期汇率,若无发布则返回原因 |
| GET | /v1/convert |
货币转换,附带实际误差带 |
| GET | /v1/timeseries |
时间序列,逐日列出缺失原因 |
| GET | /v1/currencies |
完整货币覆盖列表(含停用与拒绝服务代码) |
| GET | /v1/calendar/{date} |
查询该日ECB是否发布数据及原因 |
| GET | /health |
服务存活检查 |
响应示例(2026-08-15,星期六)
json { "data": { "date": "2026-08-15", "base": "EUR", "publication": { "published": false, "reason_code": "weekend", "reason": "The ECB has never published a reference rate on a Saturday or a Sunday...", "previous_publication_date": "2026-08-14", "next_publication_date": "2026-08-17" }, "currencies_with_rate": 0, "rates": { "USD": { "currency": "USD", "name": "US dollar", "rate": null, "display": null, "derived": false, "reason_code": "weekend", "reason": "The ECB has never published a reference rate on a Saturday or a Sunday..." } } }, "meta": { "source": "European Central Bank (ECB)", "source_notice": "Source: European Central Bank. This information may be obtained free of charge from the ECB...", "rate_type": "reference rate (not a transaction rate, not a mid-market quote from a dealer)", "transaction_use": "The ECB publishes these reference rates for information purposes only. Verbatim from the ECB: "Using the rates for transaction purposes is strongly discouraged."..." } }
错误处理
- 无发布日返回200(非错误),包含
reason_code。 - 400:未知货币代码、日期格式错误、时间范围超过366天、负数金额。
- 404:无效路由。
- 429:达到套餐配额(硬性上限,不额外计费)。
- 503:ECB数据门户不可用,不提供过期数据,建议使用
Retry-After重试。
订阅计划
- BASIC(免费):500次/月,无需信用卡。
- PRO:$9.90/月,25,000次/月。
- ULTRA:$24.90/月,150,000次/月。
- MEGA:$49.90/月,500,000次/月。
所有计划均有硬性月度上限,不会产生超额费用。
数据来源与合规
- 数据源为欧洲央行数据门户(SDMX 2.1,数据流
EXR,系列D.{currency}.EUR.SP00.A)。 - 每个响应中均包含
meta.source_notice,提示用户可从ECB官网免费获取数据(https://www.ecb.europa.eu/stats/eurofxref/ 和 https://data.ecb.europa.eu)。 - 修改数据(如交叉汇率)会明确声明,符合ECB使用条款,本API与ECB无隶属关系。
其他说明
- API不存储用户请求(无数据库)。
- 覆盖范围、发布日计数、货币缺口均基于ECB完整历史数据实测(1999-01-04至2026-08-14,共7,071个发布日及134个工作日休市)。
- 支持联系开发者:support@synergicapis.com。




