Gold Price API live and historical, as JSON
Live and historical gold prices quoted in US dollars per troy ounce. The history endpoint returns 14,425 daily bars back to October 1966. Plain HTTPS with a bearer token, no SDK required.
- Live gold spot with bid, ask and 24-hour change on every plan, Free included
- History from Starter ($9 a month), daily and intraday
- Request it as XAU on /v1/prices and /v1/history/XAU
{
"success": true,
"data": {
"XAU": {
"symbol": "XAU",
"price": 4286.23637,
"bid": 4271.2345427049995,
"ask": 4301.238197295,
"change24h": -0.50336,
"changePercent24h": -0.0117,
"high24h": 4286.4489,
"low24h": 4284.85731,
"timestamp": "2026-09-26T18:12:50.484Z",
"exchange": "SPOT",
"marketType": "spot",
"stale": false
}
}
}14,425
Daily gold bars
1966
First daily bar
XAU
Symbol to request
200
Free requests a month, no card
Live price
Get the live gold price
Gold price API in cURL
curl -H "Authorization: Bearer mc_live_YOUR_KEY" \
"https://api.metalcharts.org/v1/prices"Every tracked metal comes back in one response; gold is under data.XAU.
Gold price API in Python
import requests
res = requests.get(
"https://api.metalcharts.org/v1/prices",
headers={"Authorization": "Bearer mc_live_YOUR_KEY"},
timeout=10,
)
res.raise_for_status()
price = res.json()["data"]["XAU"]["price"]
print(f"Gold: ${price}")Uses requests. raise_for_status turns a 401 or 429 into an exception rather than letting a bad payload through.
Gold price API in JavaScript
const res = await fetch(
"https://api.metalcharts.org/v1/prices",
{ headers: { Authorization: "Bearer mc_live_YOUR_KEY" } },
);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const { data } = await res.json();
console.log(`Gold: ${data.XAU.price}`);Native fetch, so it runs in Node 18 and above. Keep the key on your server; proxy browser requests through it.
Gold price API in PHP
<?php
$ch = curl_init("https://api.metalcharts.org/v1/prices");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer mc_live_YOUR_KEY"],
CURLOPT_TIMEOUT => 10,
]);
$body = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($code !== 200) {
throw new RuntimeException("MetalCharts API returned $code");
}
$data = json_decode($body, true);
echo "Gold: " . $data["data"]["XAU"]["price"];Plain cURL with no dependencies. Check the status code, because a failed call still returns a parseable body.
Gold price API in Go
req, _ := http.NewRequest(
http.MethodGet, "https://api.metalcharts.org/v1/prices", nil,
)
req.Header.Set("Authorization", "Bearer mc_live_YOUR_KEY")
resp, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
var out struct {
Data map[string]struct {
Price float64 `json:"price"`
} `json:"data"`
}
if err := json.NewDecoder(resp.Body).Decode(&out); err != nil {
return err
}
fmt.Println("Gold:", out.Data["XAU"].Price)Decoding into a narrow struct keeps the compiler honest about the field you actually use.
History
Historical gold price API
curl -H "Authorization: Bearer mc_live_YOUR_KEY" \
"https://api.metalcharts.org/v1/history/XAU?range=1Y&interval=1d"Set the window with range or explicit start and end dates, and the candle size with interval: 15m, 30m, 45m, 1h, 2h, 4h, 8h, 1d, 1w or 1M. Each point carries open, high, low, close and volume, so it drives a candlestick chart directly. A history call costs 2 weight.
History depth is what separates the plans. Starter ($9 a month) reaches back 1 year, Basic ($29) reaches back 1 year, Pro ($99) reaches back 5 years, and Ultimate ($249) returns the full series.
The symbol is XAU. Passing the metal's name instead returns a 400, the most common mistake on first use.
Endpoints
Endpoints carrying gold
| Endpoint | Returns | From |
|---|---|---|
| GET/v1/prices | Live spot price, 24h change, high and low, plus an indicative bid and ask | Free |
| GET/v1/history/{symbol} | Daily, weekly and monthly candles, plus 15m to 8h intraday | Starter |
| GET/v1/ath/{symbol} | All-time high and the date it was set | Starter |
| GET/v1/instruments | Which symbol each endpoint expects | Free |
Beyond price, gold also appears in
| Endpoint | Returns | From |
|---|---|---|
| GET/v1/comex/inventory?symbol=XAU | COMEX registered and eligible warehouse stocks | Pro |
| GET/v1/comex/delivery-notices?symbol=XAU | Daily delivery notices by firm, with month and year to date totals | Pro |
| GET/v1/lbma/vault?metal=gold | LBMA London vault holdings | Pro |
| GET/v1/sge/benchmark?metal=gold | Shanghai Gold Exchange benchmark fixings | Pro |
| GET/v1/cot?metal=XAU | CFTC Commitments of Traders positioning | Pro |
Plans and limits
What each plan allows
| Plan | Per minuteweight, per API key | Per monthweight, all keys combined | API keys | History |
|---|---|---|---|---|
| Free$0 | 10 | 200200 spot calls | 1 | Live spot only |
| Starter$9/mo | 20 | 10,00010,000 spot calls or 5,000 history calls | 2 | 1 year |
| Basic$29/mo | 30 | 250,000250,000 spot calls or 125,000 history calls | 3 | 1 year |
| Pro$99/mo | 200 | No monthly cap | 10 | 5 years |
| Ultimate$249/mo | 1,000 | No monthly cap | 25 | Full, back to 1966 |
FAQ
Gold API questions
How far back does the gold price history go?
Is the gold price spot or futures?
Can I get gold prices in another currency?
What symbol do I use for gold?
More metals
Other metals, same API
- Silver Price API (14,488 daily bars)
- Platinum Price API (5,798 daily bars)
- Palladium Price API (5,799 daily bars)
- Copper Price API (9,776 daily bars)
- All metals, one API