Precious Metals API Guide黄金行情接口指南

Free Gold Price API
Live XAU, JSON & Python
免费黄金价格 API
实时 XAU、JSON 与 Python 接入

Choose a free gold price API for live XAU spot or historical data by comparing freshness, currencies, units, quotas, licensing, and integration requirements.

按实时金价、历史范围、币种单位、免费配额和授权筛选黄金价格 API,
再接入应用、看板或智能体。

Whiteboard workflow for choosing a free gold price API by XAU coverage, free quota, API key, timestamps, units, history, and JSON fields

TL;DR速览

Search task

Developers want a callable free gold price API and sample request, not only a gold chart or market commentary.

“Free” varies

A free tier can mean a permanent monthly quota, a time-limited trial, delayed prices, or restricted history.

Price definition matters

XAU spot, benchmark, dealer bid/ask, futures, and karat values are different datasets.

Verify first

Confirm symbol, timestamp, currency, ounce or gram unit, update interval, API limits, and redistribution rights.

真实任务

开发者需要可编程调用的黄金实时价格与示例请求,而不是只有金价图表或行情评论。

“免费”并不统一

免费可能是长期可用但配额较低、限时试用、延迟价格,或只开放有限历史数据。

价格口径必须匹配

XAU 现货、基准价、买卖价、期货与不同纯度金价不是同一种数据。

先核验再接入

确认代码、时间戳、币种、盎司或克单位、更新间隔、配额和再分发权利。

Gold spot, benchmark, futures, and retail prices are not interchangeable黄金现货、基准、期货与零售金价不是同一种数据

“Gold price” can describe several markets. An API should state exactly which market, methodology and timestamp produced the value. XAU/USD is often used as a display symbol, but the symbol alone does not prove that two providers use the same underlying source.

“黄金价格”可能来自多个不同市场。接口应说明数值对应的市场、方法和时间戳。XAU/USD 常被用作展示代码,但仅凭这一代码,无法证明不同供应商采用了同一个底层来源。

Price type价格类型Meaning含义Keep with the value必须一同保存Best use适合用途
Spot reference现货参考价A current over-the-counter market reference, often quoted per troy ounce.场外市场的当前参考价,通常按金衡盎司计价。Source, bid/ask/mid, currency, unit and timestamp.来源、买价/卖价/中间价、币种、单位和时间戳。Monitoring, conversion and research.行情监控、换算和研究。
LBMA Gold PriceLBMA Gold Price 基准A benchmark administered through a defined auction and publication process.按照明确竞价与发布流程形成的基准价格。AM/PM session, publication date, currency and usage rights.上午/下午场次、发布日期、币种与使用权。Valuation and benchmark-linked analysis.估值和基准相关分析。
Gold futures黄金期货An exchange contract for a specific delivery month.对应特定交割月份的交易所合约。Exchange, contract code, month, price field, session and settlement status.交易所、合约代码、月份、价格字段、时段和结算状态。Hedging, curve and contract research.套期保值、期限结构和合约研究。
Retail or karat price零售价或不同纯度金价A derived value that can include purity conversion, fabrication, tax and dealer spread.可能包含纯度换算、加工费、税费和商家价差的派生价格。Purity, product form, location, tax basis and calculation method.纯度、产品形态、地区、税费口径和计算方法。Consumer display, not wholesale-market comparison.面向消费者展示,不适合直接对比批发市场。

Unit conversion is not price discovery. One troy ounce is a weight unit; converting an ounce quote to grams does not create a local retail price. If converting currencies, store the FX source and timestamp as well as the gold source.

单位换算不等于得到了本地成交价。金衡盎司只是重量单位,把盎司报价换算成克价,并不会自动得到某地零售金价。若还涉及汇率换算,应同时保存汇率来源、时间戳和黄金价格来源。

What a free gold price API must provide免费黄金价格 API 应满足哪些条件

The right API identifies XAU and the price methodology instead of returning an unexplained “gold price.” Verify spot or benchmark, bid, ask or mid, currency, ounce or gram, and whether “live” is cached or delayed. A free account does not override market-data licenses or public-display restrictions.

合适的黄金实时价格接口不会只返回含义不明的“金价”,而会说明 XAU 代码、价格口径、币种、盎司或克单位,以及“实时”是否存在缓存或延迟。免费账户也不会自动覆盖行情授权或公开展示限制。

Is the free live gold price API actually live?

Check the source timestamp, stated delay, cache duration, market-hours behavior, and update interval. “Latest” does not always mean a tick-level tradable quote.

Does the free historical gold price API cover your range?

Check the first available date, daily or intraday granularity, missing periods, revisions, currencies, and whether the series represents spot, benchmark, or futures prices.

Does the gold price API return usable JSON?

A useful response identifies XAU, price type, value, currency, unit, timestamp, and source. Stable fields, documented errors, authentication, and rate-limit headers reduce integration risk.

黄金实时价格接口真的实时吗?

检查来源时间戳、延迟标记、缓存时长、市场时段和更新间隔。“最新”不一定是可交易的逐笔报价。

免费黄金历史数据 API 覆盖多长时间?

检查最早日期、日线或盘中粒度、缺失区间、修订机制和币种,并确认数据代表现货、基准还是期货。

黄金价格 API 是否返回可用 JSON?

响应应标明 XAU、价格类型、数值、币种、单位、时间戳和来源;稳定字段、错误文档、鉴权和限流响应头能降低接入风险。

Validate gold price data before charts, alerts, or agents use it黄金价格进入图表、提醒或 Agent 前的质量检查

A JSON response can be technically valid while carrying a stale quote, the wrong unit, or a different price type. Validate both the transport and the market meaning.

JSON 响应即使格式正确,也可能包含过期报价、错误单位或不同价格口径。因此,既要检查传输是否成功,也要检查数据在市场上的真实含义。

Freshness

Compare source time with ingestion time, apply market-hours rules, and label delayed or end-of-day values instead of presenting every latest record as live.

Currency and unit

Require ISO currency, troy-ounce or gram unit, and an explicit conversion factor. Do not confuse a troy ounce with an avoirdupois ounce.

Bid, ask, mid, or fix

Reject records with an unknown price field. A mid-price cannot be silently compared with an executable ask or an official benchmark.

Outliers and gaps

Flag duplicate timestamps, impossible gaps and large moves for review, but use a trusted reference before deciding that a genuine market move is an error.

History and corrections

Preserve raw responses, retrieval times and corrected versions. For futures history, record contract month and any continuous-series roll method.

Display rights

Document attribution, caching, public display and redistribution terms. An accessible endpoint does not automatically grant rights to republish its feed.

时效

比较来源时间戳和入库时间,并结合市场时段判断。应明确标注延迟或日终数据,不能把每条“最新记录”都写成实时行情。

币种与单位

要求返回明确币种、金衡盎司或克单位以及换算系数,不能把金衡盎司与常衡盎司混用。

买价、卖价、中间价或基准价

价格字段含义不明时应拒绝入库。不能在没有说明的情况下把中间价当作可成交卖价,也不能用它直接替代官方基准。

异常值与缺口

重复时间戳、异常缺口和大幅波动需要标记复核,但在判错前应先与可信来源核对,避免删除真实行情变化。

历史与更正

保留原始响应、抓取时间和更正版本。期货历史还要记录合约月份,以及连续序列采用的展期方法。

展示与再分发权利

记录署名、缓存、公开展示和再分发条款。能访问接口,并不代表可以直接公开传播整套行情。

Compare free gold price API options免费黄金价格 API 选择清单

Check检查项Questions to ask需要确认Good for适合场景Common limit常见限制
Coverage覆盖XAU spot, benchmark, bid/ask, futures, or karat prices?XAU 现货、基准、买卖价、期货还是纯度金价?Matching the required gold dataset.匹配所需黄金数据。One price type or currency only.只开放一种价格或币种。
Freshness时效Real time, delayed, end of day, or cached?实时、延迟、日终还是缓存?Matching research or live workflows.匹配研究或在线任务。Exchange entitlement.交易所授权限制。
Fields字段XAU, price type, currency, ounce or gram, timestamp, source?XAU、价格类型、币种、盎司或克、时间戳与来源?Charts, research, monitoring.图表、研究、监控。Free tier may omit history.免费套餐可能不含历史数据。
Access接入REST, JSON, SDK, API key, quota, and documented errors?REST、JSON、SDK、API Key、配额和错误文档?Reliable application integration.可靠应用接入。Trials expire; quotas change.试用到期或配额变化。

How to use a free gold price API in Python如何用 Python 调用免费黄金价格 API

1. Define XAU price type and units

Choose spot, benchmark, bid/ask, or futures; then specify currency, troy ounce or gram, update frequency, and history range before comparing providers.

2. Test one free gold price API request

Start with the provider’s official cURL or Python example and a free API key when required. Keep credentials outside source code, set a timeout, and record quota headers.

3. Validate XAU JSON before storage

Reject missing timestamps, normalize timezones, preserve the raw symbol and unit, detect stale responses, and compare a sample with a documented benchmark 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. 明确 XAU 价格类型和单位

先确定现货、基准、买卖价或期货,再确定币种、金衡盎司或克、更新频率和历史范围。

2. 发起一次免费黄金价格 API 请求

从供应商官方 cURL 或 Python 示例开始;需要时申请免费 API Key。密钥放在源码之外,设置超时并记录配额响应头。

3. 入库前校验 XAU JSON

拒绝缺少时间戳的数据,统一时区,保留供应商原始代码、币种和单位,检测过期响应,并抽样与有文档的基准或授权来源核对。

4. 在限流范围内重试

对临时故障使用指数退避和抖动,遵守 429 与供应商规则,不能把有限免费配额消耗在高频轮询上。

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 free API for gold prices?

Yes. Providers may offer a permanent free endpoint, limited free tier, or trial. Check current quotas, delays, historical depth, and license terms.

Can I get historical gold prices by API?

Yes, but free depth and daily or intraday coverage vary. Confirm XAU methodology, currency, unit, earliest date, timestamp, and revision policy.

What should a gold price API return?

At minimum: XAU symbol, price type, value, currency, unit, timestamp, and source. Add OHLC data only when the series supports it.

Can I use a free gold price API in production?

Only after verifying quota, license, freshness, reliability, corrections, and public-display rights. Free access alone does not prove production suitability.

有免费的黄金价格 API 吗?

有些供应商提供永久免费端点、有限免费套餐或试用额度,但需要检查当前配额、延迟、历史范围和授权条款。

如何通过 API 获取黄金历史价格?

先确认 XAU 价格口径、币种、盎司或克单位、最早日期、时间戳与修订机制,再选择日线或盘中数据。

黄金价格接口应返回哪些字段?

至少包含 XAU 代码、价格类型、数值、币种、单位、时间戳和来源;只有数据序列支持时才使用 OHLC。

免费金价 API 能用于生产环境吗?

应先验证配额、授权、时效、稳定性、更正机制与公开展示权利,不能仅凭“免费”判断适用性。

External references外部参考链接