Methodology & Data Sources
Every price on GramRate is computed from live market data using the formulas below. Nothing is copied from other websites, and every page carries the timestamp of the reading it was rendered from.
Data sources
| Data | Source | Cadence |
|---|---|---|
| Gold spot (XAU/USD) | gold-api.com | Every minute |
| EUR & GBP exchange rates | frankfurter.dev (European Central Bank data) | Daily |
| CAD, AUD & fallback rates | open.er-api.com (exchangerate-api) | Daily |
The two FX sources back each other up: if one is unavailable, the other fills the gap, and the last good rate is cached until a fresh one arrives.
The formulas
Gold trades in troy ounces. One troy ounce = 31.1034768 grams (not the 28.35 g kitchen ounce).
Pure-gold gram price (in any currency) = spot price per ounce in that currency ÷ 31.1034768.
Karat price = pure-gold gram price × fineness factor:
| Karat | Fineness factor | Gold content |
|---|---|---|
| 24K | 0.999 | 99.90% |
| 22K | 0.9167 | 91.67% |
| 21K | 0.875 | 87.50% |
| 18K | 0.75 | 75.00% |
| 14K | 0.5833 | 58.33% |
Per-ounce and per-kilogram karat prices multiply the gram price by 31.1034768 and 1000 respectively. All arithmetic is done at full precision; rounding happens only at display.
Quality guards
- Anomaly guard (±4%). A new reading deviating more than 4% from the previous one within 15 minutes is rejected and not published — this protects against source errors, not market moves.
- Staleness detector (10 minutes). If the newest reading is older than 10 minutes, every page displays a visible "delayed prices" badge.
- History from day one. Every accepted reading is archived to build the 24-hour, 7-day and 30-day changes and averages you see on price pages.
Citing our data
The /api/matrix endpoint returns the current snapshot as JSON and is free to reference with attribution. Figures change every minute — always cite the timestamp, not just the price.