Use the gold price API to get a per-gram metal rate, multiply it by the item's weight, then add your shop's making charge, taxes and margin. Free and keyless requests use spot prices that are 15 minutes late; live prices need Basic.
Get the per-gram rate by karat
GET /v1/carat?currency=INR returns per-gram prices for 24K, 22K, 21K, 20K, 18K, 16K, 14K and 10K in one call, with no key needed. The curl example shows the request.
The endpoint supports 35 currencies. Prices in other currencies use exchangerate.dev rates; see the karat price API for details.
curl "https://api.goldprice.dev/v1/carat?currency=INR"Add your shop's charges
A shop's item price is usually the per-gram rate for its karat multiplied by the item weight, plus the shop's making charge, taxes and margin. The API supplies only the metal rate.
The JavaScript example uses itemPrice(weightGrams, karat, makingCharge) for the metal value plus making charge. Add your shop's taxes and margin to complete the selling price.
// Metal value of an item from today's per-gram rate, plus the shop's making charge.// Add your own taxes and margin to this.async function itemPrice(weightGrams, karat, makingCharge, currency = 'INR') { const res = await fetch(`https://api.goldprice.dev/v1/carat?currency=${currency}`) if (!res.ok) throw new Error(`goldprice.dev answered ${res.status}`) const rates = await res.json() const perGram = Number(rates[`price_gram_${karat}k`]) return weightGrams * perGram + makingCharge}// A 22K ring of 8 grams with a making charge of 1,500 rupeesconsole.log(await itemPrice(8, 22, 1500))Print a price list for the counter
One request is enough for a whole board. The Python script fetches the INR rates once and prints each karat for 2, 5 and 10 gram pieces with an 8% making charge. Change the making charge, the karats and the weights to match the shop.
The table is from a run on 2 November 2026. A 5 g piece in 22K costs 5 × 10,906.38 = 54,531.90 in gold, and 58,894.45 with the 8% making charge. The script rounds each price once, at the end, with half-up rounding. Fetch the rate on a timer in your backend, store it with its timestamp and print the timestamp on the board.
import jsonfrom decimal import Decimal, ROUND_HALF_UPfrom urllib.request import urlopenAPI = "https://api.goldprice.dev"cents = lambda d: d.quantize(Decimal("0.01"), rounding=ROUND_HALF_UP)def rates(currency): with urlopen(f"{API}/v1/carat?currency={currency}", timeout=10) as r: return json.load(r)def price_list(currency, karats, weights, making_pct): data = rates(currency) print(f"Rates at {data['timestamp']} ({currency} per gram)") for k in karats: rate = Decimal(data[f"price_gram_{k}k"]) row = [f"{k}K {rate:>9}"] for w in weights: metal = Decimal(w) * rate row.append(f"{w}g {cents(metal * (1 + Decimal(making_pct) / 100)):>10}") print(" ".join(row))price_list("INR", [24, 22, 18, 14], ["2", "5", "10"], "8")| Karat | INR per gram | 2 g with making charge | 5 g with making charge | 10 g with making charge |
|---|---|---|---|---|
| 24K | 11,897.87 | 25,699.40 | 64,248.50 | 128,497.00 |
| 22K | 10,906.38 | 23,557.78 | 58,894.45 | 117,788.90 |
| 18K | 8,923.40 | 19,274.54 | 48,186.36 | 96,372.72 |
| 14K | 6,940.42 | 14,991.31 | 37,478.27 | 74,956.54 |
Apply the calculation in India or Indonesia
An Indian shop can use the INR rate for a 22K item, multiply it by the weight in grams and add its own charges. An Indonesian shop can use the same method for an 18K item priced in rupiah.
Use the gold price calculator for a calculation, or add a reference rate to your website with the jewellery shop widget.
Plan for freshness and request limits
Free includes 5,000 requests a month. Keyless callers get 10 requests a minute and 100 an hour per IP.
Spot prices are 15 minutes late on Free and without a key. Paid plans provide live prices; choose Basic when your pricing needs a live metal rate.