Gold price line chart showing XAU/USD spot price data from a gold price API

Blog ·

Gold Price API: Live and Historical XAU/USD Data for Developers

Gold is one of the most requested assets in finance apps. A gold price API provides the spot price of gold in US dollars (XAU/USD) and often other metals such as silver (XAG/USD) and gold in euros (XAU/EUR). Typical uses are investment dashboards, jewellery and bullion pricing, savings apps and tokenized gold.

Live gold price (XAU/USD)

curl -H "Authorization: Bearer $API_KEY" "https://api.marketapi.app/v1/prices/latest?symbols=XAUUSD,XAGUSD"

The spot price is quoted per troy ounce. Bid and ask are both returned, so you can show a buy and a sell price or use the mid.

Historical gold prices

curl -H "Authorization: Bearer $API_KEY" "https://api.marketapi.app/v1/bars?symbol=XAUUSD&timeframe=D1&from=2024-01-01T00:00:00Z&to=2026-01-01T00:00:00Z"

Daily candles over several years are ideal for charts and performance reports; intraday timeframes such as M5 or H1 suit trading analysis.

Converting to grams and other currencies

  • 1 troy ounce = 31.1034768 grams: divide the ounce price by this to get the price per gram.
  • For gold in euros, request XAUEUR directly, or combine XAUUSD with EURUSD.

Gold prices on the blockchain

Gold-backed tokens need a verifiable reference price. Our on-chain price oracle signs prices that smart contracts can verify.

FAQ

How often does the gold price update?

Continuously during market hours; actively watched symbols refresh about every second.

Is silver available?

Gold price use cases

  • Bullion and jewellery shops update product prices from the spot price plus a margin.
  • Savings and investment apps show the value of gold holdings in real time.
  • Financial reports chart gold against inflation or stock indices using daily history.
  • Tokenized gold needs a verifiable reference price on-chain.

Spot price versus retail price

The spot price is the wholesale market price for one troy ounce. Coins and bars sell at a premium that covers minting and distribution, so retail prices are higher. Apps usually display spot and apply their own premium. Use the bid when valuing what a customer could sell, and the ask when quoting what they would pay.

Does gold trade at weekends?

No. The last price stays available with the market-closed status until trading resumes on Sunday evening (UTC).

Yes, XAGUSD, plus other metals listed in the ticker list. Start with free credits.

Try the market price API

1000 free credits after sign-up.

Get a free API key

More articles