English
Open account

Free gold price and exchange rate API: JSON, no sign-up

Reviewed by Sasaenia Omilabu, FCCA, MBA (Commodity Trading)

Free gold price and exchange rate API: no key, JSON

Crystal Ball Markets publishes three free JSON files: exchange rates against the US dollar for 60 currencies, the gold price in local money for 69 countries, and live quotes for 212 markets. There is no sign-up and cross-origin requests are allowed. The condition is a visible, followed link back to us, on a site of your own, wherever the figures appear.

This is a short guide for developers: what each file holds, how to call it, a worked example, and the limits. The full terms and live examples are on the rates API page.

What does the API return?

  • rates.json: units of each currency per US dollar. Each rate names its source: our own forex quote where we quote the pair, an official fixed rate (a peg), the European Central Bank’s reference rate, or for other currencies the reference rate of the country’s own central bank, with the day it was published.
  • gold.json: the gold price in each country’s money, in the unit and purity people there buy in: 10 grams of 24 karat in India, the tola in Pakistan, the baht weight of 96.5% gold in Thailand, the tael in Hong Kong, the troy ounce in a few countries and the gram in most, plus the price of one gram of 24 karat gold and the source of the exchange rate behind it.
  • quotes.json: our live bid and ask for every market on our markets hub, from forex and metals to energy, indices, shares and crypto, with the day’s change, high and low, the decimals each market is quoted to and a link to its page.

Each file is refreshed every minute and carries the same wrapper: attribution (the link to show), terms, notice, updated (when the newest figure was priced, in UTC) and data.

How do I call it?

From a web page, the browser names your site for you. Build the credit link from the file’s own attribution field:

const res = await fetch('https://crystalballmarkets.com/markets/api/v1/gold.json');
const { data, attribution } = await res.json();
const india = data.countries.find((c) => c.country === 'IN');
const price = new Intl.NumberFormat('en-IN', { style: 'currency', currency: india.currency }).format(india.price);

const credit = document.createElement('a');
credit.href = attribution.url;
credit.textContent = attribution.text;
document.querySelector('#gold').append(`24K gold, 10 grams: ${price} `, credit);

From a server, an app or the command line, name the page of your site that shows the figures with site, and send a secret of your own choosing, 16 characters or more, in the X-Site-Key header. The first call reserves that site for your key, and the same site named with another key is refused:

curl -H 'X-Site-Key: your-own-secret-123' \
  'https://crystalballmarkets.com/markets/api/v1/rates.json?site=https://your-site.com/rates'

From Python:

import requests

rates = requests.get(
    'https://crystalballmarkets.com/markets/api/v1/rates.json',
    params={'site': 'https://your-site.com/rates'},
    headers={'X-Site-Key': 'your-own-secret-123'},
    timeout=10,
).json()
naira = rates['data']['rates']['NGN']
print(naira['rate'], naira['source'], naira['time'])

JSON drops trailing zeros, so a price of 182.50 arrives as 182.5. Each market in quotes.json has a digits field: format bid, ask, high and low to that many decimals.

Worked example: the gold price in rupees

At 17:39 UTC on 12 November 2026 gold.json gave gold at $3,873.01 a troy ounce, and rates.json gave the rupee at 94.04 to the dollar (the European Central Bank’s reference rate). A troy ounce is 31.1035 grams, so one gram of 24 karat gold came to 3,873.01 × 94.04 ÷ 31.1035 = ₹11,709.88, and the 10 grams Indian buyers quote came to ₹117,098.76, the figure the file gave for India. Our gold price in India page works it out the same way.

For 22 karat jewellery gold, multiply by the fineness of 0.916. A shop’s price will be higher than either figure: import duty, GST and the making charge are added on top, and dealers set their own margins. Our guide to how the Indian gold rate is set walks through each step.

What are the limits and terms?

  • Show this link, visible and unchanged, wherever the figures appear: <a href="https://crystalballmarkets.com/markets">Rates by Crystal Ball Markets</a>. Do not mark it nofollow, ugc or sponsored.
  • Calls from a server, an app or a script name the page that shows the figures (site) and carry your own secret (X-Site-Key). The site must be on a domain of your own that does not link to us yet: each new use of the files brings a new link. Sites that already link to us, platforms such as GitHub or dev.to, and free hosting such as github.io or vercel.app cannot be named. Calls that name no site are refused.
  • Each address may make 60 requests a minute. The files change at most once a minute, so keep each response for at least 60 seconds; beyond the limit the API answers 429.
  • The figures are indicative, for information only. They are not an offer to buy or sell and must not be shown as dealing prices.
  • Do not resell the files or offer them as a data feed of your own.

Every site that calls the files from its pages, and every page named with site, is checked once a day for the link. Where it is missing, the files carry a warning saying what to fix for 24 hours, then stop answering for that site until the link is back. A named page that does not open counts as missing.

Is there an OpenAPI description?

Yes: openapi.json, in OpenAPI 3.1. Import it into Postman or Insomnia, or feed it to a code generator for typed clients. Every field is described there, with its type and, for currencies and countries, the ISO code it uses.

Is there a WordPress plugin?

Yes: Crystal Ball Markets Rates, free in the WordPress.org plugin directory. It adds a currency converter and a gold value calculator to any page, as a block or as the shortcode [cbmarkets_converter]. Four smaller shortcodes put one exchange rate, a converted amount, a table of rates or the gold price in a country inside a sentence. The plugin reads rates.json and gold.json from your server and keeps each copy for five minutes; the converter works in the visitor’s browser and asks nothing of another site. The link the terms ask for is one setting on its settings page.

For your own code, the same sums come as the crystal-ball-markets package on npm, for browsers and Node, and on PyPI, for Python.

Is there a browser extension?

Yes: Currency and Gold Converter, free in the Chrome Web Store. It puts the same converter and gold value calculator in a pop-up in the browser’s toolbar: an amount between about 60 currencies, or what a weight of gold is worth in any of them. It reads rates.json and gold.json as data, keeps them for five minutes and asks for one permission, storage. Its source is in our examples repository. An extension you build yourself is not a web page, so its calls name a site and send a key, as described above.

Where do the figures come from?

Market quotes come from our own trading platform. Exchange rates come from our own forex quotes where we quote the pair, then official pegs and the European Central Bank’s daily reference rates; for currencies the ECB does not publish, such as the naira, the Kenyan shilling or the Pakistani rupee, we use the issuing central bank’s own reference rate, collected once a business day through Frankfurter. Rates from commercial data vendors are never included, because their terms do not allow it. Gold in local money is our XAU/USD quote multiplied by that rate. The figures can differ from what banks, exchange offices and jewellers charge.

What to read next

If you want to trade the markets behind these figures, you can open an account and use the same quotes on our platform. CFDs are complex and carry a high risk of losing money because of leverage.

Sources

CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. Capital is at risk. Risk warning

More on gold

All gold articles

Put what you learn into practice

Practise on a demo account with $50,000 of virtual money, then trade from $1.

CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. Capital is at risk. Risk warning

Open account

CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. Capital is at risk.