how can I build a website with online price of Gold?

Dani AI

Generated

Short answer: treat the live gold price like any other market data feed — pick a reliable price source (real-time or delayed, with clear license and update interval), fetch it server-side into a tiny cache/DB, expose a small JSON endpoint, and let the page consume that endpoint (poll or push). ’s question about “Gold” is important: decide the unit you need (USD per troy ounce, per gram, per karat, etc.) before wiring conversions.

Key implementation flow (practical, minimal):

  1. Provider selection — evaluate update frequency, mid-market vs bid/ask, currency base (usually USD), rate limits and attribution/terms.
  2. Server fetcher — run a cron/worker to call the provider, save price + source + timestamp, and enforce local caching to respect rate limits.
  3. Public endpoint — serve /api/latest-gold from your server (reads cached row). Front-end hits that endpoint or subscribes to push updates.
  4. Display — always show unit, currency, and "last updated" timestamp. Offer conversion controls (grams/oz/local currency) and show whether the number is mid, bid, or ask.

Example snippets (keeps behavior clear; adapt to your stack):

/* cron fetcher (Node.js-esque pseudocode) */
const res = await fetch(API_ENDPOINT);
const { price } = await res.json();
db.query('INSERT INTO gold_prices (ts, price_usd_per_oz, source) VALUES (?, ?, ?)', [Date.now(), price, 'providerName']);
/* front-end polling */
setInterval(async () => {
  const r = await fetch('/api/latest-gold');
  const { price, ts } = await r.json();
  if (price !== currentPrice) updateDOM(price, ts);
}, 60000);

Operational tips and cautions: respect provider TOS (avoid scraping), handle errors with a graceful fallback to the last cached price, throttle DOM updates to avoid flicker, and store the conversion rate used for any financial transaction (don’t reprice historical transactions from a live feed). ’s polling idea is right — pick a frequency that matches your provider’s allowed cadence. ’s per-user gold-balance idea applies to wallet logic (store balances in base units and record conversion rate at the moment of transaction). ’s widget suggestion is a fast route, but verify styling, performance and licensing before embedding.

Recommended Answers

All 7 Replies

Can you elaborate what you mean by "Gold"? Do you want to pay for the service using gold instead of currency?

You'd make each user have a new field in the database with the name of money, then whenever they add money to their account and they pay you would need to get the amount of money of money they paid then convert that to gold (Whether you want it £10 = 1000gold or whatever) and add it to their money field in the database.

I mean to design a website with live universal price of gold.I need it for my colleague project.
can anybody help me?

I don't really understand what you want 100% but add me on skype (Yorkiebar14) and I'll help you on that. I don't have a mic atm but IM's will be faster and easier than this.

Find a current Resource online that maintains a Real-Time Gold price index, then you'll have to build a script that checks that resource, say every '5' minutes and updates your page. It's actually quite starightforward to do.

Web design requires Lots of skills so its better to cocern from professionals in designing field .

There is a website that offers html code for online prices of gold and other commodities.
CHeck it out here: www.kitconet.com
You should find all the gold html codes u need!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.