How to Get Real-Time Gold and Silver Prices in Webflow

Step-by-step guide on integrating GoldAPI.io Price Call in Webflow site

Integrating GoldAPI.io with Webflow

Webflow is useful when you want to show live precious metals prices on a marketing site, landing page, directory, or customer-facing pricing page.

The safest approach is to fetch GoldAPI.io through your own backend endpoint and then render the returned price in Webflow with a small custom script. This keeps your API key private.

What you need

  1. A Webflow site.
  2. A GoldAPI.io API key.
  3. A small backend endpoint or serverless function that calls GoldAPI.io.
  4. A Webflow Embed element or custom code block.

Step 1: Create a backend endpoint

Create an endpoint on your own backend, for example:

https://example.com/api/metals/gold

That endpoint should call GoldAPI.io server-side:

app.get('/api/metals/gold', async (req, res) => {
  const response = await fetch('https://www.goldapi.io/api/price/XAU/USD?melt_price=false&currency_info=false', {
    headers: {
      'x-access-token': process.env.GOLDAPI_API_KEY,
      'Content-Type': 'application/json'
    }
  });

  if (!response.ok) {
    res.status(response.status).json({ error: 'Price unavailable' });
    return;
  }

  const data = await response.json();

  res.json({
    metal: 'XAU',
    currency: 'USD',
    price: data.price,
    ask: data.ask,
    bid: data.bid,
    timestamp: data.timestamp
  });
});

Step 2: Add price placeholders in Webflow

Add text elements where you want the price to appear, then give them custom attributes such as:

data-goldapi-field="price"
data-goldapi-field="bid"
data-goldapi-field="ask"

For example:

<span data-goldapi-field="price">Loading...</span>

Step 3: Add custom code in Webflow

Add this script before the closing body tag in Webflow page settings or site-wide custom code:

<script>
async function loadGoldPrice() {
  const response = await fetch('https://example.com/api/metals/gold');

  if (!response.ok) {
    return;
  }

  const data = await response.json();
  const formatter = new Intl.NumberFormat('en-US', {
    style: 'currency',
    currency: data.currency
  });

  document.querySelectorAll('[data-goldapi-field="price"]').forEach((element) => {
    element.textContent = formatter.format(data.price);
  });

  document.querySelectorAll('[data-goldapi-field="bid"]').forEach((element) => {
    element.textContent = formatter.format(data.bid);
  });

  document.querySelectorAll('[data-goldapi-field="ask"]').forEach((element) => {
    element.textContent = formatter.format(data.ask);
  });
}

loadGoldPrice();
</script>

Replace https://example.com/api/metals/gold with your own backend endpoint.

Step 4: Refresh the price automatically

If the page stays open for a long time, refresh the value on an interval:

<script>
loadGoldPrice();
setInterval(loadGoldPrice, 60000);
</script>

This refreshes the displayed price every 60 seconds.

Example use cases

You can use this Webflow setup to:

  • show live gold and silver prices on a landing page
  • update bullion or jewelry pricing sections
  • display bid and ask values on a trading information page
  • add live market data to a customer portal or gated page

Security note

Do not place your GoldAPI.io key directly in Webflow custom code. Browser-side code is visible to visitors. Keep the key on your backend or serverless function and expose only the price fields your Webflow page needs.

Conclusion

Webflow works well with GoldAPI.io when the API call is handled server-side. A backend endpoint plus a small Webflow script is enough to display real-time gold and silver prices without exposing your API key.

GoldAPI.io Developer FAQ

Helpful answers for developers working with precious metals price data.

Can I use GoldAPI.io price API examples in production?

Yes. GoldAPI.io API examples can be used in production applications with your API key. Developers can integrate real-time gold, silver, and precious metals prices into websites, trading platforms, and financial tools.

Does GoldAPI.io support multiple currencies for gold price API?

Yes. GoldAPI.io supports multiple currencies including USD, AUD, CAD, EUR, GBP, AED, SGD, KWD, OMR, and SAR. You can request gold price and other metals price data in any supported currency.

Is GoldAPI.io suitable for trading bots and financial applications?

Yes. GoldAPI.io is designed for developers building trading bots, financial dashboards, analytics platforms, and pricing tools. It provides fast and reliable real-time and historical metals price data via JSON API.

Integration Guides To

Build With GoldAPI.io Today

Practical guides for WordPress, Shopify, Excel, Joomla, and Drupal.

WordPress integration icon
WordPress

How to Get Real-Time Gold and Silver Prices in WordPress

Step-by-step guide on integrating GoldAPI.io Price Call in WordPress site

Read article →
Shopify integration icon
Shopify

How to Get Real-Time Gold and Silver Prices in Shopify

Step-by-step guide on integrating GoldAPI.io Price Call in Shopify store

Read article →
Excel integration icon
Excel

How to Get Real-Time Gold and Silver Prices in Excel

Step-by-step guide on integrating GoldAPI.io Price Call in Excel spreadsheet

Read article →
WebSockets integration icon
WebSockets

How to Stream Live Gold Prices Using GoldAPI.io WebSockets Integration

Build a real-time gold price WebSocket feed for bullion dealer quotes, live dashboards, inventory valuation, and customer price updates with GoldAPI.io.

Read article →
FX WebSockets integration icon
FX WebSockets

How to Get Real-Time Currency FX Rates Using GoldAPI.io WebSockets

Stream live foreign-exchange rates, bid and ask prices, and currency-pair updates into FX dashboards, conversion tools, checkout pricing, and treasury workflows.

Read article →
MCP Server integration icon
MCP Server

How to Connect ChatGPT, Claude and Codex to the GoldAPI MCP Server

Connect AI agents to the hosted GoldAPI MCP Server for live and historical metal (gold, silver) prices, currency conversion, valuations, portfolio analysis and LBMA benchmarks.

Read article →