TutorialsSpreadsheets

Silver price in Excel

Fetch the silver spot price in US dollars per troy ounce, then calculate prices per gram, per kilogram or in another currency.

26 Oct 2026 · 2 min read

=LET(j,WEBSERVICE("https://api.goldprice.dev/v1/spot/XAG-USD-SPOT"),s,SEARCH("""price"":""",j)+9,VALUE(MID(j,s,SEARCH("""",j,s)-s))) returns the XAG/USD silver spot price per troy ounce from goldprice.dev. It is 15 minutes late and needs no key. Paste it into Excel for Windows or Microsoft 365 with WEBSERVICE support. Dividing the result by 31.1034768 gives US dollars per gram. The endpoint returns a decimal string, which the formula converts to a cell value.

Paste the silver price formula

Use Excel for Windows or Microsoft 365 on Windows. Paste this formula into A2. It requests XAG-USD-SPOT without a key and extracts the price into the cell. The value is US dollars per troy ounce, 15 minutes late. WEBSERVICE is unavailable in Excel for Mac and Excel for the web.

silver-per-troy-ounce.txt
=LET(j,WEBSERVICE("https://api.goldprice.dev/v1/spot/XAG-USD-SPOT"),s,SEARCH("""price"":""",j)+9,VALUE(MID(j,s,SEARCH("""",j,s)-s)))

Calculate prices per gram and kilogram

With the price per troy ounce in A2, paste the formula below into B2 for US dollars per gram. In C2, enter =B2*1000 for US dollars per kilogram. These cells calculate from the price already in A2.

silver-per-gram.txt
=A2/31.1034768

Convert with a rate cell or use Power Query

For euros per troy ounce, put your euros-per-US-dollar rate in D2 and paste the formula below into E2. For euros per gram, use =B2*D2. For a request with an API key, follow the Power Query route in the gold Excel tutorial. Keep the key in Setup!B5, change Setup!B6 to XAG-USD-SPOT, and send the key in the X-API-Key header.

silver-in-euros.txt
=A2*D2

Refresh and check request limits

Formulas recalculate when the workbook opens. To send a new request, press Ctrl+Alt+F9, because F9 recalculates only cells Excel treats as changed. For Power Query, use Data > Refresh All. Keyless access allows 10 requests a minute and 100 an hour per IP. A Free key includes 5,000 calls a month, requires no credit card and permits commercial use. Free requires a visible link to goldprice.dev near the prices. Paid plans require no link. Keep the per-gram and per-kilogram cells linked to A2.

Expected output

JSON
{"symbol":"XAG","quote_currency":"USD","unit":"troy_ounce","contract_type":"spot","price":"54.020","is_stale":false,"computed_at":"2026-10-23T18:12:06.354573+00:00"}

A2 contains the silver spot price in US dollars per troy ounce. B2 contains dollars per gram. C2 contains dollars per kilogram. With a euros-per-dollar rate in D2, E2 contains euros per troy ounce. Keyless prices are 15 minutes late.

Common errors

CodeWhat you seeFix
429Requests exceed the keyless limit or the allowance for your key.Reduce refresh frequency and check usage. Keyless access allows 10 requests a minute and 100 an hour per IP. A Free key allows 5,000 calls a month.
#NAME?WEBSERVICE is unavailable in Excel for Mac or Excel for the web.Use the formula in Excel for Windows with WEBSERVICE support.
#VALUE!The formula returns #VALUE!, or the retrieved response needs a freshness check.Inspect the response for an error and confirm that it contains the expected price field before recalculating. Check is_stale and computed_at separately. The formula extracts only price, so a numeric cell does not confirm that the response is fresh.

Going further

  • Use /tutorials/excel for the Power Query setup, with XAG-USD-SPOT as the symbol.
  • Read /docs/historical for silver daily history, which starts in 2007.
  • Use /v1/convert?from=XAG&to=&amount=1&unit=gram for a currency conversion.

Questions

Will the Free tier fit my spreadsheet?

A Free key includes 5,000 calls a month. For a 30-day month, 5,000 / 30 is about 166 calls a day. Compare that budget with your workbook's requests. No credit card is required. Commercial use is allowed, with a visible link to goldprice.dev near the prices. Paid plans need no link.

Can an AI assistant like Claude write the formula using the goldprice.dev MCP server?

You can give an assistant such as Claude the formula and endpoint shown here to work from. This method does not require a goldprice.dev MCP server connection. Excel retrieves the price directly through WEBSERVICE.

Does this formula work in Excel for Mac or the web?

No. WEBSERVICE is unavailable in Excel for Mac and Excel for the web. Use Excel for Windows or Microsoft 365 on Windows with WEBSERVICE support.

What unit does the silver endpoint return?

It returns US dollars per troy ounce. Divide by 31.1034768 for dollars per gram. Multiply the per-gram result by 1000 for dollars per kilogram.

Can I get silver in another currency?

The silver spot endpoint is quoted in USD only. Multiply by a rate cell expressed as units of your currency per US dollar. You can also call /v1/convert?from=XAG&to=&amount=1&unit=gram, replacing with the currency.

What do silver 999 and sterling 925 mean?

Silver 999 is 99.9% fine. Sterling 925 is 92.5% fine.

Keep reading

Start with a free API key

5,000 requests a month on the free plan. No credit card.

Get a free key