Paste one iframe
The widget is hosted by goldprice.dev. Your page loads the card in an isolated iframe, so its styles cannot clash with your site and no browser-side API key is exposed.
HTML
Paste the generated iframe where you want the price card to appear.
<iframe src="https://goldprice.dev/embed/xau?currency=USD&unit=oz&karat=24&theme=auto&locale=en" title="Gold price" width="360" height="190" loading="lazy" style="border:0;width:100%;max-width:360px" referrerpolicy="strict-origin-when-cross-origin"></iframe>WordPress
Add a Custom HTML block, paste the iframe, then preview and publish.
Read the WordPress walkthrough →Webflow
Drag an Embed element onto the canvas and paste the iframe code.
React / Next.js
Return the iframe as JSX. Rename referrerpolicy to referrerPolicy and convert the style string to a style object.
Widget options
| Parameter | Values | Default | Meaning |
|---|---|---|---|
currency | USD, AUD, BGN, BRL, CAD, CHF, CNY, CZK, DKK, EUR, GBP, HKD, HUF, IDR, ILS, INR, ISK, JPY, KRW, MXN, MYR, NOK, NZD, PHP, PLN, RON, SEK, SGD, THB, TRY, ZAR | USD | Quote currency for the displayed gold price. |
unit | oz, gram | oz | Show the price per troy ounce or per gram. |
karat | 24, 22, 21, 20, 18, 16, 14, 10 | 24 | Gold purity used when unit=gram. |
theme | auto, light, dark | auto | Light, dark, or the visitor's system preference. |
locale | en, ar, es, id, ja, ko, vi, zh | en | Number, timestamp, direction, and label language. |
Spot reference, not a checkout quote
The displayed number is derived from XAU/USD spot and, for non-USD currencies, the current USD exchange rate. Gram values divide a troy ounce by 31.1034768; karat values apply the selected purity ratio.
Dealer premiums, making charges, taxes, shipping, and local retail spreads are not included.
Read the price methodology →Free with visible attribution
Personal and commercial websites may use the official widget without charge or signup. Keep the iframe unmodified and the visible Powered by goldprice.dev link intact.
White-label or modified presentation rights require a separate Enterprise agreement.
Read the Official Widget License →Cached for 60 seconds
The source price is refreshed upstream, the iframe response is cached for 60 seconds, and an open widget refreshes itself on the same cadence while its tab is visible. The card shows the source timestamp and marks delayed data. If pricing is unavailable, it shows a clear unavailable state instead of a fabricated number.
No secret in the browser
The widget makes no authenticated request from your page. Its iframe isolation prevents widget CSS or scripts from reaching the host page. Use the exact HTTPS URL produced above; do not proxy the iframe or copy its internal markup.
If the widget does not appear
- Use a Custom HTML or Embed element; rich-text editors often remove iframe markup.
- Allow frames from
https://goldprice.devin your site's Content Security Policy. - Keep the iframe at least 320 px wide and 190 px high; the supplied CSS remains responsive below the maximum width.
- Check the generated URL directly in a browser to separate host-page restrictions from data availability.
Gold price widget questions
Is the gold price widget free?
Yes. The official branded widget is free for personal and commercial websites. It requires no account or API key. Keep the iframe unmodified and its Powered by goldprice.dev link visible.Can I remove the goldprice.dev attribution?
Not from the free official widget. White-label or modified presentation rights are available under a separate Enterprise agreement.How often does the widget update?
The widget refreshes itself every 60 seconds and reads the current spot-derived gold price through goldprice.dev. Its visible timestamp tells visitors when the source row was computed.Does the widget show retail jewelry or dealer prices?
No. It shows a spot-derived reference price. Dealer premiums, making charges, taxes, shipping, and local retail spreads are excluded.Does it expose an API key in my page source?
No. The iframe is hosted by goldprice.dev and fetches data server-side, so your site does not ship or expose an API credential.Can I use it in WordPress or Webflow?
Yes. Paste the iframe into a WordPress Custom HTML block or a Webflow Embed element. Any site builder that accepts iframe HTML can use it.What does the widget measure?
The hosted iframe records the same minimal pageview and, when the browser supplies it, referrer metadata described in the goldprice.dev Privacy Policy. This lets us count active embeds and referring domains. It has no advertising or session-recording tracker and requires no account.
Get a free API key
Get 5,000 requests a month with no credit card required.