=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.
=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.
=A2/31.1034768Convert 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.
=A2*D2Refresh 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
{"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
| Code | What you see | Fix |
|---|---|---|
| 429 | Requests 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.