Data Sources & Methodology
We publish verified, indicative gold prices - never typed in by hand, estimated, interpolated, or scraped from jeweller sites.
Gold spot price (XAU/USD)
- Primary: Gold-API.com - real-time, no key required.
- Secondary (independent check): MetalpriceAPI, or GoldAPI.io, when configured.
USD/LKR exchange rate
- Primary: Open Exchange Rates - hourly.
- Secondary: ExchangeRate-API open access (Rates By Exchange Rate API), or a keyed provider when configured.
The Central Bank of Sri Lanka publishes an official indicative USD/LKR spot rate each business day at cbsl.gov.lk → Rates and Indicators → Exchange Rates. It has no public API, so it is referenced here rather than used automatically. Market mid rates normally sit very close to it.
Verification
- Fetch the international gold spot price (US$ per troy ounce) from a primary source, and an independent secondary source when configured.
- Fetch the USD/LKR exchange rate the same way: primary plus an independent secondary source.
- Validate every reading: correct format, correct currency, a positive number, within a sane range, and fresh enough.
- Cross-check the primary and secondary reading for each figure - they must agree within a small tolerance. The primary reading is used for the calculation; readings are never averaged.
- Compare the result with the last verified price. An abnormally large jump is held for a human to confirm rather than published automatically.
- Calculate: spot price x USD/LKR rate, divided by 31.1034768 (grams per troy ounce), multiplied by karat/24. Rounding happens once, at the end.
- Store the new price only if it changed, roll it into the daily history, refresh the RSS feed, and clear cached pages.
Current Sources In Use
| Gold primary | gold_api_com |
| Gold secondary | not configured |
| FX primary | exchangerate_api_open |
| FX secondary | exchangerate_api_open |
| Verification mode | single_source |
Limitations
These are indicative market-rate conversions, not a jeweller's retail selling price, which includes making charges, taxes and margins. Treat this as a reference, not a quote.