Docs / Historical gold prices

Historical Gold Price API

Gold OHLCV bars with cursor pagination, settled-bar labels, and history windows. Daily XAU/USD reaches 1996 on Plus and 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-10-08&to=2026-10-14&limit=7"

This example rolls forward daily, so it stays inside the Free tier's 30-day window. Open the live JSON response.

The anonymous request above is useful for a first proof. A free key identifies your integration, includes 5,000 calls per month, and includes authenticated-only options such as include=stats.

Create a free API key →

History windows by plan

PlanDaily XAU/USDOther symbolsIntraday bars
FreeMost recent 30 daysXAG and HG spotNone
BasicMost recent yearXAG and HG spotNone
PlusFull daily history to 1996XAG and HG spot1h and 4h, last 30 days
ProFull daily history to 1996XAG and HG spot1m to 4h, full depth

Deep intraday files begin in 2006. /v1/download is Basic+: last year on Basic, every year on Plus and Pro. Futures and ETF/GLD bars are Legacy plans only. See pricing for plan details.

Intervals, coverage, and missing bars

The bars API accepts 1m, 5m, 15m,30m, 1h, 2h, 4h, and 1d. Availability still depends on the symbol, plan, requested window, and the underlying market history. Retention is not the same as accumulated history.

A bar represents the observations available for its window. An open bar has is_closed: false; a missing or incomplete source window is not evidence that the market traded at zero. Check the returned rows and timestamps before filling gaps in an analysis. Spot instruments return volume: null because there is no consolidated spot exchange volume.

Use pricing for current access and the bars reference for request fields and error responses.

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_2026", "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/ETF bars: Legacy plans only, with venue volume when available.

Cursor pagination

Results arrive newest first. When next_cursor is 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-09-16",
  to: "2026-10-14",
  limit: "7",
}).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 with the same 1m, 5m, 15m, 30m, 1h, 2h, 4h, and 1d interval names. For offline research, /v1/download returns a redirect to a time-limited archive file for one symbol, interval, and calendar year: Parquet by default or CSV when requested.

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?
Plus and Pro include daily XAU/USD history back to 1996. Plus has 1h and 4h bars for the last 30 days; Pro has 1m to 4h bars at full depth. Deep intraday files begin in 2006.
Does gold spot history include volume?
No. XAU/USD spot bars return null volume: there is no consolidated exchange volume. Futures/ETF bars are Legacy plans only, with 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