Gold Price API: Real-Time & Historical XAU Data

A developer-first gold price API with live LBMA-blended XAU spot, 58 years of historical data back to 1968, and conversion to any ISO 4217 currency. JSON by default, XML and JSONP on request. No new charts library needed — we server-render the sparkline and ship you the data.

200 requests/day free (forex + crypto) · Metals on the $9/mo Pro plan · No card to register

Live gold spot price

LBMA-blended reference rate in USD per troy ounce. Refreshed every 15 minutes on the server; page loads show the last-published fix.

Server-rendered · updated 2026-04-21 09:24 UTC
XAU/USD · LBMA reference
$4,805.73
per troy ounce

To fetch this value programmatically:

GET /api/commodities/rates
  ?from=USD&to=XAU
Authorization: Bearer YOUR_API_KEY

60-second gold API quickstart

Pick a language, copy the snippet, replace YOUR_API_KEY. Every example hits /api/commodities/rates and returns the live XAU/USD spot price. Because XAU is an ISO 4217 code, most downstream finance libraries handle it natively — you can store “grams of gold” the same way you store “dollars”.

curl "https://api.unirateapi.com/api/commodities/rates?api_key=YOUR_API_KEY&from=USD&to=XAU"
Example JSON response
{
  "amount": 1,
  "base": "USD",
  "to": "XAU",
  "rate": 0.000413,
  "result": 0.000413
}

The rate field is troy ounces of gold per USD (so 0.000413 oz/USD ≈ $2,421/oz). Divide 1 by the rate to get USD/oz. Divide by 31.1035 for USD/gram, multiply by 1000 for USD/kg — the three unit conversions that cover 95% of integrations.

Want a full Python walkthrough with pandas and matplotlib charts? See the precious metals tracker tutorial or the older gold API guide (more conceptual; this page is the API reference).

30-year gold price history

361 monthly closing prices sampled from LBMA data, covering 1996-04-20 to 2026-04-01 (29.9 years). The USD price of gold is up 1112% over this window — from $391/oz to $4,739/oz, with an all-time range of $255 to $5,281 per troy ounce. Pull the full series via /api/commodities/historical/timeseries.

$5,281 $255 1996 2003 2011 2018 2026

Source: UniRateAPI commodity historical cache, derived from LBMA fixings. Points are sampled at one per month (first available close) for chart clarity. Daily granularity is available on the historical endpoint.

Spot gold vs gold futures: which one does this API return?

Spot price (what you get here)

Spot gold is the reference price for immediate delivery of LBMA-grade good-delivery bars (400 troy oz, 99.5%+ purity). It is published via the twice-daily LBMA Gold Price auction at 10:30 and 15:00 London time and re-interpolated throughout the trading day from market feeds.

This is the right price for: portfolio valuation, ETF NAV, jewelry pricing, bullion dealer inventory, accounting and audit, multi-currency e-commerce checkout, regulatory reporting, and anything else that needs a defensible reference rate.

The endpoint that serves it is /api/commodities/rates. We return the XAU price in USD per troy ounce as blended from LBMA, Kitco, and goldprice.org with automatic outlier rejection.

Futures (COMEX GC contracts)

Gold futures are exchange-traded contracts for delivery of 100 troy oz at a specified future date. The most active contract is COMEX GC. Futures prices carry a basis premium or discount to spot driven by US interest rates (gold’s cost of carry), ETF flows, storage costs, and supply/demand expectations.

This is the right price for: hedging physical inventory or production, speculating on short-term moves, tracking contango/backwardation, and implementing delta-one gold strategies.

We do not return futures prices — for that you need an exchange-connected market data vendor or a brokerage API (Interactive Brokers, TradeStation, etc). For 95% of integrations involving gold, spot is what you want.

The practical test

If you are pricing something — a necklace, an invoice, an ETF share, a custody balance — use spot. If you are trading it or hedging it on a specific future date, use futures. Almost every API integration falls into the first bucket.

Gold API endpoint reference

Four endpoints cover every gold integration pattern: current spot price, single-date historical, time-series ranges, and symbol metadata. All require api_key either as a query param or Authorization: Bearer header, and require the Pro tier. Full OpenAPI spec lives in the Swagger console.

GET /api/commodities/rates Current spot Pro

Returns live USD-per-troy-ounce prices for gold (XAU), silver (XAG), platinum (XPT) and palladium (XPD). Pass to=XAU for a single metal, or omit it for all four. Refreshed every 15 minutes from the LBMA-blended cache.

Parameters
  • api_key — required (Pro plan)
  • from — base (USD by default, or any ISO 4217)
  • to — optional target (XAU/XAG/XPT/XPD)
  • amount — optional multiplier
  • format — json (default), xml, jsonp
Example
GET /api/commodities/rates
  ?from=USD&to=XAU
→ { "amount": 1, "base": "USD",
    "to": "XAU",
    "rate": 0.000413,
    "result": 0.000413 }
GET /api/commodities/convert Convert amount Pro

Converts between metals and currencies in a single call — commodity-to-commodity, commodity-to-currency, or currency-to-commodity. Use this when you want a pre-calculated amount, not rate metadata.

Parameters
  • amount — required, float
  • from, to — any of XAU/XAG/XPT/XPD or ISO 4217 code
  • format — json / xml / jsonp
Example
GET /api/commodities/convert
  ?amount=10&from=XAU&to=USD
→ { "amount": 10, "from": "XAU",
    "to": "USD", "result": 24287.50 }
GET /api/commodities/historical/rates Historical (single date) Pro

Gold price for any specific date. Use for accounting, tax reporting, ETF NAV backdating, or jewelry-inventory revaluation. Set to to a fiat currency (e.g. EUR) and we convert through the matching historical FX rate for that same date — which is what auditors require.

Parameters
  • date — required, YYYY-MM-DD
  • from, to, amount — same shape as /rates
Example
GET /api/commodities/historical/rates
  ?date=2020-03-20&from=XAU&to=USD
→ { "date": "2020-03-20",
    "rate": 1479.25, ... }
GET /api/commodities/historical/timeseries Range query Pro

Date-range queries up to 5 years per call. Ideal for drawing charts, running backtests, or bulk-loading a metal series into a data warehouse. Combine with the forex time-series endpoint to get a dated, FX-correct valuation sequence.

Parameters
  • start_date, end_date — required
  • base — USD default, any ISO 4217
  • symbols — comma-separated (e.g. XAU)
Example
GET /api/commodities/historical/timeseries
  ?start_date=2024-01-01
  &end_date=2024-12-31
  &symbols=XAU

How the gold price is sourced

Gold spot and historical rates are blended from institutional and market sources, weighted by reliability and recency. When a source returns an outlier tick (fat-finger, feed glitch) it is automatically excluded from the published rate. Each scraper in the list below is a real module in our pipeline — not a marketing claim — and you can cross-reference them in the pipeline itself via app/scrapers/.

LBMA
London Bullion Market Association

The authoritative benchmark — twice-daily auction-based fixings for gold, silver, platinum and palladium. Used by ETFs, central banks, and bullion banks worldwide to settle contracts.

Kitco
Kitco Metals

Retail / wholesale bullion market data from Montreal. Cross-check source for the LBMA blend — useful during off-hours when London and New York are both closed.

World Gold Council
goldorg scraper

Supplementary gold pricing and demand metadata from the WGC / gold.org. Used for recency verification against the LBMA fix.

goldprice.org
goldpriceorg scraper

Public consensus bullion quotes in multiple currencies — used to sanity-check the FX-converted rates on the metals endpoints.

pricez feed
cfworker_pricez scraper

Edge-cached tick feed covering all four metals — used when LBMA and Kitco are both mid-update to avoid stale prices.

Swissquote
FX + metals feed

Market-hours metal quotes from a regulated Swiss dealer. Third leg of the outlier-rejection check on XAU/XAG, minor contributor on XPT/XPD.

The weighted-blend algorithm decays older observations and favours the LBMA fix during its publication windows. Full source code for each scraper is in app/scrapers/ in the UniRateAPI repo.

UniRateAPI vs GoldAPI.io, metals-api.com, MetalpriceAPI and Alpha Vantage

Pricing and feature data verified against each vendor’s public pricing page in 2026. All five providers ultimately read from the LBMA fix for the authoritative reference rate — the meaningful differences are packaging, historical depth, bundled features, and price.

Feature UniRateAPI GoldAPI.io metals-api.com MetalpriceAPI Alpha Vantage
Entry price $9/mo Free tier then on request $19.99/mo (Copper) $8.99/mo (Basic) $49.99/mo
Requests / month (entry) 750,000 ~100 (free tier) 2,500 10,000 75 req/min (no daily cap)
Metals covered XAU, XAG, XPT, XPD XAU, XAG All four + rhodium All four XAU, XAG
Historical depth 58 yrs (XAU/XAG), 36 yrs (XPT/XPD) Historical available 30 days on entry, 365 on top tier Yes (paid) Yes (paid)
Forex + crypto bundled 170+ FIAT · 420+ crypto No FIAT only, no crypto FIAT + metals, no crypto FIAT + crypto + stocks
Currency conversion Any ISO 4217, server-side USD only Yes (limited) Yes USD only
Free tier 6,000/mo (forex + crypto) ~100/mo None on entry 100/mo 25 req/day
Response formats JSON, XML, JSONP JSON JSON JSON JSON, CSV
Time-series included Yes, at $9 Paid tier Paid tier (Gold+) Paid tier Premium

Pricing accurate as of 2026-04. Verify each vendor’s current plans before committing — metals-api.com in particular has been raising prices regularly since 2024.

What developers build with the gold price API

Six real use cases — every one of these has shipped to production on the UniRateAPI gold endpoint during 2024–2026.

📊

Portfolio tracking

Show a client’s gold holding in the same ledger as their stocks, bonds, and cash — in any ISO 4217 reporting currency. One call returns XAU in USD; the Convert endpoint re-prices it in EUR, GBP, JPY for multi-currency portfolios.

Python tracker tutorial →
💍

Jewelry & bullion pricing

Live cost-per-gram for custom jewelry, bullion product pages, and B2B wholesale quotes. Server-side render spot × gram-weight × purity × margin, cache for 15 minutes to match our refresh cadence.

Gold API integration guide →
🏦

ETF NAV & fund accounting

Daily net-asset-value calculations for physically-backed gold ETFs and mutual funds. Use the 15:00 LBMA fix as the authoritative close via /api/commodities/historical/rates?date=....

Multi-currency accounting guide →
🏭

Central bank reserve reporting

Treasury and central-bank gold reserves are reported monthly at the LBMA reference price. Automate the revaluation with a single historical call per month per metal — no more manual spreadsheet entry.

Historical API guide →

Mining company P&L

Junior and mid-cap miners revalue their reserves and forecast revenue based on spot gold. A nightly job that pulls the close and posts to Slack or a BI tool takes ~20 lines of Python with this API.

International payments guide →
💳

Crypto-backed collateral

Gold-backed stablecoins (PAXG, XAUT) and lending platforms that accept tokenised gold as collateral need live XAU pricing to size margins and liquidation triggers. Cache the spot with a 60-second TTL to stay responsive without blowing the rate limit.

Free crypto APIs compared →

Gold price API FAQ

Straight answers, pulled from the People Also Ask block on “gold price api” and the Reddit threads developers actually post about this stuff.

Is the gold price API free? +
Yes. UniRateAPI has a free tier of 200 requests/day for rates and currency conversion — that includes forex and crypto. Live gold (XAU) spot data, historical gold prices back to 1968, and the precious-metals endpoints sit behind the $9/mo Pro plan because LBMA-grade bullion data costs real money to maintain. No credit card is needed to register and try the free tier first.
How do I get live gold prices from the API? +
Call GET /api/commodities/rates?from=USD&to=XAU with your API key. The response returns the current USD-per-troy-ounce price plus a timestamp. Values are sourced from LBMA fixings and cross-checked against Kitco, goldprice.org and major market feeds. Full code samples in Python, Node, Go, PHP, and cURL are in the quickstart section above.
What is the XAU currency code? +
XAU is the ISO 4217 code for one troy ounce of gold (31.1035g at 99.5% purity). So if XAU/USD is 2,400 it means one troy ounce costs $2,400. Silver is XAG, platinum XPT, palladium XPD. These codes are supported by every mainstream financial system — you can store gold balances the same way you store USD or EUR.
How far back does the historical gold price data go? +
Our LBMA-based gold price history goes back to 1 April 1968 — that is 58 years of daily closes including the 1971 Nixon Shock, 1980 Hunt brothers peak, the 2008 financial crisis, the 2011 Eurozone run, and the 2020–2024 macroeconomic re-pricing. Historical data is delivered via /api/commodities/historical/rates for a single date or /api/commodities/historical/timeseries for a range.
What is the difference between spot gold and gold futures? +
Spot price (what this API returns) is the price to buy or sell gold for immediate delivery. Futures contracts — like COMEX GC — price gold for delivery at a specified future date, and trade at a premium or discount to spot based on interest rates, storage, and market expectations. For analytics, accounting, e-commerce pricing or portfolio valuation you almost always want spot. For hedging physical inventory or speculating on short-term moves, traders use futures via a broker.
How accurate is the gold price compared to GoldAPI.io or metals-api.com? +
For reference use cases (portfolio valuation, accounting, jewelry pricing, ETF NAV) our blended LBMA rate tracks the industry benchmark to within a few cents per ounce. Vendors like GoldAPI.io, metals-api.com and MetalpriceAPI source largely the same LBMA feed we do. The difference is packaging — they charge $20–$80/month for precious-metals-only data; UniRateAPI bundles metals with forex and crypto for $9/mo so you only hit one vendor.
Can I convert gold prices to currencies other than USD? +
Yes. Pass from=XAU&to=EUR (or any ISO 4217 code) and the API converts the spot USD price through our forex cache to the requested currency. For historical conversions, the same thing works on /api/commodities/historical/rates?date=YYYY-MM-DD&from=XAU&to=EUR — we load the historical FX rate for that date so your back-priced gold value is correct on audit.
Do you support gold in grams and kilograms as well as troy ounces? +
The API returns prices in USD per troy ounce to match LBMA and COMEX conventions. Converting to grams or kilograms is a client-side multiplication: price_per_gram = xau_price / 31.1034768, price_per_kg = price_per_gram * 1000. Most jewelry-pricing integrations want grams; ETF NAV calculations and bullion dealers stay in troy ounces.
How often is the gold price refreshed? +
Our gold rate is re-blended from underlying sources every 15 minutes during global market hours (Sydney open through New York close) and held flat outside those windows, matching LBMA behaviour. If you need sub-minute ticks for HFT you want a broker feed, not a reference-rate API — and you should budget 100×+ the price.
What is an LBMA gold fix? +
The LBMA Gold Price (the modern replacement for the historic London Gold Fixing) is an auction-based benchmark set twice daily at 10:30 and 15:00 London time. It is the reference rate used by central banks, ETFs, bullion banks, and institutional gold buyers worldwide to settle contracts. Our historical data uses this fix as the authoritative daily close.

Ship a gold feature this afternoon

Register for a free API key, upgrade to Pro ($9/mo) for gold access, and you’re live. Cancel anytime — no annual contract. Gold is bundled with silver, platinum, palladium, 170+ forex currencies, 420+ cryptocurrencies and 27 years of historical data on one key.