Free Commodity Price API
Data, Limits & Examples免费大宗商品价格 API
数据、限制与接入示例
Find a usable free commodity price API for gold, oil, metals, energy, and agriculture—then verify freshness, history, units, quotas, and licensing before you integrate.筛选适合黄金、原油、金属、能源和农产品的免费大宗商品行情 API,并在接入前核对时效、历史范围、单位、配额和授权。
Free commodity price API: the practical answer免费大宗商品价格 API:先看实际可用性
A “free” API may mean a permanent low-volume tier, a trial, delayed quotes, daily observations, or an open public dataset. Choose by the job you need to complete, not by the word free.
“免费”可能指长期可用但配额较低、限时试用、延迟行情、每日观测值或开放数据集。应按实际任务选择,不能只看“免费”标签。
- For a dashboard, confirm symbol coverage, update cadence, currency, unit, and timestamp.
- For research, confirm historical depth, missing-value policy, revisions, and download limits.
- For production, confirm authentication, rate limits, commercial use, attribution, and redistribution terms.
- 行情看板要核对品种覆盖、更新频率、币种、计量单位和时间戳。
- 研究与回测要核对历史深度、缺失值、修订机制和下载限制。
- 生产接入还要核对鉴权、请求限额、商业使用、署名与再分发条款。
Know which commodity price the API returns先弄清 API 返回的是哪一种大宗商品价格
A commodity name is not a complete instrument identifier. “Gold,” “oil,” or “wheat” may point to a physical benchmark, an exchange futures contract, a daily settlement, a vendor assessment, or a composite index. Two correct APIs can therefore return different numbers at the same time.
商品名称并不是完整的标识符。“黄金”“原油”或“小麦”可能指实物基准、交易所期货合约、日结算价、供应商评估价或综合指数。因此,两家接口即使都没有出错,也可能在同一时间返回不同数值。
| Price type价格类型 | What it represents代表什么 | Required context必须保留的上下文 | Typical use常见用途 |
|---|---|---|---|
| Physical spot or benchmark实物现货或基准价 | A current cash-market reference for a specified grade and location.特定质量等级和地点的现金市场参考价。 | Grade, location, delivery terms, currency, unit and publisher.等级、地点、交付条件、币种、单位和发布方。 | Procurement, inflation and physical-market analysis.采购、通胀和实物市场研究。 |
| Futures trade or quote期货成交价或报价 | A price for one exchange contract and delivery month.某个交易所、某个交割月份合约的价格。 | Exchange, contract code, month, year, timestamp and session.交易所、合约代码、月份、年份、时间戳和交易时段。 | Hedging, curve analysis and contract-level research.套期保值、期限结构和单合约研究。 |
| Official settlement官方结算价 | An exchange-defined end-of-day value used for marking positions.交易所按规则确定、用于日终盯市的数值。 | Settlement date, contract, exchange methodology and correction status.结算日期、合约、交易所方法和更正状态。 | Daily valuation, risk and accounting workflows.日终估值、风险和会计流程。 |
| Assessed price评估价 | A publisher’s methodology-based estimate for a market that may trade sparsely.发布方依据方法论,对成交不活跃市场给出的估值。 | Publisher, methodology, assessment window, grade and geography.发布方、方法论、评估窗口、等级和地区。 | Physical contracts and specialized market reporting.实物合同和专业市场报告。 |
| Continuous futures series连续期货序列 | A synthetic history that rolls from one contract to another.从一个到期月份切换到下一个月份的合成历史。 | Roll rule, adjustment method, source contracts and roll dates.展期规则、调整方法、来源合约和展期日期。 | Charts and research—not a directly tradable instrument.图表和研究;它本身不是可直接交易的合约。 |
Do not normalize away the meaning. Convert units and field names only after storing the raw contract or benchmark identifier, source, price type and timestamp. A single column named commodity_price cannot safely mix spot, settlement and continuous futures values.
标准化不能抹掉价格含义。先保存原始合约或基准标识、来源、价格类型和时间戳,再统一字段和单位。一个名为 commodity_price 的列,不能安全混放现货、结算价和连续期货。
What commodity market data should the API cover?大宗商品行情 API 应覆盖哪些数据?
Metals and precious metals prices
Gold, silver, copper, aluminum, platinum, and palladium may be spot benchmarks, exchange futures, or vendor assessments. Record which one the endpoint returns.
Energy and oil price data
WTI, Brent, natural gas, heating oil, and power data differ by venue, contract, region, delivery period, and settlement method.
Agricultural commodity prices
Wheat, corn, soybeans, coffee, sugar, and cotton often require contract month, exchange, grade, location, and unit context.
贵金属与工业金属行情
黄金、白银、铜、铝、铂和钯可能对应现货基准、交易所大宗商品合约或供应商评估价,必须记录接口返回的价格口径。
能源与原油价格数据
WTI、布伦特原油、天然气、成品油和电力数据会因交易场所、合约、地区、交割期和结算方式而不同。
农产品价格数据
小麦、玉米、大豆、咖啡、糖和棉花通常还要说明合约月份、交易所、等级、地点和计量单位。
Official and public commodity data sources免费大宗商品数据可以优先查看哪些官方来源
Public sources are strongest when they publish the underlying statistic or benchmark directly. They are excellent for energy statistics, macro research and monthly commodity series, but they are not substitutes for licensed exchange-grade live feeds.
公共来源最有价值的地方,是它们直接发布底层统计或基准数据。能源统计、宏观研究和月度商品序列很适合从这些来源开始,但它们不能替代需要交易所授权的实时行情。
| Source来源 | Useful coverage适合的数据 | Access pattern访问方式 | Important limitation重要限制 |
|---|---|---|---|
| U.S. EIA Open Data | Petroleum, natural gas, coal and electricity prices, supply, stocks and flows.石油、天然气、煤炭和电力的价格、供给、库存与流量。 | API v2, query browser and bulk files.API v2、查询浏览器和批量文件。 | Dataset routes, facets, units and frequencies differ; an API key is required for API calls.不同数据集的路由、维度、单位和频率并不相同;调用 API 需要申请 Key。 |
| FRED | Economic commodity series collected from government and other publishers.汇集政府及其他发布方的经济类大宗商品序列。 | Series pages, downloads and a documented API.序列页面、文件下载和有文档的 API。 | Units, revision behavior and rights are series-specific; inspect the source notes.单位、修订方式和使用权因序列而异,必须查看来源说明。 |
| World Bank Pink Sheet世界银行 Pink Sheet | Monthly and annual international commodity price benchmarks across energy, metals, agriculture and fertilizers.能源、金属、农产品和化肥等国际商品基准的月度与年度数据。 | Published reports and historical spreadsheet files.定期报告和历史电子表格文件。 | Designed for macro and long-run analysis, not intraday trading.适合宏观与长期研究,不是盘中交易行情。 |
| Exchanges and contract specifications交易所与合约规格 | Contract identifiers, sizes, grades, delivery locations, months and official settlement context.合约代码、规模、等级、交割地点、月份和官方结算价口径。 | Product pages, specifications and licensed data products.产品页面、合约说明和授权数据产品。 | Real-time quotes, depth and redistribution commonly require separate entitlements.实时报价、深度行情和再分发通常需要单独授权。 |
For a broad research database, combine a public monthly or daily source with contract metadata. For a trading interface, obtain the correct market-data entitlement rather than relabeling a delayed or derived series as real time.
建设研究数据库时,可以把公共月度或日度序列与合约元数据结合;建设交易界面时,则应取得正确的行情授权,不能把延迟或派生序列重新包装成“实时数据”。
How to compare free commodity data APIs如何比较免费大宗商品数据 API
| Check核验项 | Ask要问的问题 | Why it matters为什么重要 |
|---|---|---|
| Price type价格类型 | Spot, futures, settlement, index, or assessed price?现货、期货、结算价、指数还是评估价? | Similar labels can represent different markets.相似名称可能代表不同市场。 |
| Freshness时效 | Real-time, delayed, end-of-day, or periodically updated?实时、延迟、日终还是定期更新? | “Latest” does not prove real-time delivery.“最新”不等于实时。 |
| History历史 | Start date, frequency, revisions, and continuous series?起始日期、频率、修订和连续序列如何? | Backtests need reproducible observations.回测需要可复现数据。 |
| Units单位 | USD per barrel, ounce, tonne, bushel, or index points?美元/桶、盎司、吨、蒲式耳还是指数点? | Wrong unit conversions silently corrupt results.错误换算会悄悄污染结果。 |
| Free tier免费额度 | Requests, symbols, retention, trial expiry, and attribution?请求数、品种数、保存期、试用到期和署名? | Free access may not support production.免费访问未必适合生产。 |
Normalize commodity prices without losing contract meaning标准化大宗商品价格时,不要丢掉合约与基准含义
A clean table should make unlike observations impossible to confuse. Keep the source’s identifier beside your internal symbol, and model benchmark, contract month, price type, currency, unit and timestamps as separate fields. Convert values only after the raw response has been saved.
一张可靠的标准表,首先要避免把不可比的数据混在一起。应同时保留来源代码和内部代码,并把基准、合约月份、价格类型、币种、单位与时间戳拆成独立字段。先保存原始响应,再进行数值换算。
| Field字段 | Store应保存的内容 | Validation rule校验规则 |
|---|---|---|
source_symbol | The provider’s exact series or contract code.供应商原始序列代码或合约代码。 | Never infer it from a display name.不能根据展示名称自行猜测。 |
benchmark / contract_month | Physical benchmark or exchange contract and delivery month.实物基准,或交易所合约及交割月份。 | Required for futures and location-specific prices.期货及地区性价格必须填写。 |
price_type | Spot, trade, bid, ask, settlement, assessment or continuous series.现货、成交、买价、卖价、结算价、评估价或连续序列。 | Do not silently replace one type with another.不得在没有说明的情况下替换成另一种价格。 |
price / currency / unit | Numeric value plus its quote currency and physical unit.价格数值、计价币种和实物计量单位。 | Record conversion factors and rounding explicitly.明确记录换算系数和舍入方式。 |
observation_time / release_time | When the market value applies and when it became available.价格对应的市场事件时间,以及数据实际发布的时间。 | Store timezone and distinguish event time from ingestion time.保存时区,并区分事件时间与入库时间。 |
revision / source | Correction status, retrieval time and provenance URL.更正状态、抓取时间和来源网址。 | Retain prior versions when reproducibility matters.需要复现研究时保留历史版本。 |
Continuous futures need their own lineage. Save the underlying contracts, roll dates, roll trigger and adjustment method. Back-adjusted history can be useful for return research, but its old price levels are synthetic.
连续期货必须保留单独的构造记录。应保存底层合约、展期日期、触发规则和调整方法。后复权序列适合研究收益变化,但其早期价格水平是合成结果,不能当作当时真实成交价。
How to use a commodity price API in Python如何用 Python 调用大宗商品价格 API
1. Define the commodity and price meaning
Write down the commodity, benchmark or contract, venue, currency, unit, timezone, and required frequency before selecting an endpoint.
2. Test one free JSON request
Start with the provider’s official documentation. Keep the API key outside source code, set a timeout, and capture quota and freshness metadata.
3. Normalize price, unit, and timestamp
Store the raw symbol and source. Convert units explicitly, reject missing timestamps, flag stale values, and preserve revision dates for historical observations.
4. Add rate-limit-safe retries
Use bounded exponential backoff for transient errors, respect 429 responses, cache slow-changing series, and avoid spending a small free quota on unnecessary polling.
1. 明确商品与价格口径
选择接口前,写清商品、基准或合约、交易场所、币种、单位、时区和所需频率。
2. 测试一次免费 JSON 请求
从供应商官方文档开始,把 API 密钥放在源码之外,设置超时,并记录配额和数据时效元数据。
3. 统一价格、单位和时间戳
保留原始代码和来源,显式换算单位,拒绝缺失时间戳,标记过期值,并为历史观测保存修订日期。
4. 在限流范围内安全重试
对临时错误使用有上限的指数退避,遵守 429,缓存低频序列,避免把有限免费额度浪费在无意义轮询上。
Quality checks before a commodity API reaches production大宗商品 API 上线前应完成哪些质量检查
A successful HTTP response proves transport, not data quality. Run checks at ingestion and again after normalization. Set thresholds by dataset frequency: a monthly World Bank series and an intraday futures quote should not share one freshness rule.
HTTP 请求成功只能说明传输正常,并不能证明数据可靠。原始数据入库时和标准化完成后都要检查,而且阈值应按数据频率设置:世界银行月度序列与盘中期货报价不能共用一条时效规则。
Freshness and completeness
Compare the latest observation with the provider’s schedule, flag missing intervals, and distinguish a closed market from a failed feed.
Units and economic bounds
Reject unknown currencies or units, test conversions, and investigate implausible jumps without assuming every negative or extreme value is invalid.
Contract continuity
Detect symbol changes, expiries and roll gaps. Do not fill a missing front contract with another month unless the substitution is explicit.
Revisions and reconciliation
Keep retrieval versions for revised public series and periodically reconcile sampled values with the publisher’s own page or file.
License and redistribution
Record attribution, display, storage and redistribution rules with the dataset. Technical access is not automatically permission to republish.
时效与完整性
按发布方日历检查最新观测值,标记缺失区间,并区分市场休市与数据源故障。
单位与合理区间
拒绝未知币种或单位,测试换算逻辑;遇到异常跳变要调查原因,但不要先入为主地把负值或极端值一律判错。
合约连续性
识别代码变更、到期和展期缺口。除非规则明确,不能在没有说明的情况下用另一个月份的合约填补近月合约空缺。
修订与来源核对
对会修订的公共序列保留抓取版本,并定期抽样对照发布方页面或原始文件。
授权与再分发
把署名、展示、保存和再分发规则与数据一同记录。能够调用接口,并不等于可以公开转售或传播。
For backtests: query information as it was available on each decision date whenever revisions, contract rolls or delayed publication matter. Using today’s corrected series across the entire history can introduce look-ahead bias.
用于回测时:只要数据存在修订、合约展期或延迟发布,就应尽量按每个决策日当时可获得的信息重建数据。把今天已经更正的完整序列直接用于全部历史,可能产生前视偏差。
Use QVeris to find commodity price API capabilities用 QVeris 查找大宗商品价格 API 能力
QVeris helps developers and agents discover callable data capabilities and inspect inputs before integration. It does not make licensed exchange data free or guarantee that a provider is suitable for trading.
QVeris 帮助开发者和智能体查找可调用的数据能力,并在接入前检查输入要求。它不会把受许可约束的交易所数据变成免费,也不保证某个来源适合交易。
- Search the QVeris Tool Finder for commodity and financial-data capabilities.
- Inspect symbols, parameters, authentication, output schema, units, and timestamps before an agent calls a provider.
- Keep licensing, accuracy, latency, and suitability checks in your approval process.
- 使用 QVeris 工具查找器搜索大宗商品与金融数据能力。
- 在智能体调用前检查品种代码、参数、鉴权、输出数据结构、单位和时间戳。
- 把授权、准确性、延迟和适用性检查保留在审批流程中。
FAQ
Is there a free API for commodity prices?
Yes, but “free” varies: public datasets, delayed feeds, low-volume tiers, and trials have different coverage and usage rights.
Can I get real-time commodity prices through a free API?
Sometimes for selected products or limited quotas. Verify the timestamp, delay policy, exchange entitlement, and redistribution terms.
Which commodities can a price API cover?
Common groups include precious and industrial metals, energy, and agriculture. Coverage does not guarantee the same price type or frequency.
Can I get historical commodity prices in JSON?
Many APIs return JSON history, but depth, frequency, revisions, continuous-series construction, and free limits vary.
Can a free commodity API be used for trading?
Only after validating license, latency, corrections, reliability, and suitability. A free tier alone is not evidence of execution-grade data.
有免费的大宗商品价格 API 吗?
有,但公开数据集、延迟行情、低配额免费套餐和试用额度的覆盖范围与使用权并不相同。
免费 API 能获取实时大宗商品行情吗?
部分服务会开放少量品种或配额;必须核对时间戳、延迟政策、交易所授权和再分发规则。
大宗商品 API 通常覆盖哪些品种?
常见品类包括贵金属、工业金属、能源和农产品,但同名品种的价格口径和频率可能不同。
如何通过 API 获取大宗商品历史数据?
可寻找 JSON 历史接口,同时核对时间范围、频率、修订、连续序列方法和免费限制。
免费大宗商品 API 能用于量化交易吗?
应先验证授权、延迟、更正、稳定性和适用性;“免费”本身不能证明数据达到交易级。
