Embeddable Price Widgets
Show live metal prices on any website with an embeddable widget. No backend code, and no API key in your page.
Overview
Widgets are ready-made price boards that you configure in the dashboard and embed on any website. They load from MetalAPI directly, so there is no backend code to write and your API key never appears in your page.
Every plan includes widgets: 1 on Free, 3 on Lite, 10 on Standard and up to 500 on Enterprise. You can see examples on the widgets page.
Create a widget
- Sign in and open Widgets in the dashboard.
- Create a new widget and give it a name.
- Pick the symbols to show (metals, energy, currencies or crypto) and the currency to price them in.
- Choose a layout and theme, then save.
- Copy the embed code.
Embed it on your site
Paste the embed code from the dashboard where the widget should appear. Widgets are served from metalapi.com/embed/… and can be framed by any site, so they work in plain HTML pages, WordPress, Shopify themes and site builders alike. An embed looks like this:
<iframe
src="https://metalapi.com/embed/YOUR_WIDGET_ID"
title="Live precious metal prices"
width="100%"
height="320"
style="border:0"
loading="lazy"
></iframe>Use the exact snippet from the dashboard, since it contains your widget’s ID.
Updating a widget
Changes you save in the dashboard apply to every page that embeds the widget. You don't need to update the snippet on your site.
When to use the API instead
Widgets cover the common case of displaying prices. If you need your own design, calculations or prices inside an app, call the API from your server, or from the browser with a domain-restricted key.
Related guides
Ready to start building?
Create a free account to get your API key, or explore every endpoint in the API reference.