Home Documentation Playground Pricing API Status Blog About FAQ Support

Currency Converter Widget — AllRatesToday Documentation

Embed a free, real-time currency converter on any website with one line of code. Requires a free AllRatesToday API key. JavaScript and iframe embeds, full attribute reference.

A free API key is required. The widget calls a keyed, rate-limited endpoint so usage is attributed to your account and bounded by your plan's quota. Create a free account to get a key, then see the full API reference for everything else.

Currency Converter Widget

A drop-in, real-time currency converter you can embed on any website. It uses the same live mid-market rates as the AllRatesToday API, covers 150+ currencies, and isolates its styles (Shadow DOM) so it never clashes with your page's CSS. There's also a live preview on the widget page.

1. Get an API key

  1. Register a free account and verify your email.
  2. Copy your API key from the dashboard — it looks like art_live_….

The free tier needs no credit card. Every conversion the widget performs counts as one request against your plan's monthly quota — see pricing.

2. JavaScript embed (recommended)

Paste this where you want the converter to appear, replacing YOUR_API_KEY:

<!-- AllRatesToday currency converter -->
<div class="art-currency-widget" data-api-key="YOUR_API_KEY" data-base="USD" data-target="EUR"></div>
<a href="https://allratestoday.com">Powered by AllRatesToday</a>
<script async src="https://allratestoday.com/widget.js"></script>

iframe embed

No JavaScript required — works on any CMS, including ones that strip scripts. Pass the key in the key= query parameter:

<iframe
  src="https://allratestoday.com/embed/converter?key=YOUR_API_KEY&base=USD&target=EUR&theme=light"
  width="400" height="320" frameborder="0" loading="lazy"
  title="Currency converter by AllRatesToday"></iframe>

Attributes

AttributeDefaultDescription
data-api-keyRequired. Your API key (use key= on the iframe URL)
data-baseUSDStarting "from" currency (ISO 4217)
data-targetEURStarting "to" currency (ISO 4217)
data-amount1Starting amount
data-themelightlight or dark

The endpoint it calls

The widget is a thin client over a single keyed endpoint. You can call it directly if you'd rather build your own UI:

GET https://allratestoday.com/api/widget/rate?source=USD&target=EUR&key=YOUR_API_KEY

Response:

{ "rate": 0.8663, "source": "refinitiv" }

The key may also be sent as a header: Authorization: Bearer YOUR_API_KEY. The endpoint sends Access-Control-Allow-Origin: *, so it works from the browser on any domain.

Error responses

StatusMeaningWidget shows
400Missing source or target
401Missing, invalid, or disabled API key"Invalid API key" + register link
429Monthly request limit exceeded"Monthly limit reached" + upgrade link
502Upstream rate provider error"Rate unavailable"

A note on key visibility

Because the widget runs in the browser, the API key is visible in your page's source — this is normal for client-side keys. Usage is always counted against your quota, and you can disable or rotate a key anytime from the dashboard. For server-to-server use, keep your key on the backend and call the authenticated rates endpoint instead.

License & attribution

The widget script is MIT-licensed. Please keep the "Powered by AllRatesToday" link in your embed — it's how we keep the free tier sustainable.