<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Crystal Ball Markets</title>
    <description>The latest articles on DEV Community by Crystal Ball Markets (@crystalballmarkets).</description>
    <link>https://dev.to/crystalballmarkets</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4241582%2Fe6ef5ad9-1278-4bd8-84b4-933949a9d4f8.png</url>
      <title>DEV Community: Crystal Ball Markets</title>
      <link>https://dev.to/crystalballmarkets</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/crystalballmarkets"/>
    <language>en</language>
    <item>
      <title>Free gold price and exchange rate API: JSON, no sign-up</title>
      <dc:creator>Crystal Ball Markets</dc:creator>
      <pubDate>Thu, 12 Nov 2026 18:33:18 +0000</pubDate>
      <link>https://dev.to/crystalballmarkets/free-gold-price-and-exchange-rate-api-no-key-json-1l09</link>
      <guid>https://dev.to/crystalballmarkets/free-gold-price-and-exchange-rate-api-no-key-json-1l09</guid>
      <description>&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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 &lt;a href="https://crystalballmarkets.com/markets/rates-api" rel="noopener noreferrer"&gt;rates API page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does the API return?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;rates.json&lt;/strong&gt;: 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.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;gold.json&lt;/strong&gt;: 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.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;quotes.json&lt;/strong&gt;: 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.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h2&gt;
  
  
  How do I call it?
&lt;/h2&gt;

&lt;p&gt;From a web page, the browser names your site for you. Build the credit link from the file’s own &lt;code&gt;attribution&lt;/code&gt; field:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://crystalballmarkets.com/markets/api/v1/gold.json'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;attribution&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;india&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;countries&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;country&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'IN'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Intl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NumberFormat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'en-IN'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;style&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'currency'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;currency&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;india&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;currency&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;india&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;credit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'a'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;credit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;href&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;attribution&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;credit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;attribution&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'#gold'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`24K gold, 10 grams: ${price} `&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;credit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -H &lt;span class="s1"&gt;'X-Site-Key: your-own-secret-123'&lt;/span&gt; \
  &lt;span class="s1"&gt;'https://crystalballmarkets.com/markets/api/v1/rates.json?site=https://your-site.com/rates'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From Python:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="n"&gt;rates&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s1"&gt;'https://crystalballmarkets.com/markets/api/v1/rates.json'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;'site'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'https://your-site.com/rates'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;'X-Site-Key'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'your-own-secret-123'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;naira&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;rates&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'data'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'rates'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'NGN'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;naira&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'rate'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;naira&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'source'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;naira&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'time'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;h2&gt;
  
  
  Worked example: the gold price in rupees
&lt;/h2&gt;

&lt;p&gt;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 &lt;a href="https://crystalballmarkets.com/markets/gold-price/india" rel="noopener noreferrer"&gt;gold price in India&lt;/a&gt; page works it out the same way.&lt;/p&gt;

&lt;p&gt;For 22 karat jewellery gold, multiply by the &lt;code&gt;fineness&lt;/code&gt; 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 &lt;a href="https://crystalballmarkets.com/blog/gold-price-today-in-india-how-the-rate-is-set" rel="noopener noreferrer"&gt;guide to how the Indian gold rate is set&lt;/a&gt; walks through each step.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the limits and terms?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Show this link, visible and unchanged, wherever the figures appear: &lt;code&gt;[Rates by Crystal Ball Markets](https://crystalballmarkets.com/markets)&lt;/code&gt;. Do not mark it nofollow, ugc or sponsored.&lt;/li&gt;
&lt;li&gt;Calls from a server, an app or a script name the page that shows the figures (&lt;code&gt;site&lt;/code&gt;) and carry your own secret (&lt;code&gt;X-Site-Key&lt;/code&gt;). 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.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;li&gt;The figures are indicative, for information only. They are not an offer to buy or sell and must not be shown as dealing prices.&lt;/li&gt;
&lt;li&gt;Do not resell the files or offer them as a data feed of your own.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every site that calls the files from its pages, and every page named with &lt;code&gt;site&lt;/code&gt;, 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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is there an OpenAPI description?
&lt;/h2&gt;

&lt;p&gt;Yes: &lt;a href="https://crystalballmarkets.com/markets/api/openapi.json" rel="noopener noreferrer"&gt;openapi.json&lt;/a&gt;, 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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where do the figures come from?
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to read next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://crystalballmarkets.com/markets/rates-api" rel="noopener noreferrer"&gt;The rates API page&lt;/a&gt;: terms, field list and live examples&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://crystalballmarkets.com/markets/widgets" rel="noopener noreferrer"&gt;Free widgets&lt;/a&gt;: gold prices, converters and tickers to paste into a page, no code&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://crystalballmarkets.com/markets/learn/what-moves-the-gold-price" rel="noopener noreferrer"&gt;What moves the gold price&lt;/a&gt;, a lesson in our trading academy&lt;/li&gt;
&lt;li&gt;&lt;a href="https://crystalballmarkets.com/blog/gold-price-today-in-india-how-the-rate-is-set" rel="noopener noreferrer"&gt;Gold price today in India: how the rate is set&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to trade the markets behind these figures, you can &lt;a href="https://crystalballmarkets.com/register" rel="noopener noreferrer"&gt;open an account&lt;/a&gt; and use the same quotes on our platform. CFDs are complex and carry a high risk of losing money because of leverage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/index.en.html" rel="noopener noreferrer"&gt;European Central Bank: euro foreign exchange reference rates&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://frankfurter.dev/" rel="noopener noreferrer"&gt;Frankfurter: central bank reference rates&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Troy_weight" rel="noopener noreferrer"&gt;Troy weight: one troy ounce is 31.1034768 grams&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://spec.openapis.org/oas/v3.1.0.html" rel="noopener noreferrer"&gt;OpenAPI Specification 3.1.0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS" rel="noopener noreferrer"&gt;MDN: cross-origin resource sharing (CORS)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://crystalballmarkets.com/markets/api/v1/gold.json" rel="noopener noreferrer"&gt;gold.json&lt;/a&gt; and &lt;a href="https://crystalballmarkets.com/markets/api/v1/rates.json" rel="noopener noreferrer"&gt;rates.json&lt;/a&gt;, read at 17:39 UTC on 12 November 2026&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>api</category>
      <category>javascript</category>
      <category>python</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
