Free · No auth required

Gold Data API

Live gold spot, daily history and central-bank reserves as clean JSON, in 30+ currencies, plus silver, Bitcoin-vs-gold and market stats in the same response. Free to use, no API key, no rate limits for reasonable use.

GET
https://xaus.com/api/v1/spot
Live price
XAU/USD spot rate refreshed continuously, cached 30 seconds at the edge.
🌍
30+ currencies
Convert the XAU spot price to USD, EUR, GBP, JPY, AUD, INR and more via ?currency=
⚖️
3 weight units
Troy ounce, gram, or kilogram via ?unit=, all in one request.

Make your first request

curl
curl https://xaus.com/api/v1/spot

# With currency conversion
curl "https://xaus.com/api/v1/spot?currency=EUR"

# Price per gram in GBP
curl "https://xaus.com/api/v1/spot?currency=GBP&unit=gram"
JavaScript
// Fetch live XAU spot price
const res  = await fetch('https://xaus.com/api/v1/spot');
const data = await res.json();

console.log(data.spot_usd_oz);   // e.g. 3330.42
console.log(data.xau.price);     // price in requested currency + unit

// With options
const res2 = await fetch(
  'https://xaus.com/api/v1/spot?currency=EUR&unit=gram'
);
const eurGram = await res2.json();
console.log(eurGram.xau.price);  // EUR per gram
Python
import requests

# Basic request
r    = requests.get("https://xaus.com/api/v1/spot")
data = r.json()
print(data["spot_usd_oz"])    # 3330.42
print(data["per_gram_usd"])   # 107.0601

# Price per kg in JPY
r2 = requests.get(
    "https://xaus.com/api/v1/spot",
    params={"currency": "JPY", "unit": "kg"}
)
print(r2.json()["xau"]["price"])   # JPY per kg
PHP
<?php
$response = file_get_contents(
    'https://xaus.com/api/v1/spot?currency=EUR'
);
$data = json_decode($response, true);

echo $data['spot_usd_oz'];   // 3330.42
echo $data['xau']['price']; // EUR/oz

Interactive explorer

Runs against the real API from your browser, no key, no setup. The response below is live.

https://xaus.com/api/v1/spot
Live response
Loading live response…

Example response

JSON, GET /api/v1/spot
{
  "xau": {
    "price":    4007.20,       // price in requested currency + unit
    "currency": "USD",
    "unit":     "troy_oz"
  },
  "spot_usd_oz":  4007.20,       // always USD/oz regardless of params
  "per_gram_usd": 128.8344,
  "per_kg_usd":   128834.37,
  "silver_usd_oz":     48.27,     // XAG/USD spot
  "gold_silver_ratio": 83.02,
  "xaut_gold_ratio":   1.0018,    // tokenized gold vs spot (>1 = premium)
  "paxg_gold_ratio":   0.9994,
  "btc_usd":           104300,
  "btc_gold_oz":       26.03,     // oz of gold per 1 BTC
  "gold_market_cap_usd": 28330000000000,
  "gold_supply_tonnes":  219890,
  "fx_rate":      1,             // FX rate used (USD→requested currency)
  "updated_at":   "2026-07-02T09:00:00.000Z",
  "source":       "xaus.com",
  "docs":         "https://xaus.com/api"
  // + tokenized-gold prices, BTC-vs-gold aggregates, central-bank
  //   reserve stats & full fx_rates table, see field reference below
}
FieldTypeDescription
xau.pricenumberGold price in the requested currency and unit
xau.currencystringISO 4217 currency code
xau.unitstringWeight unit: troy_oz · gram · kg
spot_usd_oznumberRaw XAU/USD spot price per troy ounce, always present regardless of params
per_gram_usdnumberSpot price per gram in USD
per_kg_usdnumberSpot price per kilogram in USD
fx_ratenumberFX rate applied (USD → requested currency)
fx_ratesobjectFull table of live FX rates vs USD
silver_usd_oznumberXAG/USD silver spot price per troy ounce
gold_silver_rationumberGold price ÷ silver price (oz of silver per oz of gold)
xaut_usd / paxg_usdnumberTether Gold (XAUT) and Pax Gold (PAXG) token prices in USD
xaut_gold_ratio / paxg_gold_rationumberToken price ÷ gold spot, above 1.0 = premium to physical gold
btc_usdnumberBitcoin price in USD
btc_gold_oz / btc_gold_kgnumberGold (troy oz / kg) that one Bitcoin buys at spot
btc_market_cap_usdnumberBitcoin market capitalization in USD
gold_market_cap_usdnumberGold market cap: spot × total above-ground ounces
btc_vs_gold_mcap_pctnumberBitcoin market cap as % of gold market cap
bitcoin_gold_parity_usdnumberBTC price at which Bitcoin's market cap would equal gold's
gold_supply_tonnesnumberTotal above-ground gold stock, tonnes (WGC, updated annually)
annual_production_tonnesnumberAnnual gold mine production, tonnes (WGC)
underground_reserves_tonnesnumberEstimated mineable underground reserves, tonnes (USGS)
cb_reserves_tonnesnumberTotal central-bank / official gold reserves, tonnes
cb_top_holder_usa_tonnesnumberLargest official holder (United States), tonnes
cb_net_purchases_tonnesnumberLatest full-year net central-bank purchases, tonnes
cb_reserves_pct_supply / cb_share_global_reserves_pctnumberOfficial reserves as % of above-ground supply / of global allocated FX reserves
price_source / fx_source / silver_source / token_sourcestringUpstream source attribution per data group
data_stateobjectCanonical state of the core gold price: { status: "fresh"|"stale"|"unavailable", as_of, source: "upstream"|"cache", age_seconds }. Present on every response including 503.
stalebooleanTrue when serving the last known real price during an upstream outage, prices are never simulated
price_as_ofstringWhen the gold price was sourced (ISO 8601); differs from updated_at only when stale
fx_stalebooleanTrue when FX comes from the static fallback table instead of the live feed
stats_as_ofstringVintage date of the annual supply / reserve statistics
updated_atstringISO 8601 timestamp of the response

Query parameters

ParameterTypeDefaultDescription
currency string USD ISO 4217 currency code to convert the XAU price into. See supported currencies below.
unit string oz Weight unit for xau.price. One of: oz · gram · kg
USDEURGBP AUDCADCHF JPYCNYINR SGDHKDKRW AEDSARTRY BRLMXNZAR NZDSEKNOK DKKPLN

History & reserves

GET /api/v1/history, up to 5 years of daily XAU/USD candles plus computed statistics. Cached 6 hours.

JSON, GET /api/v1/history (truncated)
{
  "symbol": "XAUUSD",
  "interval": "daily",
  "points": [ { "d": "2026-07-01", "c": 4007.20, "h": 4021.10, "l": 3988.60 },  ],
  "high_52w": 4381.50,
  "low_52w":  3312.40,
  "ranges": {              // true high/low per trailing window
    "day":   { "low": 3988.60, "high": 4021.10 },
    "week":  {  }, "month": {  }, "year": {  }
  },
  "return_ytd_pct": 12.4,   // vs last close of previous year
  "return_1y_pct":  35.3    // vs close ~365 days ago
}

GET /api/v1/reserves, central-bank gold holdings by country (119 countries), as shown on the reserves page.

GET /api/v1/intraday, XAUS's own recorded price series: the live gold-api quote sampled every 2 minutes by our infrastructure (gold and silver). Params: ?symbol=xau|xag, ?hours=1..48 (default 24). Returns points of {t, p} with a data_state block and coverage_seconds so consumers can judge series warmth. Retention: 14 days.

Error responses

All errors return JSON with an error field. There is currently no hard rate limit, see fair use below.

StatusWhenExample
400Unsupported currency, response includes the full supported list{"error":"Unsupported currency: XYZ","supported":["USD","EUR",…]}
400Unsupported unit{"error":"Unsupported unit: lb. Valid values: oz, gram, kg"}
405Any method other than GET / OPTIONS{"error":"Method not allowed"}
503Upstream price source down with no cached price yet, retry shortly. If a recent real price exists, the API returns 200 with stale: true instead (never an invented price).{"error":"Upstream price source unreachable…"}

Data states & provenance

Every data group in the response is in exactly one of three states, always machine-detectable:

StateMeaningHow to detect
freshValue sourced from the live upstream on this request (or within its cache TTL)data_state.status: "fresh" · FX: fx_stale: false · group *_source names the upstream
staleLast known real value served during an upstream outage, never inventeddata_state.status: "stale" with as_of + age_seconds · FX: fx_stale: true
unavailableNo real value exists to serveGroup fields null + source "unavailable"; core gold price → HTTP 503 whose body carries data_state.status: "unavailable"

The single canonical read is the data_state object, { status, as_of, source, age_seconds }, describing the core gold price on every response, including 503s. The flat stale and price_as_of fields are retained for backward compatibility.

AI agents & automated consumers

data_state describes freshness at the moment the response was generated. If your requests pass through a caching layer you do not control (AI assistant fetchers, corporate proxies, scraper infrastructure), you can receive an old copy that still reads status: "fresh", age_seconds: 0, because it was fresh when built. Two rules make any integration stale-proof:

1. Validate updated_at yourself. Every response carries a generation timestamp. Compare it to the current time; treat anything older than a few minutes (spot, intraday) or a day (history, reserves) as a cached copy, not a live reading.

Machine-readable resources: /api/openapi.json (OpenAPI 3.1 contract for all endpoints, importable into agent frameworks and API tooling) and /llms.txt (plain-text site and API map for AI crawlers). On /api/v1/spot, pass ?compact=1 to omit the ~160-entry FX table: the response shrinks by roughly 75%, which matters when an AI agent pays per token.

2. Cache-bust when freshness is critical. Append a throwaway unique query parameter, e.g. /api/v1/spot?fresh=1720000000 (any name, any changing value). Endpoints ignore unknown parameters, but caches key on the full URL, so a unique value bypasses every intermediary layer. Use this for freshness-critical calls only; default requests should let the CDN work.

Staleness, precise semantics. A stale: true response is the most recent price actually observed from the upstream, held in server memory; price_as_of is when it was observed. Staleness is unbounded, consumers must check price_as_of and apply their own maximum-age policy. All prices, fresh or stale, are indicative mid-market reference rates provided as-is, without warranty, and are not tradable quotes; do not use them for settlement, execution, or contractual valuation. For settlement-grade rates use the LBMA benchmark.

Provenance. Each data group carries its own source attribution in the payload:

Data groupPayload attributionCadence
Gold spotprice_source · price_as_ofContinuous, cached 30 s
Silver spotsilver_sourceContinuous, per request
FX ratesfx_source · fx_staleCached 12 h; static table fallback flagged fx_stale: true
Crypto & tokenized goldtoken_sourceCached 60 s
Supply & reserve statisticsstats_as_ofAnnual (WGC / USGS figures); vintage date in payload

Operational behaviour

PropertyValue
Debug mode?debug=1 appends a debug object: server uptime and per-cache ages in seconds (price_age_s, fx_cache_age_s, token_cache_age_s). Read-only; no secrets.
Update frequencySpot: continuous upstream, cached 30 s (browser) / 30 s (CDN). History: cached 6 h.
TimestampsISO 8601, UTC. updated_at = response time; price_as_of = when the price was sourced (differs only when stale).
Precision2 decimals for oz prices, 4 for gram, 2 for kg. Ratios: 2–4 decimals as documented per field.
Stalenessstale: true appears when serving the last known real price during an upstream outage. Prices are never simulated.
CORSFully open (Access-Control-Allow-Origin: *), callable from browser JavaScript.
Compressiongzip / brotli via CDN content negotiation.
VersioningVersioned path (/v1/). Changes within v1 are additive only, new fields may appear; existing fields are never renamed or removed. Breaking changes get a new version path and a changelog entry.
OpenAPIopenapi.json, OpenAPI 3.1, suitable for client generation.

One feed, every channel

This API is the engine behind every XAUS surface, use it directly, or ship the same data through the channels below.

Embeddable price modules for any website. One iframe tag, zero dependencies. Explore widgets →
Bots, in development
Telegram and Discord bots serving live prices and alerts inside communities.
AI, in development
Structured gold data surfaces built for LLM tools, assistants and agents.

API changelog

VersionDateChanges
Platform2026-07Launched: Gold data widgets, embeddable live price, historical chart and converter modules at /widgets/price, /widgets/chart and /widgets/converter (dark/light themes, multi-currency), powered by this API. See /widgets/.
v1.52026-07Added: AI-consumer optimizations: ?compact=1 on /spot (omits the FX table), /api/openapi.json machine-readable spec, /llms.txt AI-crawler map, /api/v1/intraday first-party recorded series, and documented freshness-validation rules for automated consumers.
v1.42026-07Added: canonical data_state object (status / as_of / source / age_seconds) on every response including 503; removes any need to infer state from multiple fields. stale and price_as_of retained for backward compatibility.
v1.32026-07Added: formal data-state contract (fresh / stale / unavailable); fx_stale flag; stats_as_of vintage for annual statistics; ?debug=1 observability mode. No breaking changes.
v1.22026-07Changed: outage behaviour, the API now serves the last known real price with stale: true and price_as_of, or an honest 503; simulated fallback prices removed. Added: stale, price_as_of fields.
v1.12026-07Added: silver spot & gold/silver ratio; tokenized-gold prices & ratios (XAUT, PAXG); Bitcoin-vs-gold fields; gold market cap, supply & central-bank reserve stats. History: daily high/low per point, ranges, YTD & 1-year returns; price history source migrated to Yahoo Finance.
v1.02025Initial release, live XAU spot with currency & unit conversion, daily history, central-bank reserves.

Rate limits & fair use

No API key required. The API is free for reasonable use, dashboards, widgets, personal projects, and open-source tools. Please cache responses for at least 30 seconds on your end. For high-volume commercial use (>10,000 req/day), contact hello@xaus.com.

CORS is fully open, you can call this API directly from browser JavaScript. Prices are indicative mid-market rates, not tradable quotes. For settlement-grade rates refer to the LBMA benchmark.