goldprice.dev — historical + charting
Daily OHLC history for one symbol. A 30-day chart works on the Free tier (free key, no card).
Pull the series
curl -H "Authorization: Bearer ga_live_..." \
"https://api.goldprice.dev/v1/prices/history?symbol=XAU-USD-SPOT&from=2026-01-01&to=2026-04-21&interval=1d"
Response — bars live under series[], newest-first, values are strings, volume may be null:
{"symbol":"XAU-USD-SPOT","interval":"1d","from":"2026-06-25","to":"2026-07-01",
"series":[
{"date":"2026-07-01","open":"4005.934","high":"4114.62","low":"3960.411","close":"4035.198","volume":null,"is_stale":false,"is_closed":true},
{"date":"2026-06-30","open":"4014.52","high":"4063.211","low":"3945.943","close":"4005.952","volume":null,"is_stale":false,"is_closed":true}
],
"meta":{"tier":"free","count":6}}
MCP equivalent: get_historical(symbol, from_date, to_date, limit).
History depth is capped by tier — design for it
| Tier | Window | Notes |
|---|---|---|
| Free | last 30 days | enough to prove a chart |
| Physical ($10) | last 1 year (rolling) | |
| Pro ($30) | full | XAU daily to 1996 (30 years); intraday bars from 2006 |
Request a from older than your tier allows and the API returns a plan_gated error (not a truncated series) — clamp from to the tier window, or catch the error and prompt an upgrade:
{"error":"plan_gated","tier":"free","message":"tier 'free' can request history from 2026-06-07 onward; Pro unlocks full history back to 1996-01-01.","upgrade_url":"https://goldprice.dev/pricing"}
Building the chart
There is no server-side CSV/download endpoint. Read series[], reverse it if your chart wants oldest-first (it arrives newest-first), cast the string OHLC values to numbers, then hand it to your chart library (Recharts, Chart.js, lightweight-charts, etc.). Derive CSV client-side if you need an export.
When to upgrade
Deeper than 30 days → Physical (1yr) or Pro (30yr). Silver/copper history (XAG-USD-SPOT, HG-USD-FUTURES) → Pro. Backtesting across decades → Pro's full 1996+ daily.