Silver Price API: Live and Historical XAG Prices in JSON
Use a silver price API to get live and historical XAG prices per ounce, gram or kilogram in 57 currencies, with code examples, caching tips and real use cases.
What a silver price API gives you
A silver price API returns the current and historical price of silver as structured data, usually JSON over HTTPS, so a shop, an app or a report can use it without copying numbers from a website. In MetalAPI, silver has the symbol XAG, the ISO 4217 code for one troy ounce of silver. Its live value is the spot price: the midpoint between the bid and ask quotes of the wholesale market.
Silver shares an API with gold, but it has habits of its own. It is quoted per troy ounce yet bought and sold in grams and kilograms, its price per gram is small enough that rounding matters, and buyers of silverware and scrap think in fineness rather than karats. This guide covers the requests and the details that are specific to silver:
- The live silver price in one request, and how to read it.
- Silver prices per ounce, gram and kilogram.
- Silver in other currencies, still from a single request.
- Historical silver prices back to 2000.
- Use cases: bullion shops, silverware and scrap buyers, and investing apps.
How to get the live silver price via API
Create a free account and add an API key in the dashboard. Keys start with mk_live_. Keep yours in an environment variable and send it in a header, then request /latest with XAG:
export METALAPI_KEY="mk_live_your_key_here"
curl "https://metalapi.com/api/v1/latest?base=USD¤cies=XAG" \
-H "X-API-Key: $METALAPI_KEY"The response looks like this. The numbers are the example values used throughout the MetalAPI documentation, not live prices:
{
"success": true,
"timestamp": 1792713600,
"date": "2026-10-23",
"base": "USD",
"rates": {
"XAG": 0.01853911754,
"USDXAG": 53.94
}
}USDXAG is the price of one troy ounce of silver in the base currency, 53.94 US dollars in this example. XAG is the inverse, troy ounces of silver per dollar, kept for compatibility with forex-style APIs. Always read the prefixed key: treating rates.XAG as the price would show 0.0185 instead of 53.94.
timestamp is the time of the data, not of your request. Spot silver trades around the clock on weekdays and pauses from Friday 17:00 to Sunday 17:00 New York time, so over the weekend the API keeps returning Friday's closing price. Show the timestamp next to the price, especially on Saturdays and Sundays.
If you also need gold, platinum or palladium, add them to the same request: currencies=XAU,XAG,XPT,XPD. A request counts once, however many symbols it returns.
Silver price per ounce, gram and kilogram
Silver prices are per troy ounce, 31.1034768 grams, unless you pass unit. Supported values are troy_oz (the default), gram, kilogram, ounce, pound, metric_ton and short_ton, and the response adds a top-level unit field whenever the unit isn't the default:
curl "https://metalapi.com/api/v1/latest?currencies=XAG&unit=kilogram" \
-H "X-API-Key: $METALAPI_KEY"At the example price of 53.94 dollars per troy ounce, silver costs:
| Price per | USD | Typical use |
|---|---|---|
| Troy ounce (31.1035 g) | 53.94 | Spot quotes, coins and rounds |
| Gram | 1.7342 | Jewelry, silverware, scrap |
| Kilogram | 1,734.21 | Kilo bars, wholesale, prices in India |
| Tola (11.6638 g) | 20.23 | South Asia and the Gulf |
| Avoirdupois ounce | 49.16 | Almost never right for silver |
unit=ounce, and its short form oz, is the avoirdupois ounce of 28.35 grams. A silver price per troy ounce is about 9.7% higher than a price per avoirdupois ounce. For spot quotes, leave unit out or pass troy_oz.
Two habits are worth adopting for silver. First, show more decimals per gram: at 1.7342 dollars, two decimals hide most of the day-to-day movement, so four are common. Second, if you display several units, request troy ounces once and convert locally instead of making one request per unit. The factors are exact:
const GRAMS_PER_TROY_OZ = 31.1034768;
const res = await fetch("https://metalapi.com/api/v1/latest?currencies=XAG", {
headers: { "X-API-Key": process.env.METALAPI_KEY },
signal: AbortSignal.timeout(10_000),
});
const data = await res.json();
if (!data.success) throw new Error(`MetalAPI ${data.error.code} (${data.error.type}): ${data.error.info}`);
const perOz = data.rates[`${data.base}XAG`]; // 53.94 in the docs' example
const perGram = perOz / GRAMS_PER_TROY_OZ; // 1.7342...
const perKg = perGram * 1000; // 1734.21...
console.log({ perOz, perGram: perGram.toFixed(4), perKg: perKg.toFixed(2) });Troy ounces, grams and kilograms lists every factor, including the pennyweight, and the rounding rules for invoices.
Silver prices in other currencies
Set base to price silver in another currency: base=EUR returns EURXAG, base=INR returns INRXAG. Combined with unit, this request returns euros per gram:
curl "https://metalapi.com/api/v1/latest?base=EUR¤cies=XAG&unit=gram" \
-H "X-API-Key: $METALAPI_KEY"{
"success": true,
"timestamp": 1792765800,
"date": "2026-10-23",
"base": "EUR",
"unit": "gram",
"rates": {
"XAG": 0.6713138244,
"EURXAG": 1.489616277
}
}To show silver in several currencies, one request is still enough. Ask for silver and the currencies with base USD, then divide: silver in euros is USDXAG ÷ USDEUR, because USDEUR is the price of one euro in dollars. All values come from the same snapshot, so the result matches what base=EUR returns. With the documentation's example rate of 1.1642 dollars per euro, 53.94 ÷ 1.1642 gives 46.33 euros per troy ounce, or 1.4896 euros per gram, the same as above:
import os
import requests
GRAMS_PER_TROY_OZ = 31.1034768
CURRENCIES = ["EUR", "GBP", "INR", "TRY"]
resp = requests.get(
"https://metalapi.com/api/v1/latest",
params={"base": "USD", "currencies": ",".join(["XAG", *CURRENCIES])},
headers={"X-API-Key": os.environ["METALAPI_KEY"]},
timeout=10,
)
data = resp.json()
if not data["success"]:
err = data["error"]
raise RuntimeError(f"MetalAPI {err['code']} ({err['type']}): {err['info']}")
rates = data["rates"]
silver_usd = rates["USDXAG"]
for cur in ["USD", *CURRENCIES]:
per_oz = silver_usd if cur == "USD" else silver_usd / rates["USD" + cur]
print(f"{cur}: {per_oz:,.2f} per troy oz, {per_oz / GRAMS_PER_TROY_OZ:,.4f} per gram")Any of the 57 supported currencies works this way, and so do gold, platinum and palladium, so a single call can feed a whole price board. In India, where silver is usually quoted per kilogram, base=INR&unit=kilogram gives the familiar figure directly.
Historical silver prices via API
Silver history starts in 2000 and uses the same parameters and response format as the live price. Each day's values are that day's closing prices, with dates in UTC. Four endpoints cover most needs:
/YYYY-MM-DD,/historical?date=or/yesterday: the close of one day. For a weekend or holiday, the most recent trading day's close is returned./timeframe: daily closes betweenstart_dateandend_date, up to 30 days per request on Free and 365 days on paid plans./change: start price, end price, absolute and percentage change between two dates./ohlc: open, high, low and close of one day.
# Silver at the close of 15 January 2024 (USDXAG 23.162 in the docs' example)
curl "https://metalapi.com/api/v1/2024-01-15?currencies=XAG" \
-H "X-API-Key: $METALAPI_KEY"
# Daily silver closes in euros per gram for September 2026
curl "https://metalapi.com/api/v1/timeframe?start_date=2026-09-01&end_date=2026-09-30&base=EUR¤cies=XAG&unit=gram" \
-H "X-API-Key: $METALAPI_KEY"
# What 500 grams of silver were worth in euros at the close of 1 October 2026
curl "https://metalapi.com/api/v1/convert?from=XAG&to=EUR&amount=500&unit=gram&date=2026-10-01" \
-H "X-API-Key: $METALAPI_KEY"Closing prices of past days never change, so store them instead of requesting them again. With a paid plan's 365-day limit, a complete backfill since 2000 takes one /timeframe request per year. Keep in mind that metal prices before October 2026 are derived from front-month futures, so they can differ slightly from spot on the same day.
Historical gold and silver prices via API has a complete backfill script, storage and validation tips, and a chart of gold together with the gold/silver ratio.
Silver price API use cases
Bullion shops and coin dealers. Dealers sell above spot and buy back below it. A typical selling price is the spot price per troy ounce times the fine silver content, plus a product premium, plus a fixed fee per item. Store the premium per product, refresh spot at your plan's update interval, and show customers when the price was last updated. On the Standard plan and above, add XAG-BID and XAG-ASK to currencies to quote both sides from the market's own spread. Spot, bid and ask explained shows how dealers turn these numbers into buy and sell quotes.
Silverware, jewelry and scrap buyers. Silver objects are priced by weight and fineness, the share of pure silver in thousandths. Common grades are 999 (fine silver), 958 (Britannia), 925 (sterling) and 800, which is found in older continental European silverware. The melt value is the weight in grams × the fineness × the price per gram. At the example price of 1.7342 dollars per gram, a 500-gram sterling tray contains 462.5 grams of silver worth about 802.07 dollars. Scrap buyers pay a percentage of melt value, so make that percentage a setting rather than a constant.
MetalAPI's karat endpoint, /carat, covers gold only, so silver fineness is a calculation on your side:
const GRAMS_PER_TROY_OZ = 31.1034768;
/** Melt value of a silver item: weight in grams × fineness (e.g. 0.925) × price per gram. */
export function meltValue(grams, fineness, pricePerTroyOz) {
return grams * fineness * (pricePerTroyOz / GRAMS_PER_TROY_OZ);
}
meltValue(500, 0.925, 53.94); // 802.07… sterling tray at the example price
meltValue(1000, 0.999, 53.94); // 1732.48… one-kilogram bar of 999 silverInvesting and portfolio apps. Users hold coins, rounds and kilo bars and want their value in their own currency. Store holdings in troy ounces internally, convert the input unit once, and value the portfolio with the user's currency as base. /change returns the percentage move between two dates for lines like “silver this month”, and stored daily closes from /timeframe drive the charts.
Price alerts. If you only need to react when silver crosses a level, price alerts can watch XAG in any currency and notify you by email from the Lite plan, or by signed webhook from the Advanced plan, with no polling on your side.
Freshness, quotas and plans
How fresh the silver price is depends on the plan. Polling faster than your plan's update interval only returns the same numbers again:
| Plan | Price / month | Requests / month | Price updates |
|---|---|---|---|
| Free | $0 | 100 | Daily |
| Lite | $4.99 | 1,000 | Every 30 minutes |
| Standard | $11.99 | 10,000 | Every 10 minutes, plus bid/ask |
| Advanced | $24.99 | 50,000 | Every minute |
| Pro | $49.99 | 100,000 | Every minute, plus realtime stream |
| Ultra and Business | $99.99 and $149.99 | 500,000 | Every 15 seconds |
| Enterprise | $299.99 | 1,500,000 | Every 5 seconds |
- Cache for at least your update interval. On Free, one request a day is enough for current prices.
- Request every metal in one call.
currencies=XAU,XAG,XPT,XPDcosts one request; four separate calls cost four. - Keep the key on the server. Serve cached prices to your pages instead of calling the API from every visitor's browser.
- Check usage for free.
/usageand/symbolsnever count towards the quota, and every response carries arate_limitblock.
Ready to build? Create a free account to get an API key in a minute, with no credit card needed. Compare update intervals and quotas on the pricing page, and use the API docs as the reference for every endpoint and parameter.
FAQ
What is the symbol for silver in a price API?
XAG, the ISO 4217 code for one troy ounce of silver. In MetalAPI, the price of silver in your base currency is the key that joins the two codes, such as USDXAG for dollars per ounce or EURXAG for euros per ounce.
Is there a free silver price API?
Yes. MetalAPI's Free plan includes silver, every other symbol and the full history, with 100 requests per month and daily price updates, and it needs no credit card. Paid plans start at $4.99 a month for 30-minute updates and 1,000 requests.
How do I get the silver price per gram?
Pass unit=gram, or divide the price per troy ounce by 31.1034768. Don't divide by 28.35: that is the avoirdupois ounce, and it overstates the gram price by about 9.7%.
How far back do historical silver prices go?
Daily silver prices are available from 2000 onwards on every plan. A single range request covers up to 30 days on Free and up to 365 days on paid plans.
Why does a dealer's silver price differ from the API price?
The API returns the spot mid price of the wholesale market. Dealers add premiums for minting, distribution and their margin when they sell, and pay less than spot when they buy back, so retail prices for coins and bars sit above spot and buy-back prices below it.
Try it with your own data
Create a free account and make your first request in under two minutes. 100 requests a month, no credit card.
Keep reading
Free Gold Price API: What 100 Requests a Month Can Do
A free gold price API, honestly explained: what MetalAPI's Free plan includes, how to stretch 100 requests a month with caching and batching, when to upgrade.
Gold Price API in Python: Fetch, Cache and Plot Prices
Use a gold price API in Python: get live gold prices with requests, handle errors and retries, cache responses, and plot a pandas time series with matplotlib.
Gold Price API in JavaScript: Node.js, TypeScript and Next.js
Get the gold price in JavaScript with a gold price API: async/await fetch, TypeScript response types, a cached Express or Next.js route and safe API key use.