Silver Price API
A REST API for live and historical silver prices, quoted in US dollars per troy ounce. Spot updates continuously, and the history endpoint returns 14,488 daily bars going back to October 1966. JSON over HTTPS, authenticated with a bearer token, no SDK required.
Get the live silver price
curl -H "Authorization: Bearer mc_live_YOUR_KEY" \ "https://api.metalcharts.org/v1/prices"
Every tracked metal comes back in one response, so a dashboard showing several does not need several requests. The silver entry looks like this:
{
"success": true,
"data": {
"XAG": {
"symbol": "XAG",
"price": 4380.04,
"change24h": 2.87,
"changePercent24h": 0.0655,
"high24h": 4380.25,
"low24h": 4377.84,
"exchange": "SPOT",
"timestamp": "2026-09-19T18:58:27.856Z"
}
}
}Spot prices are on the free tier. You need an account and a key, but not a card.
Code examples
Each example fetches the live silver price and prints it. There is no SDK to install: the API is plain HTTPS returning JSON, so whatever HTTP client you already use will do.
Silver price 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"]["XAG"]["price"]
print(f"Silver: ${price}")Uses requests. raise_for_status turns a 401 or 429 into an exception rather than letting a bad payload through.
Silver price 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(`Silver: ${data.XAG.price}`);Native fetch, so it runs in Node 18 and above and in the browser. Never ship a key to the browser; proxy through your own server.
Silver price 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 "Silver: " . $data["data"]["XAG"]["price"];Plain cURL with no dependencies. Checking the status code matters because a failed call still returns a parseable body.
Silver price 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("Silver:", out.Data["XAG"].Price)Decoding into a narrow struct rather than a map keeps the compiler honest about the field you actually use.
Replace mc_live_YOUR_KEY with a key from the API console. The free tier needs an account but not a card.
Historical silver prices
curl -H "Authorization: Bearer mc_live_YOUR_KEY" \ "https://api.metalcharts.org/v1/history/XAG?range=1Y&interval=1d"
14,488 daily bars are available, the oldest dated 1966-10-02. 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.
History depth is what separates the plans. Basic reaches back 1 year, Pro five, and Ultimate returns the full series.
The symbol is XAG. Passing the metal's name instead returns a 400, which is the single most common mistake on first use.
Endpoints carrying silver
| Endpoint | Returns | Plan |
|---|---|---|
| /v1/prices | Live spot price, bid, ask, 24h change, high and low | Free |
| /v1/history/{symbol} | Daily, weekly and monthly candles, plus 15m to 8h intraday | Basic |
| /v1/ath/{symbol} | All-time high and the date it was set | Basic |
| /v1/instruments | Which symbol each endpoint expects | Free |
Silver moves further and faster than gold, so intraday resolution matters more. The history endpoint serves 15-minute through 8-hour candles as well as daily, which is usually what a silver chart actually needs.
Beyond price, silver also appears in:
| Endpoint | Returns | Plan |
|---|---|---|
| /v1/comex/inventory?symbol=XAG | COMEX registered and eligible silver stocks | Pro |
| /v1/lbma/vault?metal=silver | LBMA London vault holdings | Pro |
| /v1/sge/benchmark?metal=silver | Shanghai benchmark fixings | Pro |
| /v1/shfe/inventory?symbol=ag | Shanghai Futures Exchange warehouse stocks | Pro |
| /v1/cot?metal=XAG | CFTC positioning | Pro |
Plans
Rate limiting is by weight per minute, not a monthly request quota. Most endpoints cost 1 weight and history costs 2. Free is capped at 1,000 weight a month; no paid plan has a monthly ceiling.
Compare plansSilver API questions
How far back does the silver price history go?
14,488 daily bars from October 1966. Silver actually has marginally more history than gold in the series we serve.
Can I get the gold to silver ratio from the API?
There is no ratio endpoint. Pull both spot prices from a single /v1/prices call and divide, which costs one request rather than two and leaves you in control of rounding.
What intraday intervals are available for silver?
15m, 30m, 45m, 1h, 2h, 4h and 8h, plus 1d, 1w and 1M. Pass interval on /v1/history/XAG. Intraday reads the interval candle tables directly rather than downsampling daily bars.
What symbol do I use for silver?
XAG, in the standard ISO form. SILVER belongs to the 24/7 markets endpoint and is not valid on /v1/history.
Other metals
- Gold Price API — 14,425 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