Menu

Historical gold price API reference

Get daily or intraday gold prices (open, high, low, close, and volume where available) for a date range. Daily XAU/USD goes back to 1996 on Plus and Pro. Bars use cursor pagination and carry an is_closed label. Free covers the last 30 days and Basic one year.

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-11-23&to=2026-11-29&limit=7"

The dates are the last seven days. The page moves them to today's date when it loads, so they stay inside the Free tier's 30-day window; keep from within the last 30 days in your own calls. 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, HG, XPT and XPD spot, XAU-CNY-SGE, live futures barsNone
BasicMost recent yearXAG, HG, XPT and XPD spot, XAU-CNY-SGE, live futures barsNone
PlusFull daily history to 1996XAG, HG, XPT and XPD spot, XAU-CNY-SGE, live futures bars1h and 4h, last 30 days
ProFull daily history to 1996XAG, HG, XPT and XPD spot, XAU-CNY-SGE, live futures bars1m to 4h, full depth

Deep intraday files begin in 2006. /v1/download is Basic+: last year on Basic, every year on Plus and Pro. Live futures bars (XAU-COMEX-MAIN, XAG-COMEX-MAIN, HG-COMEX-MAIN, XPT-NYMEX-MAIN and XPD-NYMEX-MAIN, or one month as XAU-COMEX-2027-02) are on every plan. 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" },
  "delayed_minutes": 15
}

is_closed: false identifies the currently forming bar, so a backtest can exclude provisional data. Spot volume is null because there is no consolidated XAU spot exchange. Live futures bars are on every plan, with venue volume when available; ETF bars are Legacy plans only.

Cursor pagination

Results arrive newest first. When next_cursor is not null, pass it unchanged as the next request's cursor. 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-11-01",
  to: "2026-11-29",
  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 the gold 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. Live futures bars, such as XAU-COMEX-MAIN, are on every plan, with venue volume when available. ETF bars are Legacy plans only.
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