Free Exchange Rate API
Compare, Test, and Integrate免费汇率 API
比较、测试与可靠接入
Choose a free exchange rate API by rate type, data freshness, currency coverage, usage rights, and failure behavior—then verify the response before you integrate it.
按汇率类型、数据时效、币种覆盖、使用许可和故障行为选择免费汇率 API,并在接入前验证真实响应。
Free exchange rate API: the short answer免费汇率 API:先看结论
A useful free exchange rate API is not simply the provider with the largest currency count. It is the one whose rate type, publication schedule, base-currency rules, license, quota, and error behavior fit your application. For price display, accounting, reporting, and low-frequency conversion, daily or hourly reference rates may be sufficient. Trading, hedging, or execution workflows need market data with bid/ask timestamps and should not rely on a general reference-rate endpoint.
真正适合你的免费汇率 API,不一定是币种数量最多的服务,而是汇率类型、发布时间、基准币规则、许可、额度和错误行为都符合应用需求的服务。价格展示、会计、报表和低频换算通常可使用日频或小时级参考汇率;交易、对冲或成交系统则需要带买卖价和精确时间戳的市场数据,不能把普通参考汇率接口当作交易行情。
Reference midpoint, card rate, accounting rate, or executable bid/ask?需要参考中间价、卡组织价、会计汇率,还是可成交买卖价?
Confirm keys, quotas, attribution, caching, and commercial-use terms.核对密钥、额度、署名、缓存和商用条款。
Inspect source date, base currency, pair direction, precision, and errors.检查来源日期、基准币、币种方向、精度和错误响应。
Define the rate before choosing a free exchange rate API选择免费汇率 API 前先定义汇率类型
Reference rates and trading quotes solve different jobs参考汇率与交易报价解决不同任务
A central-bank or blended reference rate is designed for valuation and conversion, not guaranteed execution. A trading quote normally identifies bid, ask, venue, and a precise timestamp. If your application only stores one number per currency pair, state whether it is a midpoint, reference fixing, or derived cross rate.
央行或聚合来源的参考汇率用于估值和换算,并不保证能够按该价格成交。交易报价通常需要明确买价、卖价、市场来源和精确时间戳。如果应用只保存一个币种对数值,应明确它是中间价、参考定盘价还是推导交叉汇率。
Write the data contract before comparing providers比较供应商前先写清数据契约
List the base and quote currencies, maximum acceptable age, required historical start date, refresh interval, rounding rule, and expected outage behavior. This turns “find a free API” into a testable requirement rather than a provider popularity contest.
先列出基准币与报价币、允许的最大数据年龄、历史起始日期、刷新周期、舍入规则和停机时的预期行为。这样,“找一个免费 API”才会变成可验证的需求,而不是供应商热度比较。
Match a free exchange rate API to the actual use case让免费汇率 API 匹配真实使用场景
The same endpoint can be suitable for one workflow and unsafe for another. Decide how the rate affects users, money, and downstream records before setting freshness or reliability requirements.
同一个接口可能适合一种工作流,却不适合另一种。设置时效与可靠性要求前,应先判断汇率如何影响用户、资金和下游记录。
| Use case使用场景 | Usually sufficient通常需要 | Important checks重点检查 |
|---|---|---|
| Localized price display本地化价格展示 | Daily or hourly reference rate日频或小时级参考汇率 | Cache age, rounding, visible currency code缓存年龄、舍入方式、清晰币种代码 |
| Invoices and accounting发票与会计 | Documented fixing for a defined date指定日期的明确参考定盘价 | Source, timezone, audit trail, historical reproducibility来源、时区、审计记录、历史可复现性 |
| Travel or budgeting app旅行或预算应用 | Recent midpoint or reference rate近期中间价或参考汇率 | Offline fallback, stale label, broad currency coverage离线回退、陈旧标记、广泛币种覆盖 |
| Checkout estimate结账金额预估 | Recent indicative rate plus margin policy近期指示价加明确加价规则 | Final settlement disclaimer, refresh timing, precision最终结算说明、刷新时点、精度 |
| Trading or hedging交易或对冲 | Venue-specific bid/ask market data特定市场的买卖盘行情 | Latency, timestamp precision, venue, executable status延迟、时间戳精度、市场来源、可成交性 |
Calculate the request budget before choosing a free quota选择免费额度前先计算请求预算
Estimate monthly calls as active instances × refreshes per day × active days, then add retries, cache misses, test traffic, and deployment checks. A browser that requests rates on every page view can consume a free tier far faster than a server-side cache that fetches once per publication cycle.
月请求量可按“活跃实例数 × 每日刷新次数 × 活跃天数”估算,再加上重试、缓存未命中、测试流量和部署检查。每次页面浏览都直接请求汇率,会比按发布时间周期统一缓存的服务端方案更快耗尽免费额度。
Compare free exchange rate API limits and data rights比较免费汇率 API 的限制与数据权利
| Check检查项 | Question to answer必须回答的问题 | Failure if ignored忽略后的风险 |
|---|---|---|
| Authentication鉴权 | No key, free key, domain restriction, or secret header?免密钥、免费密钥、域名限制还是服务端密钥? | Leaked credentials or blocked browser requests密钥泄露或浏览器请求被拒 |
| Quota额度 | Monthly calls, burst limits, and retry policy?月调用量、突发限制和重试规则是什么? | Unexpected throttling during traffic peaks流量高峰时突然限流 |
| Freshness时效 | Source timestamp or only request time?返回来源时间还是只有请求时间? | Stale values presented as current rates把陈旧数据展示为当前汇率 |
| Coverage覆盖 | Required currencies, bases, weekends, and history?是否覆盖目标币种、基准币、周末和历史日期? | Missing pairs or silently derived rates币种对缺失或静默使用推导汇率 |
| Rights许可 | Commercial use, attribution, caching, redistribution?是否允许商用、署名、缓存和再分发? | A technically working integration that violates terms技术可用但违反使用条款 |
Keep specialized intents on specialized pages把专门意图留给专门页面
This page covers general selection and integration. Use the dedicated no-key API guide, Python guide, Excel guide, or historical API guide when that modifier is the actual task.
本页只解决通用选择与接入。实际任务是免密钥、Python、Excel 或历史区间时,应分别查看免密钥指南、Python 指南、Excel 指南或历史汇率指南。
Use a weighted score instead of a generic “best API” ranking用加权评分代替泛化的“最佳 API”排名
Score only requirements that matter to the application. A simple evaluation can weight rate definition and freshness at 25% each, coverage at 20%, licensing at 15%, reliability behavior at 10%, and integration effort at 5%. Reject any provider that fails a mandatory requirement even if its total score is high.
只对真正影响应用的条件评分。例如,可将汇率定义和时效各设为 25%,覆盖范围 20%,许可 15%,可靠性行为 10%,接入成本 5%。即使总分很高,只要供应商未满足强制条件,也应直接淘汰。
Practical rule: treat price and advertised currency count as tie-breakers, not primary criteria. A smaller API with documented timestamps and usable rights can be safer than a larger catalog with ambiguous provenance.
实用原则:把价格和宣传中的币种数量作为同分时的次要判断,而不是首要标准。来源和时间戳清晰、许可可用的小型接口,可能比来源模糊的大型目录更安全。
Test a free exchange rate API response before integration接入前测试免费汇率 API 响应
Validate meaning, not only HTTP 200不要只验证 HTTP 200,还要验证字段含义
A successful status code does not prove the data is usable. Confirm that the response names the base currency, gives a source date or timestamp, distinguishes missing currencies from zero values, and documents whether rates are direct or derived. Normalize identifiers with the ISO 4217 currency code standard.
成功状态码并不代表数据一定可用。响应应明确基准币、来源日期或时间戳,并区分币种缺失与零值,同时说明汇率是直接报价还是推导结果。统一币种标识时可参考 ISO 4217 币种代码标准。
Worked invoice conversion: suppose an approved daily response states base=USD, quote=EUR, rate=0.923400, and source date 2026-07-31. A USD 1,250 invoice converts to 1,250 × 0.923400 = 1,154.250000 EUR, then rounds to EUR 1,154.25 under a two-decimal final-amount rule. Keep the six-decimal rate for calculation; rounding the rate first to 0.92 would produce EUR 1,150.00, a EUR 4.25 error.
发票换算实例:假设已批准的日频响应为 base=USD、quote=EUR、rate=0.923400,来源日期为 2026-07-31。1,250 美元发票应换算为 1,250 × 0.923400 = 1,154.250000 欧元,再按最终金额保留两位小数的规则得到 1,154.25 欧元。计算时应保留六位汇率精度;若先把汇率舍入为 0.92,结果会变成 1,150.00 欧元,误差达到 4.25 欧元。
Store the original amount and currency, unrounded rate, converted amount, rounding rule, source date, retrieval time, provider, and rate type together. If the invoice policy requires the rate published on a specific accounting date, a newer response is not automatically a valid substitute; choose an explicit non-business-day rule and record any fallback date.
应把原始金额与币种、未舍入汇率、换算金额、舍入规则、来源日期、抓取时间、供应商和汇率类型一起保存。如果发票政策要求使用特定会计日期公布的汇率,更新的响应并不自动构成有效替代;应明确非工作日处理规则,并记录实际采用的回退日期。
Use a provider-neutral acceptance test使用与供应商无关的验收测试
required = ["base", "rates", "source_timestamp"]
assert response.status == 200
assert all(field in payload for field in required)
assert payload["base"] == requested_base
assert requested_quote in payload["rates"]
assert payload["rates"][requested_quote] > 0
assert age(payload["source_timestamp"]) <= max_age
assert reverse_rate_is_consistent_within_tolerance()Normalize different JSON shapes into one internal model把不同 JSON 结构统一成内部模型
Providers may return a map of rates, a single pair, or a list of observations. Convert each format into one internal record so application code does not depend on provider-specific field names.
供应商可能返回汇率映射、单一币种对或观测值列表。应把这些格式统一成一种内部记录,避免业务代码依赖某个供应商的字段名称。
{
"base": "USD",
"quote": "EUR",
"rate": "0.923400",
"rate_type": "reference_midpoint",
"source_timestamp": "2026-07-28T00:00:00Z",
"retrieved_at": "2026-07-28T00:05:12Z",
"provider": "provider-id",
"is_stale": false
}Use decimal strings or decimal-number types for stored monetary rates. Binary floating-point can introduce rounding artifacts, especially after repeated conversions.
存储货币汇率时使用十进制字符串或十进制数值类型。二进制浮点数在重复换算后可能产生舍入误差。
Test negative and stale-data paths测试错误路径与陈旧数据
Request an invalid currency, exceed a small test quota, simulate a timeout, and feed the application an old timestamp. Verify that the UI or downstream service does not silently reuse an expired rate without exposing its age.
主动请求无效币种、模拟超时和小额度耗尽,并向应用传入过期时间戳。确认界面或下游服务不会在不提示数据年龄的情况下静默复用过期汇率。
Integrate exchange rates without hiding uncertainty接入汇率时不要隐藏不确定性
Store rate provenance with every converted value为每个换算结果保存来源信息
Store the provider, source timestamp, base, quote, original rate, and rounding rule beside the converted amount. This makes later reconciliation possible when providers revise data or currency precision differs.
在换算金额旁保存供应商、来源时间戳、基准币、报价币、原始汇率和舍入规则。当供应商修订数据或币种精度不同时,这些字段能够支持后续核对。
Cache to the publication schedule, not an arbitrary timer让缓存周期匹配数据发布时间
If a source publishes once per business day, polling every minute wastes quota without improving freshness. Set cache expiry from the publication cadence, refresh asynchronously, and label last-known-good values as stale when their maximum age is exceeded.
如果数据源每个工作日只发布一次,每分钟轮询只会浪费额度,并不会提高时效。应按发布时间设置缓存过期点,异步刷新,并在超过最大允许年龄时把最后有效值明确标记为陈旧。
Design provider fallback around equivalent rate types回退供应商必须提供等价汇率类型
Do not fail over from a central-bank reference rate to a retail card rate merely because both return USD/EUR. A fallback is safe only when the rate definition, timestamp convention, direction, and permitted use are compatible.
不能仅因为两个接口都返回 USD/EUR,就从央行参考汇率直接回退到零售卡组织汇率。只有汇率定义、时间戳规则、方向和许可用途兼容时,回退才是安全的。
Monitor freshness and correctness, not only uptime除了可用率,还要监控时效与正确性
| Signal监控信号 | What it reveals能够发现什么 | Example response处理方式示例 |
|---|---|---|
| Source age来源数据年龄 | Provider is reachable but publishing stale data接口可访问,但数据没有按时更新 | Mark stale, stop automatic refresh claims标记陈旧,停止宣称为当前汇率 |
| Missing-pair rate币种对缺失率 | Coverage regression or symbol change覆盖回退或币种符号变更 | Alert and route only equivalent pairs告警,并只回退到等价币种对 |
| Cross-rate deviation交叉汇率偏差 | Direction, inversion, or source inconsistency方向、倒数或来源一致性问题 | Quarantine the observation for review隔离该观测值并人工检查 |
| HTTP and timeout errorsHTTP 与超时错误 | Availability or throttling problem可用性或限流问题 | Backoff, circuit-break, serve labeled fallback退避、熔断,并返回有标记的回退数据 |
Use a staged rollout for production使用分阶段方式上线生产
Start with recorded responses in tests, then run the provider in shadow mode beside the current source. Compare rates, timestamps, missing pairs, and error frequency before routing user-visible conversions. Keep a rollback path that restores the previous source without rewriting stored records.
先用保存的响应完成测试,再让新供应商以影子模式与现有数据源并行运行。比较汇率、时间戳、币种缺失和错误频率后,再让它承担用户可见的换算。回滚路径应能恢复旧数据源,而不需要重写已经保存的记录。
How QVeris helps evaluate exchange-rate capabilitiesQVeris 如何帮助评估汇率能力
QVeris helps developers and agents discover callable capabilities and inspect their declared inputs and outputs. Open the QVeris tool details to inspect the candidate set, then verify the selected provider’s current documentation, license, update schedule, and live response. QVeris assists discovery and inspection; it does not change the underlying data source or guarantee a provider’s availability.
QVeris 帮助开发者和 Agent 发现可调用能力并检查其声明的输入输出。先用 QVeris 工具详情缩小候选范围,再核对供应商当前文档、许可、更新时间和真实响应。QVeris 提供发现与检查能力,但不会改变底层数据源,也不保证供应商可用性。
Free exchange rate API FAQ免费汇率 API 常见问题
Is there a free API for currency conversion?有免费的货币换算 API 吗?
Yes. Public endpoints and free plans exist, but keys, quotas, update schedules, supported bases, attribution, and commercial rights differ.有,但不同服务的密钥、额度、更新周期、基准币、署名要求和商用权限并不相同。
Are free exchange rate APIs real time?免费汇率接口是实时的吗?
Not necessarily. Many publish daily or hourly reference rates. Read the source timestamp and rate definition rather than relying on a “live” label.不一定。许多接口发布的是日频或小时级参考汇率,应检查来源时间戳和汇率定义,而不是只看“实时”标签。
How accurate are free exchange rate APIs?免费汇率 API 准确吗?
Accuracy depends on the source and intended use. A valid reference fixing can still differ from a bank, card, or executable market quote.准确性取决于数据源和用途。有效的参考定盘价仍可能与银行价、卡组织价或可成交市场报价不同。
Can I use a free exchange rate API commercially?免费汇率 API 可以商用吗?
Only when the provider and underlying data terms allow it. Check attribution, caching, redistribution, and derivative-use clauses.只有供应商及底层数据条款允许时才可以。应检查署名、缓存、再分发和衍生使用限制。
How often should I refresh exchange rates?汇率应该多久刷新一次?
Match refresh timing to the source publication schedule and the maximum age your use case permits. Polling faster than the source updates wastes quota without creating fresher data.刷新周期应同时匹配数据源发布时间和业务允许的最大数据年龄。轮询速度超过源数据更新速度,只会浪费额度。
What should happen when the exchange rate API fails?汇率 API 失败时应该怎么处理?
Use bounded retries, a circuit breaker, and a labeled last-known-good rate or equivalent fallback. Never present an old rate as current without its timestamp or stale status.使用有限重试、熔断,以及带明确标记的最后有效汇率或等价回退。绝不能在没有时间戳或陈旧状态的情况下把旧汇率当作当前汇率。
