Free Forex Data API
Selection and Integration Guide免费外汇数据 API
选择与接入指南
Find a free forex data API, compare limits and rate meaning, test its JSON, and validate the result before integration.
查找免费的外汇数据 API,比较限制与汇率口径,测试 JSON,并在正式接入前完成校验。
Free forex data API: what to check first免费外汇数据 API:首先检查什么
A useful free forex data API documents its rate type, source time, currency coverage, update schedule, quota, license, and errors. “Free” may mean an open endpoint, a limited plan, or a trial, so confirm the current terms first.
实用的免费外汇数据 API 应明确汇率类型、来源时间、币种覆盖、更新周期、调用额度、许可和错误结构。“免费”可能是开放端点、限额套餐或试用,因此应先核对最新条款。
Define the job before choosing a forex API选择外汇 API 前先定义任务
Current rates, historical data, or live quotes?需要当前汇率、历史数据还是实时报价?
“Latest” can mean a daily reference, hourly aggregate, delayed snapshot, or intraday quote. Set the acceptable data age and decide whether the application needs a reference value, midpoint, bid/ask, or OHLC history.
“最新”可能指日频参考价、小时聚合价、延迟快照或盘中报价。应确定可接受的数据延迟,并判断应用需要参考值、中间价、买卖价还是 OHLC 历史序列。
| Product job产品任务 | Data contract to request应要求的数据契约 | Common mistake常见错误 |
|---|---|---|
| Accounting or daily conversion会计或日常换算 | Named reference source, effective date, publication time, base and quote.明确参考来源、生效日期、发布时间、基准币与计价币。 | Using a screen quote without a reproducible fixing policy.使用无法复算、没有定盘规则的屏幕报价。 |
| Portfolio valuation投资组合估值 | Synchronized midpoint or reference rates, valuation time, and missing-rate policy.时间同步的中间价或参考价、估值时点与缺失汇率策略。 | Mixing rates from different timestamps in one valuation.在同一次估值中混用不同时间点的汇率。 |
| Live market display实时行情展示 | Source timestamp, cadence, bid, ask, midpoint, and stale threshold.来源时间、更新频率、买价、卖价、中间价与陈旧阈值。 | Calling a daily reference feed “real time.”把日频参考价描述成实时行情。 |
| Historical research历史研究 | Bar input, interval, timezone, rollover, revisions, and complete date range.K 线输入、周期、时区、换日、修订规则与完整日期范围。 | Comparing OHLC series built from different sessions or quote sides.比较由不同时段或不同报价侧构造的 OHLC。 |
| Payment or executable conversion支付或可执行换汇 | Executable bid/ask, size, fees, expiry, counterparty, and settlement terms.可成交买卖价、规模、费用、有效期、对手方与结算条件。 | Treating an informational midpoint as a guaranteed conversion rate.把信息展示用中间价当作保证成交汇率。 |
If the application specifically needs streaming quotes, continue with the real-time forex data guide. If it needs date ranges and bars, use the historical forex data guide. This page remains the decision layer: it helps define which contract is appropriate before a provider is selected.
如果应用明确需要流式报价,可继续查看实时外汇数据指南;如果需要日期区间与 K 线,则查看外汇历史数据指南。本页承担的是选型入口:先确定正确的数据契约,再选择供应商。
Pairs, base currency, and identifiers币种对、基准币与标识符
Check supported currencies, pair direction, base restrictions, precision, and whether crosses are direct or derived. Normalize identifiers with the ISO 4217 standard. Date-range needs belong in the historical-data guides.
检查支持币种、币种对方向、基准币限制、精度,以及交叉盘是直接提供还是推导计算。标识符可按 ISO 4217 标准统一;日期区间需求可查看历史数据指南。
Trading week, sessions, and bar boundaries交易周、交易时段与 K 线边界
Forex trades across overlapping global sessions rather than one centralized exchange day. For intraday or OHLC data, confirm the provider's week open and close, timezone, daylight-saving treatment, daily rollover, Sunday bars, and whether an interval is built from trades, quotes, or sampled midpoints.
外汇市场由多个全球交易时段重叠构成,并不存在唯一的集中交易所交易日。使用盘中或 OHLC 数据时,要确认供应商定义的周开盘与周收盘、时区、夏令时处理、每日换日时间、是否生成周日 K 线,以及每根 K 线来自成交、报价还是抽样中间价。
Compare free forex API limits and rights比较免费外汇 API 的限制与使用权利
No API key does not mean no restrictions无需 API 密钥不等于没有限制
A keyless endpoint can require attribution, enforce limits, restrict redistribution, or change without a guarantee. Record the terms review date and plan for exhausted quotas or downtime.
无密钥端点仍可能要求署名、限制调用频率、禁止再分发,或在没有服务保证的情况下变化。应记录条款复核日期,并为额度耗尽或服务中断做好准备。
Compare the usable dataset, not the marketing headline. Test the exact pairs, intervals, historical depth, maximum symbols per request, pagination, source timestamps, bid/ask availability, and free-plan endpoint exclusions. Estimate calls from peak users and refresh behavior; one dashboard request can fan out into dozens of pair requests.
比较时应看真正可用的数据集,而不是宣传标题。需要测试准确币种对、周期、历史深度、单次最大品种数、分页、来源时间戳、买卖价可用性以及免费层排除的端点,并根据峰值用户数和刷新行为估算调用量;一次看板刷新可能扩散成几十个币种对请求。
Model requests as pairs per refresh × refreshes per hour × active hours × environments, then account for batching, retries, cache misses, health checks, and background jobs. A screen showing 30 pairs every minute can require 43,200 pair observations per day before retries; a batch endpoint may turn that into 1,440 calls, while a one-pair endpoint may not. Compare both call count and per-endpoint credit cost.
Permission to call an endpoint does not automatically allow permanent storage, public display, resale, or downstream redistribution. Record whether attribution is required, how long values may be cached, whether derived results can be stored, and whether commercial use is included. The strictest condition may come from the upstream data source rather than the API wrapper.
Save the documentation URL, plan name, reviewed date, and assumptions used in the cost model. Alert when a response loses fields or a quota header changes. A free tier is suitable for production only when the application has an explicit response to reduced limits, endpoint removal, or a required upgrade.
可按“每次刷新的币对数 × 每小时刷新次数 × 活跃小时数 × 环境数”估算,再计入批量请求、重试、缓存未命中、健康检查和后台任务。一个每分钟刷新 30 个币对的页面,在不计重试时每天就需要 43,200 条币对观测;批量端点可能只需 1,440 次调用,逐币对端点则可能远高于此。既要比较调用次数,也要比较不同端点的 credit 成本。
能够调用端点,不代表可以永久保存、公开展示、转售或向下游再分发。应记录是否要求署名、允许缓存多长时间、能否保存衍生结果,以及是否包含商业用途。最严格的限制有时来自上游数据源,而不是 API 封装服务本身。
保存文档地址、套餐名称、复核日期和成本模型假设;响应字段消失或额度响应头变化时及时告警。只有当应用已经明确如何应对额度降低、端点下线或被要求升级时,免费套餐才适合进入生产。
Choose the right forex rate type选择正确的外汇汇率类型
Reference rates, aggregated midpoints, and venue bid/ask can all be valid yet differ because of fixing times, contributors, spreads, and methods. Store the rate type and source with each observation.
参考价、聚合中间价和交易场所买卖价都可能有效,却会因定盘时间、报价来源、点差和方法不同而产生差异。每条观测都应保存汇率类型与数据来源。
| Rate source汇率来源 | What the value represents数值代表什么 | Suitable use适合用途 |
|---|---|---|
| Official reference or fixing官方参考价或定盘价 | A rate produced under a published schedule and methodology, often once per business day.按照公开时间表和方法生成的汇率,通常每个工作日发布一次。 | Reporting and conversions that explicitly adopt that reference; not intraday execution.明确采用该参考口径的报表与换算,不适合盘中成交。 |
| Aggregated midpoint聚合中间价 | A vendor calculation across contributors, often with outlier and weighting rules.供应商根据多个报价源计算的结果,通常带异常值过滤和权重规则。 | Dashboards, monitoring, and valuation when methodology and freshness are acceptable.在方法与时效可接受时,用于看板、监控和估值。 |
| Venue or dealer bid/ask交易场所或做市商买卖价 | A source-specific two-sided quote that may depend on size, account, or relationship.特定来源的双边报价,可能随规模、账户或合作关系变化。 | Spread monitoring and execution analysis when the quote is actually available to the workflow.当工作流确实可以使用该报价时,用于点差监控与成交分析。 |
| Derived cross rate推导交叉汇率 | A calculation from two or more synchronized source pairs.由两个或多个时间同步的来源币对计算得到。 | Coverage expansion when derivation path, timestamps, and precision are retained.在保留推导路径、时间戳和精度的前提下扩展覆盖。 |
Direct pairs and derived cross rates直接币种对与推导交叉汇率
Some free plans allow one base currency. A cross calculation expands coverage but adds rounding and timestamp risk. Record whether the pair was supplied directly or derived, the intermediate currency, and the precision used.
部分免费套餐只允许一个基准币。通过交叉计算可以扩展覆盖,但也会增加舍入误差和时间戳不一致的风险。应记录币种对是直接返回还是推导得到、中间币种以及计算精度。
Reproducible cross-rate example: if the feed defines EUR/USD = 1.0800 and USD/JPY = 150.20 at the same observation time, then EUR/JPY = 1.0800 × 150.20 = 162.216. The inverse is JPY/EUR = 1 ÷ 162.216, not the same number with a relabelled pair. Calculate with decimal arithmetic, preserve full intermediate precision, and round only for the final display or business rule. Do not combine legs observed minutes apart during a fast market.
可复算的交叉汇率示例:如果同一观测时点的 EUR/USD = 1.0800、USD/JPY = 150.20,则 EUR/JPY = 1.0800 × 150.20 = 162.216。反向的 JPY/EUR 应计算为 1 ÷ 162.216,不能只替换币对名称。计算时使用十进制运算,保留中间精度,仅在最终展示或业务规则处舍入;市场快速波动时,不要把相隔数分钟的两条腿拼在一起。
Bid, ask, midpoint, last, and OHLC are different fields买价、卖价、中间价、最新价与 OHLC 不是同一字段
A tradable quote needs a bid and ask from a stated source; a midpoint is a calculation, and “last” may be undefined or vendor-specific in a decentralized market. OHLC bars also depend on input type and bar timezone. Preserve field semantics rather than collapsing every value into a generic price.
可交易报价需要来自明确来源的买价和卖价;中间价是计算结果,而在分散化外汇市场中,“最新价”可能没有统一定义,甚至只是供应商自定义字段。OHLC 还取决于输入数据类型和 K 线时区,因此不能把所有数值都压成一个通用 price 字段。
Test a free forex data API response测试免费外汇数据 API 响应
Provider-neutral JSON example与供应商无关的 JSON 示例
GET /latest?base=USD&symbols=EUR,JPY
Accept: application/json
{
"base": "USD",
"timestamp": "SOURCE_TIMESTAMP",
"rates": {
"EUR": "RATE_VALUE",
"JPY": "RATE_VALUE"
}
}The endpoint and values are placeholders. Against the selected provider’s documentation, verify pair direction, source time, timezone, numeric type, missing-symbol behavior, and machine-readable errors. A server response time is not a substitute for the market observation time.
端点和数值均为占位示例。应对照供应商文档校验币种对方向、来源时间、时区、数值类型、缺失币种处理方式和机器可读错误。服务器响应时间不能代替市场观测时间。
Minimum integration checks最低接入检查项
- Validate currency codes before sending a request.
- Handle 4xx, 5xx, timeouts, and rate limits separately.
- Store source time, retrieval time, provider, and rate type.
- Use decimal arithmetic and idempotent cache writes.
- Alert on stale data, schema changes, and quota exhaustion.
- 发送请求前校验币种代码。
- 分别处理 4xx、5xx、超时和限频响应。
- 保存来源时间、抓取时间、供应商与汇率类型。
- 使用十进制运算,并保证缓存写入幂等。
- 对数据陈旧、结构变化和额度耗尽发出告警。
Turn these checks into an evidence pack rather than an informal test. Include a common direct pair, its inverse, one derived cross, one unsupported currency, a weekend or rollover observation, and a forced quota response. Record the expected status and field semantics. A provider passes only when the application can distinguish “pair not covered,” “market observation unchanged,” “data stale,” “quota exhausted,” and “service unavailable.” Those states require different user messages and different fallback behavior.
应把这些检查整理成正式证据包,而不是随手试一次接口。至少包含一个常见直接币对、它的反向币对、一个推导交叉盘、一个不支持的币种、一个周末或换日时点,以及一次主动触发的额度限制响应,并记录预期状态和字段含义。只有当应用能够区分“币对未覆盖”“市场观测未变化”“数据已经陈旧”“额度耗尽”和“服务不可用”时,供应商才算通过;这些状态需要不同的用户提示和降级行为。
Validate forex data before production外汇数据用于生产前的校验
Reference rates are not executable prices参考汇率不是可成交价格
A reference value usually excludes bank spreads, card fees, slippage, and venue-specific bid/ask conditions. Label it accurately. Reject non-positive rates, stale timestamps, malformed responses, and unexpected pair directions before data reaches users.
参考值通常不包含银行点差、银行卡费用、滑点以及特定交易场所的买卖条件,因此必须准确标注。数据到达用户前,应拒绝非正数汇率、陈旧时间戳、异常响应结构和方向错误的币种对。
Caching, retries, and fallback缓存、重试与备用数据源
Match cache duration to the provider’s update schedule. Retry only transient failures with backoff; do not retry invalid codes or exhausted quotas as network errors. Before using a fallback, normalize pair direction, timestamps, and rate type.
缓存时间应与供应商更新周期一致。只对暂时性故障进行退避重试,不要把无效代码或额度耗尽当作网络错误反复请求。启用备用数据源前,应统一币种对方向、时间戳和汇率类型。
| Data state数据状态 | How to identify it识别方法 | Application response应用处理 |
|---|---|---|
| Fresh新鲜 | Observation age is within the contract for the active session.活跃交易时段内,观测年龄未超过契约阈值。 | Display or process it with source and “as of” time retained.可以展示或处理,但仍保留来源和“截至”时间。 |
| Quiet but valid无变化但有效 | The source is updating, but the value has not changed within a plausible market window.来源仍在更新,但合理市场窗口内数值没有变化。 | Keep the value; do not manufacture movement or mark it failed.保留原值,不要虚构波动,也不要误判为故障。 |
| Stale陈旧 | The last observation exceeds the workflow threshold even if HTTP requests succeed.即使 HTTP 请求成功,最近观测也已超过业务阈值。 | Label the age, block time-sensitive actions, and try a compatible fallback.标记数据年龄,阻止时效敏感操作,并尝试兼容备用源。 |
| Unavailable不可用 | No valid observation exists because of coverage, quota, schema, or service failure.由于覆盖、额度、结构或服务故障,没有有效观测。 | Return a typed reason; never replace it with zero or an unlabeled old rate.返回明确原因,不能用零值或未标注的旧汇率替代。 |
Run consistency and event-window checks执行一致性与事件窗口检查
Compare direct and inverse pairs within a documented tolerance, test a triangular relationship using synchronized timestamps, and inspect bars around daylight-saving changes, weekend reopen, major policy announcements, and upstream outages. Large differences can be legitimate, but the system must explain whether they come from spread, timing, source, or a broken field mapping.
应在明确容差内比较正反向币种对,用同步时间戳检验三角关系,并检查夏令时切换、周末重开、重要政策公告和上游中断附近的 K 线。较大差异可能合理,但系统必须能够说明它来自点差、时间、数据源,还是字段映射错误。
How QVeris helps find a free forex data APIQVeris 如何帮助查找免费外汇数据 API
Open the QVeris tool details to inspect callable capabilities and inspect inputs and outputs, then follow the documentation to connect them. Provider prices, licenses, quotas, and service levels still apply.
可使用 QVeris 工具详情发现可调用能力并检查输入输出,再按照文档完成连接。供应商自身的报价、许可、额度和服务等级仍然适用。
Free Forex API questions免费外汇 API 常见问题
Yes. Public endpoints and free plans exist, but freshness, coverage, source, attribution, and quotas differ.
Yes, for reference rates and some market data. Verify whether the response is daily, delayed, intraday, midpoint, or bid/ask.
There is no universal best option. Match the provider to required pairs, freshness, source, quota, rights, and reliability.
Some endpoints are keyless, but they may require attribution, enforce limits, or restrict redistribution.
Do not treat a search converter as an official supported API. Choose a documented endpoint with explicit terms.
Not necessarily. “Latest” may be daily, hourly, delayed, or intraday; inspect the source timestamp and methodology.
A quote normally identifies bid and ask at a source and time. An exchange rate may be a daily reference, midpoint, fixing, or derived conversion value without executable liquidity.
Providers may use different timezones, rollover times, input feeds, Sunday-bar policies, and bid, ask, midpoint, or trade data to construct OHLC.
Compare the market observation timestamp with the expected session and cadence, not only the HTTP response time. Alert when source age exceeds the workflow's threshold.
有,但公共端点和免费套餐在时效、覆盖、来源、署名和额度上不同。
不一定。“最新”可能是日频、小时、延迟或盘中数据,应检查来源时间与方法。
按币种对、时效、来源、免费额度、许可、错误处理和运行可靠性选择。
不能默认可以。无密钥端点仍可能要求署名、限制缓存、商用或再分发。
不能默认使用。参考价通常不包含买卖价差、费用、滑点和结算条件。
外汇报价通常会标明某个来源和时点的买价、卖价;普通汇率则可能是每日参考价、中间价、定盘价或推导换算值,不一定具备可成交流动性。
它们可能采用不同的时区、换日时间、输入行情、周日 K 线规则,也可能分别用买价、卖价、中间价或成交数据构造 OHLC。
应把市场观测时间与预期交易时段和更新频率比较,而不是只看 HTTP 响应时间;来源数据年龄超过业务阈值时应及时告警。
监控成功率、限频、陈旧时间戳、结构变化、缺失币种对与条款更新。
