Docs / Historical gold prices

Historical Gold Price API

Query real OHLCV bars for gold with cursor pagination, settled-bar labels, and explicit history windows. Daily XAU/USD data reaches back to 1996 on Pro.

Use /v1/bars for new integrations

GET/v1/barsBearer optional · Free+

The bars endpoint replaces the deprecated/v1/prices/history route. It returns open, high, low, close, volume, and is_closed for each interval.

curl "https://api.goldprice.dev/v1/bars?symbol=XAU-USD-SPOT&interval=1d&from=2026-07-01&to=2026-07-15&limit=100"

History windows by plan

PlanDaily XAU/USDOther symbolsIntraday bars
FreeMost recent 30 daysNot includedNot included
PhysicalMost recent yearNot includedNot included
Pro+Full daily history to 1996XAG, GLD, GC, SI, and HGMost recent 30 days through /v1/bars

Deep intraday files begin in 2006. Request them by symbol, interval, and year through /v1/download instead of the live bars endpoint. See pricing for current plan details.

Response and settled bars

The values below are illustrative sample data.

{
  "symbol": "XAU-USD-SPOT",
  "interval": "1d",
  "bars": [
    {
      "bar_start": "2026-07-15T00:00:00Z",
      "open": "3327.12",
      "high": "3354.81",
      "low": "3312.44",
      "close": "3348.65",
      "volume": null,
      "is_closed": true
    }
  ],
  "next_cursor": "MjAyNi0wNy0xNVQwMDowMDowMFo",
  "meta": { "tier": "free", "count": 1, "source_id": "mixed" }
}

is_closed: false identifies the currently forming bar, so a backtest can exclude provisional data. Spot volume isnull because there is no consolidated XAU spot exchange; futures and ETF instruments return real volume when available.

Cursor pagination

Results arrive newest first. When next_cursoris not null, pass it unchanged as the next request'scursor. A null cursor means the requested range is exhausted.

const url = new URL("https://api.goldprice.dev/v1/bars");
url.search = new URLSearchParams({
  symbol: "XAU-USD-SPOT",
  interval: "1d",
  from: "2026-06-01",
  to: "2026-07-15",
  limit: "100",
}).toString();

let cursor;
do {
  if (cursor) url.searchParams.set("cursor", cursor);
  const page = await fetch(url).then((response) => response.json());
  consume(page.bars.filter((bar) => bar.is_closed));
  cursor = page.next_cursor;
} while (cursor);

MCP and bulk download

Agent clients can use get_historical through thegold price MCP server. For offline research, /v1/download returns a redirect to a time-limited CSV or Parquet file for one symbol, interval, and calendar year.

FAQ

How much historical gold data is available for free?
The Free tier can query the most recent 30 days of daily XAU/USD spot bars through GET /v1/bars.
How far back does the historical gold price API go?
Pro unlocks daily XAU/USD history back to 1996. Deep intraday files begin in 2006 and are available through the bulk download endpoint; the live bars endpoint limits intraday queries to the most recent 30 days.
Does gold spot history include volume?
No. Spot gold has no consolidated exchange volume, so XAU/USD spot bars return volume as null. Futures and ETF bars return real venue volume when available.
Should new integrations use /v1/prices/history?
No. /v1/prices/history is deprecated. New integrations should use /v1/bars, which adds real OHLCV fields, cursor pagination, and the is_closed settlement label.

See also