TutorialsSpreadsheets

Silver price in Power BI

Bring silver prices into Power BI with Power Query M, then set up scheduled refresh. Free prices are delayed; paid plans provide live prices.

23 Oct 2026 · 4 min read

To get silver prices in Power BI, use Power Query M to call https://api.goldprice.dev/v1/spot/XAG-USD-SPOT with your goldprice.dev API key in the X-API-Key header. The response gives silver in USD per troy ounce. Free includes 5,000 calls a month with prices delayed by 15 minutes; paid plans are live. Publish your report, configure credentials, and schedule refresh to bring new prices into your report.

Get your goldprice.dev API key

Create a free account at goldprice.dev/onboarding and copy your API key. You will paste it into the query below.

Free includes silver spot in USD, 5,000 calls a month, and 10 requests a minute. Prices are delayed by 15 minutes. No credit card is required.

Open Power Query in Power BI Desktop

In Power BI Desktop, select Home → Transform Data to open Power Query Editor. Select Home → New Source → Blank Query, then View → Advanced Editor.

You will use Power Query M to request the silver price and turn the response into a table.

Paste the SilverPrice M query

Replace the editor contents with the query below. Paste your key into ApiKey, select Done, and name the query SilverPrice.

Keep the fixed base URL and RelativePath structure for refresh setup. The query reads the price string as a number and leaves missing bid or ask values empty. Bid and ask appear only on plans that include them.

Power Query · Advanced Editor
// power-bi: Power Query M query "SilverPrice"// curl-equivalent: https://api.goldprice.dev/v1/spot/XAG-USD-SPOT// Replace ApiKey with your goldprice.dev key from /onboardinglet    ApiKey = "ga_live_replace_with_your_key_here",    Symbol = "XAG-USD-SPOT",    Source = Json.Document(        Web.Contents(            "https://api.goldprice.dev",            [                RelativePath = "v1/spot/" & Symbol,                Headers = [#"X-API-Key" = ApiKey],                ManualStatusHandling = {401, 429}            ]        )    ),    Result = #table(        {"field", "value"},        {            {"symbol", Source[symbol] & "-" & Source[quote_currency]},            {"price", Number.FromText(Source[price], "en-US")},            {"bid", if Record.HasFields(Source, "bid") and Source[bid] <> null then Number.FromText(Source[bid], "en-US") else null},            {"ask", if Record.HasFields(Source, "ask") and Source[ask] <> null then Number.FromText(Source[ask], "en-US") else null},            {"computed_at", Source[computed_at]},            {"is_stale", Source[is_stale]}        }    )in    Result

Publish and configure scheduled refresh

Save the report and select Home → Publish. In the Power BI Service, open your semantic model settings. Under Data source credentials, choose Anonymous for https://api.goldprice.dev. The query sends your API key in its header.

Configure Scheduled refresh using the options available for your account and workspace. Run a refresh and check that it succeeds. Each report refresh retrieves the price available on your goldprice.dev plan.

Switch metal or convert silver to another currency

For another metal, change Symbol in the main query. The example below calls the same endpoint pattern for silver, gold, and copper. Silver and gold prices are per troy ounce. Copper is per pound.

Silver spot symbols exist only in USD. For silver in EUR per gram, use /v1/convert?from=XAG&to=EUR&amount=1&unit=gram in a separate query. Conversion supports oz, gram, and kg; its response needs separate table mapping.

Conversion works without a key, with prices delayed by 15 minutes and a limit of 100 requests an hour per IP. See the API reference for the response fields.

Power Query · multi-currency variants
let    ApiKey = "ga_live_replace_with_your_key_here",    GetSpot = (Symbol as text) =>        Json.Document(            Web.Contents(                "https://api.goldprice.dev",                [                    RelativePath = "v1/spot/" & Symbol,                    Headers = [#"X-API-Key" = ApiKey],                    ManualStatusHandling = {401, 429}                ]            )        )in    [        // Silver, USD per troy ounce        Silver = GetSpot("XAG-USD-SPOT"),        // Gold, USD per troy ounce        Gold = GetSpot("XAU-USD-SPOT"),        // Copper, USD per pound        Copper = GetSpot("HG-USD-SPOT")    ]

Expected output

JSON
{  "symbol": "XAG",  "quote_currency": "USD",  "unit": "troy_ounce",  "contract_type": "spot",  "price": "53.89",  "is_stale": false,  "computed_at": "2026-10-23T07:00:18.221118+00:00"}

The JSON shows an example API response. The main query turns it into a field/value table. For a price card, create a reference query, filter field to price, and set value to a decimal numeric type. Keep computed_at and is_stale available so viewers can check the timestamp and stale flag.

Common errors

CodeWhat you seeFix
401The API rejects the key, or refresh reports The credentials provided for the Web source are invalidCheck that ApiKey contains a valid goldprice.dev key. In the Service, open Data source credentials and choose Anonymous for https://api.goldprice.dev. The key belongs in the query header. If you change the key in Desktop, publish the updated report.
429Refresh fails with 429 Too Many RequestsCheck both your request rate and monthly usage. Free allows 10 requests a minute and 5,000 calls a month. Other queries, previews, and retries can also make requests. Reduce overlapping refreshes and retry after the limit allows requests again. Compare plan limits at /pricing.
N/ADesktop refresh works but Service refresh fails with Please specify how to connectCheck the published query and Service credentials. Keep https://api.goldprice.dev as the fixed first argument to Web.Contents, with the endpoint in RelativePath, as shown above. Set the source credentials to Anonymous, publish any query changes, and try refresh again.

Going further

  • Build a metal scorecard with separate queries for silver, gold, and copper. Show the currency and unit on each card.
  • Move ApiKey into a Power Query parameter so you can update it without editing the request code.
  • Display computed_at beside the silver price and use is_stale to flag stale responses.
  • Add a separate silver conversion query for another currency or unit. Map its response using the API reference.
  • Review refresh frequency and account usage together so report queries stay within your plan limits.

Questions

How recent is the silver price?

Free silver prices are delayed by 15 minutes. Paid plans provide live prices. Power BI retrieves a price when its query refreshes, so the report can show an older snapshot between refreshes. Display computed_at and check is_stale alongside the price.

Will scheduled refresh fit the free tier quota?

Free includes 5,000 calls a month and 10 requests a minute, with no credit card required. Count requests across all your queries, previews, and retries. Whether your report fits depends on its refresh schedule and other usage of the same account.

Can I show silver in another currency?

Yes. Silver spot symbols exist only in USD, so use the conversion endpoint for another currency. Request /v1/convert?from=XAG&to=EUR&amount=1&unit=gram for EUR per gram. It works without a key, with prices delayed by 15 minutes and 100 requests an hour per IP.

Which metals can I put in the report?

Use XAG-USD-SPOT for silver, XAU-USD-SPOT for gold, and HG-USD-SPOT for copper. Silver and gold are quoted in USD per troy ounce, while copper is USD per pound. Label each visual with its metal, currency, and unit.

Why are bid and ask empty?

Bid and ask appear only on plans that include them. The query checks whether each field exists and contains a value before converting it. Empty bid or ask cells alone do not mean the silver price request failed.

How should I handle silver price decimals?

Silver prices arrive as strings and can include decimal places. Use a decimal numeric type for calculations and choose display rounding separately. The example uses Number.FromText to read the string; review the resulting column type before building measures or totals.

Can Claude help me write the Power Query?

Yes. Ask Claude to adapt the query for silver and review its output before publishing. The goldprice.dev MCP server offers get_spot_price for silver. Connect remotely at https://api.goldprice.dev/v1/mcp/ without a key, or use npx @nusantara-ventures/goldprice-mcp with a key.

Keep reading

Start with a free API key

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

Get a free key