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. No API key needed — just keep the attribution link. JavaScript and iframe embeds, full attribute reference.

No API key needed. Keyless embeds use our open community endpoint — just keep the "Powered by AllRatesToday" attribution link visible. Add a free API key for dedicated quota and usage stats in your dashboard.

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.

JavaScript embed (recommended)

Paste this where you want the converter to appear — it works immediately, no signup:

<!-- AllRatesToday currency converter (no API key needed) -->
<div class="art-currency-widget" 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:

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

Attributes

AttributeDefaultDescription
data-api-keyOptional. Your API key for dedicated quota + stats (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

Optional: add a free API key

Without a key the widget shares the open community endpoint's fair-use pool. With a free key (data-api-key="art_live_…") conversions run on your plan's dedicated quota and show up in your dashboard — see pricing.

The endpoints it calls

The widget is a thin client. Keyless embeds call the open endpoint (GET /api/rate?source=USD&target=EUR); keyed embeds call the keyed endpoint below. You can call either 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
401Invalid or disabled API key (keyed mode only)"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. The "Powered by AllRatesToday" link must remain visible on keyless embeds — it's how we keep the open endpoint free for everyone. Keyed embeds are welcome to keep it too.