DEV Community

allratestoday
allratestoday

Posted on

Free Exchange Rate API with No API Key: One URL, Any Base Currency, CORS On

Most "free" currency APIs still make you sign up, confirm an email and paste a key into your code before the first request. For a side project, a prototype or a static site, that's friction you don't need.

AllRatesToday has an open endpoint for exactly this case. There's no key and no account:

https://allratestoday.com/api/open/latest/USD
Enter fullscreen mode Exit fullscreen mode

Replace USD with any of the 30 currencies in the European Central Bank's daily table (EUR, GBP, JPY, INR, AUD, CAD, CHF, CNY...).

What comes back

{
  "result": "success",
  "base_code": "USD",
  "date": "2026-11-25",
  "time_last_update_utc": "Wed, 25 Nov 2026 15:00:00 GMT",
  "time_next_update_utc": "Thu, 26 Nov 2026 15:00:00 GMT",
  "source": "European Central Bank reference rates, served by AllRatesToday",
  "attribution": "Exchange rates by AllRatesToday — https://allratestoday.com",
  "rates": { "USD": 1, "EUR": 0.91449474, "GBP": 0.76570645, "JPY": 159.32327, "...": "..." }
}
Enter fullscreen mode Exit fullscreen mode
  • rates is units of each currency per 1 unit of base_code.
  • date is the ECB table the rates come from. They're daily reference rates, updated once a day after the ECB's afternoon fixing, not a live feed.
  • time_next_update_utc tells you when to fetch again.

curl

curl -s https://allratestoday.com/api/open/latest/EUR | jq '.rates.USD'
Enter fullscreen mode Exit fullscreen mode

JavaScript (works in the browser)

The endpoint sends Access-Control-Allow-Origin: *, so a static page can call it directly, with no backend and no proxy:

const res = await fetch("https://allratestoday.com/api/open/latest/USD");
const { rates, date } = await res.json();

const convert = (amount, to) => +(amount * rates[to]).toFixed(2);
console.log(`100 USD = ${convert(100, "EUR")} EUR (ECB table of ${date})`);
Enter fullscreen mode Exit fullscreen mode

Python

import requests

data = requests.get("https://allratestoday.com/api/open/latest/GBP", timeout=10).json()
print(f"1 GBP = {data['rates']['USD']} USD  (table of {data['date']})")
Enter fullscreen mode Exit fullscreen mode

Cache it: the table changes once a day

The open endpoint is rate limited per IP (about one request a minute; above that you get 429 with a Retry-After header). Since the table only changes once a day, cache the response and serve every conversion from the cache:

let cache = null;

async function getRates(base = "USD") {
  if (cache && cache.base === base && Date.now() < cache.expires) return cache.rates;
  const r = await fetch(`https://allratestoday.com/api/open/latest/${base}`);
  if (r.status === 429) {
    if (cache) return cache.rates;                   // serve the stale table rather than fail
    throw new Error("rate limited, retry after " + r.headers.get("Retry-After") + "s");
  }
  const d = await r.json();
  cache = { base, rates: d.rates, expires: Date.parse(d.time_next_update_utc) };
  return d.rates;
}
Enter fullscreen mode Exit fullscreen mode

The response already carries Cache-Control: public, max-age=1800, so browsers and CDNs will help on their own.

The one condition: a link, on public pages only

The open endpoint is free for personal and commercial use. If you show the rates on a public web page, add a visible link there:

<a href="https://allratestoday.com">Exchange rates by AllRatesToday</a>
Enter fullscreen mode Exit fullscreen mode

Back-end use (invoicing, reports, scheduled jobs, internal tools) needs no link. Every response carries the text in attribution and attribution_html, so you can render it straight from the payload.

When to move to a free key

The open endpoint gives you daily ECB-based rates for 30 currencies. Get a free API key (no card) when you need:

  • Live rates, mid-market and updated every 60 seconds, for 160+ currencies.
  • Several targets in one call (target=EUR,GBP,JPY).
  • Official tables from 130+ central banks and tax authorities, in JSON, CSV, XML or Excel.
curl "https://allratestoday.com/api/v1/rates?source=USD&target=EUR,GBP,JPY" \
  -H "Authorization: Bearer art_live_your_key"
Enter fullscreen mode Exit fullscreen mode

Links

Exchange rates by AllRatesToday. The open endpoint serves the European Central Bank's official reference rates.

Top comments (0)