DEV Community

Jenpo Zhan
Jenpo Zhan

Posted on

Embed a Historical Exchange Rate Widget in Any Blog or Dashboard

Finance blogs, spreadsheet templates, travel-money pages, and internal dashboards often need a small historical exchange rate lookup without building a full currency tool from scratch.

FXpeek now has an embeddable widget that can be added with one div and one script tag.

Quick embed

<div
  data-fxpeek-widget
  data-from="USD"
  data-to="IDR"
  data-amount="100"
  data-locale="en"
></div>
<script async src="https://fxpeek.com/embed/fxpeek-widget.js"></script>
Enter fullscreen mode Exit fullscreen mode

The script creates a lightweight iframe with:

  • amount input
  • from and to currency selectors
  • a reference conversion result
  • links back to the matching FXpeek history chart and API docs

Live widget page

You can test the widget here:

https://fxpeek.com/en/widget?utm_source=devto&utm_medium=article&utm_campaign=fxpeek_wave1_api_csv&utm_content=embeddable_fx_widget

Available options

Attribute Example Notes
data-from USD Base currency code.
data-to IDR Target currency code.
data-amount 100 Amount to convert.
data-locale en Supported values: en, zh, id, vi, th, tl.
data-height 360 Optional iframe height in pixels.
data-max-width 520px Optional iframe max width.

Basic demo page

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>FXpeek Widget Demo</title>
  </head>
  <body>
    <h1>USD to IDR reference widget</h1>

    <div
      data-fxpeek-widget
      data-from="USD"
      data-to="IDR"
      data-amount="100"
      data-locale="en"
    ></div>
    <script async src="https://fxpeek.com/embed/fxpeek-widget.js"></script>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode

GitHub examples

The public widget repo includes a README and a basic HTML demo:

https://github.com/Jenpo/fxpeek-exchange-rate-widget

API docs

If you would rather build your own chart or table, use the JSON and CSV endpoints:

https://fxpeek.com/en/api?utm_source=devto&utm_medium=article&utm_campaign=fxpeek_wave1_api_csv&utm_content=embeddable_fx_widget_api

Data note

FXpeek rates are reference data for historical lookup, reporting, spreadsheet, and lightweight API workflows. They are not transaction quotes, settlement rates, tax advice, trading signals, or financial advice.

Top comments (0)