Free Futures Data API
Sources, Limits & Examples免费期货数据 API
数据源、限制与接入示例
Find a free futures data API that matches your contracts, latency, history, licensing, and integration needs before you build.
按合约覆盖、延迟、历史范围、授权和接入方式筛选免费期货行情 API,
再把可靠的数据源接入研究、看板或智能体。
TL;DR摘要
Developers want usable futures prices through an API, not another chart page or brokerage signup funnel.
A free tier may mean delayed data, a trial credit, limited symbols, low request quotas, or historical-only access.
Latest price, OHLCV bars, trades, order books, settlement, volume, and open interest serve different workflows.
Confirm exchange coverage, contract symbology, latency, entitlements, redistribution rights, and rate limits.
用户需要的是可编程调用的期货行情,而不是另一个图表页面、开户入口或交易课程。
免费可能是延迟行情、试用额度、仅覆盖少量合约、调用配额较低,或只开放历史数据。
最新价、OHLCV、逐笔成交、订单簿、结算价、成交量和持仓量对应不同任务。
确认交易所、合约代码、延迟、授权、再分发权利和限流,避免开发完成后才发现不能使用。
A useful free futures data API is not defined by price access alone. It must identify the exact contract, venue, trading session, price type, timestamp, and data status. A response for “crude oil” may refer to a specific delivery month, a vendor-created continuous series, a delayed last trade, or an official settlement. Those values solve different problems and should never share one unlabeled field.
真正有用的免费期货数据 API 不能只提供价格,还必须标明具体合约、交易所、交易时段、价格类型、时间戳和数据状态。“原油价格”可能指某个交割月合约、供应商生成的连续合约、延迟最新成交价,或官方结算价。这些数值解决的问题不同,不能放进同一个没有说明的字段。
Fast decision: use contract-level exchange or vendor data for execution-sensitive work; use clearly documented continuous series for charts and some research; use official CFTC data for weekly positioning and open-interest analysis. Confirm licenses before public display, redistribution, or commercial use.
快速判断:对执行敏感的任务使用合约级交易所或供应商数据;图表和部分研究可使用方法明确的连续合约;每周持仓与市场结构分析可使用 CFTC 官方公开数据。公开展示、再分发或商业使用前必须确认许可证。
Understand futures contracts before choosing an API选择 API 前先理解期货合约
Unlike a stock ticker, a futures symbol usually identifies a product root plus an expiration month and year. The same product trades across several delivery months at once, and each month can have a different price, volume, open interest, bid/ask spread, and last trading date. An API that accepts only a root such as ES or CL may be returning a front month or a synthetic continuous series rather than an exchange-listed contract.
与股票代码不同,期货代码通常由品种根代码、到期月份和年份组成。同一品种会同时交易多个交割月,各月份的价格、成交量、持仓量、买卖价差和最后交易日都可能不同。只接受 ES 或 CL 等根代码的 API,返回的可能是近月合约或合成连续序列,而不是交易所挂牌的具体合约。
Contract symbols and expiration month codes合约代码与到期月份代码
CME explains that display codes commonly combine a product code with a single expiration-month letter and a numeric year. The product code and year length can vary by platform, so save the provider's raw symbol and a normalized contract identity separately.
CME 说明,常见显示代码会把品种代码、单字母到期月份和数字年份组合起来。不同平台的品种代码和年份位数可能不同,因此应分别保存供应商原始代码和标准化合约身份。
| Month月份 | Code代码 | Month月份 | Code代码 | Month月份 | Code代码 |
|---|---|---|---|---|---|
| January1月 | F | May5月 | K | September9月 | U |
| February2月 | G | June6月 | M | October10月 | V |
| March3月 | H | July7月 | N | November11月 | X |
| April4月 | J | August8月 | Q | December12月 | Z |
Store a contract master, not just price rows保存合约主数据,而不只是价格行
A robust dataset needs product root, full provider symbol, exchange, currency, contract multiplier, tick size, expiration month, first notice date when relevant, last trade date, settlement type, and trading calendar. Physical and cash-settled contracts have different delivery risks. Agricultural, energy, metal, equity-index, interest-rate, FX, and cryptocurrency futures also use different listing cycles and session conventions.
可靠的数据集需要保存品种根代码、完整供应商代码、交易所、币种、合约乘数、最小变动价位、到期月份、适用时的首次通知日、最后交易日、结算类型和交易日历。实物交割与现金结算合约具有不同风险;农产品、能源、金属、股指、利率、外汇和加密货币期货也采用不同的挂牌周期与交易时段。
Use a stable internal contract key such as exchange + product + expiration year-month. Keep every provider mapping versioned because symbols can differ across APIs and can change after a vendor migration. Never infer the full year from one digit without a reference date and contract calendar.
内部可使用“交易所 + 品种 + 到期年月”作为稳定合约键,并对不同供应商的代码映射做版本管理,因为 API 之间代码可能不同,供应商迁移后也可能变化。不能脱离参考日期和合约日历,仅凭一位年份数字推断完整年份。
Which futures data types do you actually need?你真正需要哪些期货数据类型
The best option is the one whose data rights and technical limits fit your application. “Real time” can mean direct exchange data, a vendor-normalized stream, or merely frequent updates. For regulated exchange data, fees and entitlements may still apply even when an API account has a free plan.
合适的接口必须同时满足数据授权与技术限制。“实时”可能指交易所直连、供应商标准化推送,也可能只是高频更新。即使 API 账户有免费套餐,受监管交易所的实时数据仍可能需要单独授权或费用。
Quotes, trades, and order book
A last trade is not a bid or ask. Record event type, exchange timestamp, provider receipt time, price, size, aggressor or condition when available, and sequence number. Order-book work also requires depth level, update action, snapshot/replay logic, and gap recovery.
Historical OHLCV bars
Bars need interval, session template, timezone, price source, and correction status. Verify whether volume includes all sessions, whether empty intervals are omitted, and whether daily bars follow the exchange trade date rather than the local calendar date.
Settlement, volume, and open interest
Settlement is an official daily valuation, not necessarily the last trade. Open interest usually belongs to a reporting cycle and can lag the trade date. Keep preliminary and final values distinct and preserve the source's effective date.
Positioning and regulatory data
CFTC Commitments of Traders data describes weekly positions by report and trader category. It is valuable for market-structure research but is not a price feed, execution signal, or contract-level replacement for exchange data.
Reference and calendar data
Product definitions, contract months, expiration rules, holidays, session breaks, multipliers, tick values, and currency are necessary to interpret every price and calculate notional exposure correctly.
报价、逐笔成交和订单簿
最新成交不等于买价或卖价。应记录事件类型、交易所时间、供应商接收时间、价格、数量、可用时的成交方向或条件和序号。订单簿还需要深度层级、更新动作、快照/重放逻辑和缺口恢复。
历史 OHLCV K线
K线需要明确周期、交易时段模板、时区、价格来源和更正状态。还要检查成交量是否覆盖全部时段、无成交周期是否省略,以及日线是否按交易所交易日而不是本地自然日划分。
结算价、成交量和持仓量
结算价是官方日终估值,并不一定等于最后成交价。持仓量通常遵循独立报告周期,可能落后于交易日。应区分初步值与最终值,并保留来源的有效日期。
持仓结构与监管数据
CFTC 交易商持仓报告按报告类型和交易者类别描述每周持仓,适合市场结构研究,但它不是价格流、执行信号,也不能替代交易所合约级行情。
参考数据与交易日历
品种定义、合约月份、到期规则、节假日、时段休市、合约乘数、跳动价值和币种,是解释价格和正确计算名义敞口的必要信息。
REST is appropriate for contract metadata, snapshots, historical backfills, and low-frequency monitoring. WebSocket or another streaming protocol is appropriate when event order and low latency matter. A streaming client must authenticate, subscribe, process heartbeats, detect sequence gaps, reconnect, and request a fresh snapshot before applying later updates. “Connected” does not prove that the book is complete.
REST 适合合约元数据、快照、历史补数和低频监控;当事件顺序和低延迟重要时,应使用 WebSocket 等流式协议。流式客户端需要完成鉴权、订阅、心跳处理、序号缺口检测、断线重连,并在继续应用增量更新前重新请求快照。“已连接”并不代表订单簿完整。
Compare free futures market data API options免费期货数据接口选择清单
| Check检查项 | Questions to ask需要确认 | Good for适合场景 | Common limit常见限制 |
|---|---|---|---|
| Coverage覆盖 | Which exchanges, asset classes, contracts, and expired symbols?哪些交易所、品种、月份合约及到期合约? | Avoiding symbol gaps.避免合约缺口。 | Selected venues or symbols only.只开放部分交易所或代码。 |
| Freshness时效 | Real time, delayed, end of day, or cached?实时、延迟、日终还是缓存? | Matching research or live workflows.匹配研究或在线任务。 | Exchange entitlement.交易所授权限制。 |
| Fields字段 | Price, OHLCV, trades, order book, open interest, settlement?价格、K 线、逐笔成交、盘口、持仓量、结算价? | Charts, backtests, monitoring.图表、回测、监控。 | Free tier may expose snapshots only.免费套餐可能只提供快照。 |
| Access接入 | REST, WebSocket, SDK, authentication, quota, and SLA?REST、WebSocket、SDK、鉴权、配额与 SLA? | Reliable production integration.可靠生产接入。 | Trials expire; quotas change.试用到期或配额变化。 |
| Symbology代码体系 | Raw contract, root, front month, or continuous symbol?原始合约、根代码、近月还是连续代码? | Correct joins and reproducible history.正确连接和历史复现。 | Undocumented vendor aliases.供应商别名缺少说明。 |
| Corrections更正 | Are busts, late trades, and final settlements republished?撤销成交、迟到成交和最终结算是否重发? | Auditable bars and daily marks.可审计的 K 线与每日估值。 | History silently changes.历史数据发生变化却没有任何说明。 |
| License许可 | Personal, internal, display, non-display, derived, redistribution?个人、内部、展示、非展示、衍生或再分发? | Avoiding a post-build license conflict.避免开发后出现授权冲突。 | Free key is mistaken for usage rights.把免费的 API Key 误当成数据使用权。 |
What “free futures data” can mean“免费期货数据”可能指什么
Separate permanent public data, delayed exchange pages, developer tiers, sandbox symbols, time-limited credits, and downloadable samples. They are not interchangeable. Public regulatory datasets may remain free but contain positions rather than prices. A commercial free tier may expose prices but restrict contracts, history, calls, display, or redistribution. An exchange web page may be suitable for manual reference while prohibiting automated extraction.
应区分长期公共数据、延迟交易所页面、开发者免费套餐、沙盒环境、限时额度和可下载样本,它们不能互相替代。公共监管数据可能长期免费,但提供的是持仓而不是价格;商业免费套餐可能提供价格,却限制合约、历史、调用次数、展示或再分发;交易所网页可能适合人工参考,却不允许自动抓取。
Write the required rights into the shortlist before testing endpoints. A personal notebook, an internal risk report, a customer chart, an automated strategy, and a resold derived signal can fall under different license categories. Technical access is not a license grant.
测试接口前,就应把所需权利写进候选条件。个人 Notebook、内部风险报告、客户图表、自动化策略和转售衍生信号可能对应不同许可类别。技术上能够访问,并不代表已经取得许可。
Continuous futures data, rolls, and back-adjustment连续期货、展期与复权方法
A continuous futures series is usually created by a data provider or researcher; it is not one exchange-listed instrument. The process selects a contract for each date, chooses when to switch to another expiration, and may adjust historical prices to reduce the jump between contracts. Two valid continuous series for the same product can therefore show different levels and returns.
连续期货序列通常由数据供应商或研究者生成,并不是一个真实挂牌交易的单一工具。构建过程需要为每个日期选择合约、决定何时切换到下一到期月,并可能调整历史价格以减少合约切换跳空。因此,同一品种的两个有效连续序列也可能显示不同价格水平和收益率。
Common roll rules常见展期规则
Switch a fixed number of business days before last trade or first notice. It is deterministic and easy to reproduce, but may remain in a contract after liquidity has moved.
Switch when the next contract becomes more active than the current one. This follows liquidity but depends on when volume or open-interest data becomes final and can generate unstable crossovers.
Accept the vendor's active-contract rule. Convenient for charts, but unsuitable for reproducible research unless the rule and historical mapping are published.
在最后交易日或首次通知日前固定数量的工作日切换。规则确定、容易复现,但流动性已经转移后仍可能停留在旧合约。
当下一合约活跃度超过当前合约时切换。它更贴近流动性,但依赖成交量或持仓量何时最终确认,也可能产生反复交叉。
直接使用供应商的活跃合约规则,画图方便;但如果规则和历史映射未公布,就不适合要求可复现的研究。
Adjustment methods change the meaning of price复权方法会改变价格含义
Unadjusted concatenation preserves listed contract prices but introduces jumps at rolls. Difference back-adjustment adds or subtracts the roll gap from earlier history, preserving point changes but moving the historical price level. Ratio adjustment scales earlier history, preserving proportional moves but altering the original contract price. A perpetual weighted series blends two contracts during a roll window and may not equal a tradable instrument on any day.
不复权拼接保留真实挂牌合约价格,但在展期处产生跳空;差值后复权把展期价差加减到更早历史,保留点数变化,却改变历史价格水平;比例复权按比例缩放更早历史,保留比例变化,但同样改变原始合约价格;永久加权序列会在展期窗口混合两个合约,某一天的数值可能不等于任何可交易工具。
Store the roll audit trail: selected contract by date, roll trigger, decision timestamp, old and new prices at the switch, adjustment factor, original raw bars, and algorithm version. Without that mapping, a continuous series cannot be reproduced or linked back to executable contracts.
保存展期审计记录:每日选定合约、展期触发条件、决策时间、切换时新旧价格、复权因子、原始K线和算法版本。缺少这些映射,连续序列无法复现,也无法追溯到可交易合约。
How to use a futures data API in Python如何用 Python 调用期货数据 API
1. Define the futures contract and fields
Write down the venue, root symbol, contract month, desired timestamps, timezone, and fields. Do not assume two providers use the same symbol or continuous-contract rule.
2. Test one free futures API request
Use the provider’s official example and a sandbox or free key. Store credentials outside source code, set a timeout, and log response headers that describe quota and freshness.
3. Validate before storing the data
Reject missing timestamps, normalize timezones, preserve the raw symbol, detect stale responses, and compare a small sample with an official exchange or licensed vendor reference.
4. Add retries without breaking rate limits
Retry transient failures with exponential backoff and jitter. Respect 429 responses and provider guidance; do not turn a small free quota into a polling loop.
1. 明确期货合约与所需字段
写清交易所、品种代码、合约月份、时间戳、时区和字段。不要假设不同供应商使用同一代码或主连规则。
2. 发起一次免费期货 API 请求
从供应商官方示例和测试密钥开始。密钥放在源码之外,设置超时,并记录配额与数据时效相关的响应头。
3. 入库前校验期货行情
拒绝缺少时间戳的数据,统一时区,保留原始合约代码,检测过期响应,并抽样与交易所或持牌数据源核对。
4. 在限流范围内重试
对临时故障使用指数退避和抖动,遵守 429 与供应商规则,不能把有限免费配额消耗在高频轮询上。
Working Python example: CFTC futures positioning API可运行的 Python 示例:CFTC 期货持仓 API
The CFTC Public Reporting Environment offers programmatic access to Commitments of Traders datasets. The example below requests a small page from the Disaggregated Futures Only dataset and validates core fields. It intentionally demonstrates free public positioning data—not real-time futures prices. CFTC guidance says limited tokenless use is generally possible, while identified applications receive a separate request pool; production clients should follow the current API documentation.
CFTC 公共报告环境提供交易商持仓数据的编程访问。下面示例从“分类期货持仓”数据集请求一小页记录,并验证核心字段。它展示的是免费公共持仓数据,而不是实时期货价格。CFTC 指南说明,有限的无 Token 访问通常可用,而标识应用可获得独立请求池;生产客户端应遵循当前 API 文档。
import os
from datetime import datetime, timezone
import requests
url = "https://publicreporting.cftc.gov/api/v3/views/72hh-3qpy/query.json"
params = {"pageNumber": 1, "pageSize": 10}
headers = {}
token = os.getenv("CFTC_APP_TOKEN")
if token:
headers["X-App-Token"] = token
response = requests.get(url, params=params, headers=headers, timeout=20)
response.raise_for_status()
rows = response.json()
required = {
"market_and_exchange_names",
"report_date_as_yyyy_mm_dd",
"open_interest_all",
}
if not isinstance(rows, list):
raise ValueError("Unexpected CFTC response type")
clean = []
for row in rows:
missing = required.difference(row)
if missing:
raise ValueError(f"Missing CFTC fields: {sorted(missing)}")
clean.append({
"source": "CFTC COT Disaggregated Futures Only",
"market": row["market_and_exchange_names"],
"report_date": row["report_date_as_yyyy_mm_dd"],
"open_interest": int(row["open_interest_all"]),
"retrieved_at": datetime.now(timezone.utc).isoformat(),
})
print(clean[:2])
For price integration, apply the same discipline to a licensed provider response: preserve the raw contract symbol, venue, exchange timestamp, provider timestamp, price type, delay status, and entitlement. Validate that bars are sorted, unique, timezone-aware, within the contract's listing dates, and consistent with the selected session template before storing them.
接入价格数据时,应对持牌供应商响应采用同样标准:保留原始合约代码、交易所、交易所时间、供应商时间、价格类型、延迟状态和权限。入库前验证K线已排序、无重复、包含时区、位于合约挂牌期间内,并符合选定交易时段模板。
Futures data quality and backtesting checklist期货数据质量与回测检查清单
Futures backtests fail when valid-looking rows are attached to the wrong contract or economic meaning. Validate the data-generating process before optimizing a strategy.
期货回测常常不是因为数值明显错误而失败,而是看似有效的数据行对应了错误合约或错误经济含义。优化策略前,应先验证数据生成过程。
- Trade date and session: overnight activity can belong to the next exchange trade date even when the local calendar date has not changed.
- Price semantics: last, bid, ask, mark, VWAP, preliminary settlement, and final settlement are different values.
- Volume and open-interest timing: open interest may refer to the previous trading day; CME notes that displayed settlement reports can combine current estimated volume with prior-day open interest.
- Contract lifecycle: exclude dates before listing and after final trading, and account for first notice or delivery risk when selecting a contract.
- Roll bias: define the roll using information available at the time. Do not use final full-day volume to make a decision assumed to occur earlier that day.
- Corrections: preserve raw versions and update status so corrected trades, bars, settlements, or open interest do not silently rewrite results.
- Costs: include spread, commissions, slippage, exchange fees, contract multiplier, roll trades, and any currency conversion.
- Negative and exceptional prices: do not reject observations solely because they violate a hard-coded positive-price assumption.
- 交易日与时段:夜盘活动可能属于下一个交易所交易日,即使本地自然日尚未改变。
- 价格含义:最新价、买价、卖价、标记价、VWAP、初步结算和最终结算都是不同数值。
- 成交量与持仓量时间:持仓量可能对应前一交易日;CME 说明,结算报告可能同时包含当日估算成交量和前一日持仓量。
- 合约生命周期:排除挂牌前和最后交易后的日期,选择合约时还要考虑首次通知日或交割风险。
- 展期偏差:必须使用当时可获得的信息决定展期,不能用全天最终成交量模拟当天更早时点的决策。
- 数据更正:保存原始版本和更新状态,避免更正后的成交、K 线、结算价或持仓量在没有记录的情况下改写结果。
- 成本:纳入买卖价差、佣金、滑点、交易所费用、合约乘数、展期交易和币种转换。
- 负价格与异常行情:不能仅因观测不符合“价格必须为正”的硬编码假设而删除。
Build a reproducible validation sample建立可复现验证样本
Test one liquid front month, one thin deferred month, one expired contract, one roll date, one holiday-shortened session, and one corrected settlement. Compare the API output with the official exchange reference or licensed source allowed by its terms. Save the request, response, timestamp, and expected result so schema or methodology changes become visible in automated tests.
测试一个高流动性近月、一个成交稀疏的远月、一个到期合约、一个展期日、一个节假日缩短时段和一个被更正的结算价。在许可允许的范围内,把 API 输出与官方交易所参考或持牌数据源对照,并保存请求、响应、时间戳和预期结果,让字段或方法变化能够在自动化测试中显现。
Use QVeris to find and inspect market data capabilities用 QVeris 查找并检查行情数据能力
QVeris helps developers and agents discover callable capabilities and inspect their inputs before integration. It does not make a paid exchange license free or guarantee that a provider’s data is suitable for trading.
QVeris 帮助开发者和智能体查找可调用的能力,并在接入前检查输入要求。它不会把付费交易所授权变成免费,也不保证某个数据源适合交易决策。
- Search the QVeris Tool Finder for market-data capabilities instead of hard-coding an unverified endpoint.
- Inspect required symbols, parameters, authentication, and output schema before allowing an agent to call a provider.
- Keep licensing, latency, and suitability checks in your application’s approval process.
- 通过 QVeris 工具查找器查找行情数据能力,不要让智能体直接调用未经核验的端点。
- 在允许智能体调用前,检查合约代码、参数、鉴权方式和输出数据结构。
- 数据授权、延迟和适用性仍应保留在应用的审批与风控流程中。
FAQ
Is there a truly free real-time futures API?
Sometimes for selected symbols or a trial, but exchange entitlements, delays, quotas, and redistribution rules vary. Read the current provider terms before relying on it.
Can I get historical futures data free by API?
Some providers expose limited daily or intraday history, samples, or credits. Confirm expired-contract coverage and continuous-series methodology.
Which fields should a futures market data API return?
At minimum: symbol, venue, timestamp, price semantics, and freshness. Depending on the task, add OHLCV, trades, quotes, depth, settlement, or open interest.
Can I use a free futures data API for trading?
Only after verifying license, latency, reliability, corrections, and suitability. Free access alone is not evidence that data is execution-grade.
What is a continuous futures contract?
It is a synthetic history created by selecting and joining expiring contracts according to a roll rule. It may be unadjusted, difference-adjusted, ratio-adjusted, or blended, so the methodology must be stored with the data.
Is settlement price the same as the last futures trade?
No. Settlement is an official daily valuation calculated under exchange procedures and used for marking positions. It can differ from the last trade and may have preliminary and final versions.
Where can I get free futures open-interest data?
CFTC provides free weekly Commitments of Traders datasets for qualifying markets and trader categories. Exchange or vendor sources may provide contract-level daily open interest; check its effective date and license.
How do I avoid look-ahead bias when rolling futures?
Use only volume, open interest, dates, and prices available at the simulated decision time. Store the chosen contract and roll decision for every date instead of applying today's vendor mapping retrospectively.
有真正免费的期货实时行情 API 吗?
部分服务会开放少量合约、试用期或较低调用配额,但延迟、授权与再分发规则不同,必须查看当前条款。
如何免费获取期货历史数据?
可寻找开放的日线、有限分钟数据、样本或试用额度,同时核对到期合约与主连数据的计算方法。
期货行情 API 应返回哪些字段?
至少包含合约代码、交易所、时间戳、价格含义和时效;按任务增加 K 线、逐笔、盘口、结算价或持仓量。
免费期货 API 能直接用于量化交易吗?
不能只凭“免费”判断。应先验证授权、延迟、稳定性、更正机制和适用性,再决定能否用于研究或交易。
什么是连续期货合约?
它是按照展期规则选择并连接多个到期合约形成的合成历史,可以不复权、差值复权、比例复权或加权混合,因此必须同时保存构建方法。
结算价和期货最后成交价一样吗?
不一样。结算价是交易所依据规则计算的官方日终估值,用于每日盯市,可能与最后成交不同,也可能存在初步版和最终版。
哪里可以免费获取期货持仓量数据?
CFTC 为符合条件的市场和交易者类别提供免费的每周交易商持仓数据。交易所或供应商可能提供合约级每日持仓量,但需要检查有效日期和许可。
期货展期如何避免前视偏差?
只能使用模拟决策时点已经可获得的成交量、持仓量、日期和价格。应保存每日选定合约与展期决定,不能把今天的供应商映射反向套用到历史。
