DEV Community

Oleksandr Kaiukov
Oleksandr Kaiukov

Posted on • Originally published at currencyexchangetool.com

Free Currency Converter API for JavaScript — No Key, CORS Enabled (2026)

If you're building a web app and need live exchange rates, most APIs require signup, an API key, or a credit card. Not this one. The Currency Exchange Tool API is completely open — no registration, no auth, CORS enabled. Call it directly from browser JavaScript with fetch().

Why This API?

Feature This API ExchangeRate-API Fixer.io
API Key Required No Yes Yes
Signup Required No Yes Yes
CORS Enabled Yes No (proxy needed) No
Currencies 100+ 160 170
Monthly Limit No cap 1,500 100
Rate Updates Live Daily Daily

Quick Start — 3 Lines

const res = await fetch(
  'https://www.currencyexchangetool.com/api/v1/convert?amount=100&from=USD&to=EUR'
);
const data = await res.json();
console.log(`100 USD = ${data.result} EUR at rate ${data.rate}`);
Enter fullscreen mode Exit fullscreen mode

No headers, no tokens, no SDK. Just a GET request.

Complete Converter Class

class CurrencyConverter {
  constructor() {
    this.baseUrl = 'https://www.currencyexchangetool.com/api/v1';
  }

  async convert(amount, from, to) {
    const url = `${this.baseUrl}/convert?amount=${amount}&from=${from}&to=${to}`;
    const res = await fetch(url);

    const remaining = res.headers.get('X-RateLimit-Remaining');
    if (remaining === '0') {
      const retryAfter = res.headers.get('Retry-After') || 60;
      throw new Error(`Rate limited. Retry after ${retryAfter} seconds.`);
    }

    if (!res.ok) {
      const err = await res.json();
      throw new Error(err.error || `HTTP ${res.status}`);
    }

    const data = await res.json();
    return {
      from: data.from, to: data.to,
      amount: data.amount, rate: data.rate,
      result: data.result,
      change24h: data.changePct24h,
      updatedAt: new Date(data.updatedAt),
    };
  }

  async getCurrencies() {
    const res = await fetch(`${this.baseUrl}/currencies`);
    return (await res.json()).currencies;
  }
}
Enter fullscreen mode Exit fullscreen mode

React Hook

function useExchangeRate(from, to) {
  const [data, setData] = useState(null);

  useEffect(() => {
    let cancelled = false;
    fetch(`https://www.currencyexchangetool.com/api/v1/convert?amount=1&from=${from}&to=${to}`)
      .then(r => r.json())
      .then(json => { if (!cancelled) setData(json); });
    return () => { cancelled = true; };
  }, [from, to]);

  return data;
}
Enter fullscreen mode Exit fullscreen mode

Rate Limiting

  • X-RateLimit-Limit — 100 req/min
  • X-RateLimit-Remaining — requests left
  • When exhausted: HTTP 429 + Retry-After header

Google Sheets

=VALUE(IMPORTXML(
  "https://www.currencyexchangetool.com/api/v1/convert?amount=1&from=USD&to=EUR&format=xml",
  "/response/rate"
))
Enter fullscreen mode Exit fullscreen mode

Full docs: currencyexchangetool.com/api-docs

Top comments (0)