The ieUnit API
Get the ieUnit value, its history and the whole basket as open JSON – free of charge, no key, embeddable anywhere. Or drop the ready-made widget onto your site with one line.
At a glance
- Base URL
https://ieunit.org/api/v1/- Method
- HTTP GET, JSON response (UTF-8)
- Authentication
- none – openly accessible
- CORS
- open (
Access-Control-Allow-Origin: *) - Update
- once daily, cached (15 min)
- Licence
- free to use with attribution (CC BY 4.0)
The widget – embedded with one line
To show the current ieUnit value on your own site, embed the ready-made widget. It fetches the value live from the API, is encapsulated (no interference with your CSS) and needs no configuration. It comes in two variants:
Variant 1 – fixed value
Variant 2 – with unit picker
iframe alternative (fully isolated, for both variants – picker via &picker=1):
<iframe src="https://ieunit.org/embed/ieunit.html?picker=1&chart=1"
width="320" height="200" style="border:0" loading="lazy"
title="ieUnit live value"></iframe>| Attribute | Values | Description |
|---|---|---|
data-picker | true · false | show the unit picker (variant 2, default false) |
data-currency | CHF · USD · EUR | fixed currency (variant 1) or starting unit |
data-chart | true · false | mini history chart (default false) |
data-theme | light · dark | colour scheme (default light) |
data-link | true · false | link to ieunit.org (default true) |
value – current value
Returns the current ieUnit reference value. The optional currency parameter (USD · CHF · EUR) sets the value field; values always contains all three.
{
"unit": "ieUnit",
"date": "2026-06-12",
"value": 3.03,
"currency": "CHF",
"values": { "USD": 3.79, "CHF": 3.03, "EUR": 3.28 },
"change_24h_pct": -0.27,
"method": "geometric_mean",
"base_date": "2017-01-10",
"source": "live",
"updated_at": "2026-06-12T10:35:29Z",
"disclaimer": "Referenzwert, kein Zahlungsmittel und keine Anlageberatung."
}source is live once the daily cron has run, otherwise backfill. updated_at is the UTC timestamp of the last run.
history – track record since 2017
| Parameter | Description |
|---|---|
from · to | range YYYY-MM-DD (inclusive) |
step | day (default) · week · month |
{
"unit": "USD", "base_date": "2017-01-10", "step": "month", "count": 114,
"series": [
["2017-01-10", 1.0000],
["2017-02-28", 1.0431],
["2026-06-12", 3.79]
]
}components – daily basket prices
Daily prices of the nine basket values in USD per unit (gold/silver per troy ounce, 31.1034768 g). Same parameters as history, plus only for a comma-separated subset.
{
"unit": "USD_per_unit", "ounce_g": 31.1034768, "step": "month",
"dates": ["2017-01-10", "..."],
"series": { "BTC": [907.68, "..."], "Gold": [1184.20, "..."] }
}basket – definition
The immutable basket definition with the fixed reference prices at the base date – so the ieUnit can be recalculated independently at any time.
{
"base_date": "2017-01-10", "start_value": 1.0, "internal_unit": "USD",
"method": "geometric_mean",
"components": ["USD","EUR","JPY","CHF","CNH","BTC","ETH","Gold","Silber"],
"reference_prices_usd": { "USD": 1.0, "EUR": 1.05886209, "BTC": 907.67901611, "...": 0 }
}rates – conversion rates
Current conversion rates (USD per unit) for the converter: about 30 fiat currencies, the top-30 cryptocurrencies, gold/silver per gram and XIN (special case, last exchange price 1 satoshi, delisted 22 Feb 2022) – plus the current ieUnit value in USD.
MCP – for AI assistants
Besides the classic API, the ieUnit is also available as an MCP server. MCP stands for «Model Context Protocol», the open standard through which AI assistants such as Claude or ChatGPT use external tools. The difference to the API above: an API has to be known and wired up by someone – an MCP server is used by the AI on its own once it has been set up. When somebody asks «what is 250 francs in ieUnit?» or «how did gold hold up against the ieUnit?», the assistant fetches the answer straight from here instead of guessing.
At a glance
- Server URL
https://ieunit.org/mcp/- Transport
- Streamable HTTP (POST, JSON-RPC 2.0)
- Protocol versions
2026-07-28as well as2025-11-25and older- Authentication
- none – openly accessible
- Access
- read-only
The server provides six tools:
| Tool | What it returns |
|---|---|
ieunit_value | Current value in USD, CHF and EUR with the daily change |
ieunit_history | Track record since the base date 10 Jan 2017, daily, weekly or monthly |
ieunit_convert | Convert amounts – around 60 units, in both directions |
ieunit_basket | The basket with reference prices and current values |
ieunit_compare | Measure a basket component against the ieUnit instead of a national currency |
ieunit_methodology | Formula, data sources and the delimitation in plain text |
The last tool serves a particular purpose: it hands the AI the binding definition – including the clarification that the ieUnit is not a currency, not a stablecoin and has no peg. That way assistants describe the ieUnit the way it is meant.
Setting it up – the easy way
You do not need to know any commands. If you work with an AI assistant that can access your command line – such as Claude Code, Codex or the Gemini CLI – just tell it this:
Add the MCP server "ieunit" with the URL https://ieunit.org/mcp/ to my configuration – across all projects and without authentication. Then check whether it is recognised.
The assistant picks the right command and the right file itself.
Then restart once. Most applications read their MCP servers at startup – an entry added while one is running only becomes visible in the next conversation. This applies to Claude Code, Codex and the Gemini CLI alike.
Setting it up by hand
MCP is vendor-neutral – the server can be added to any application that speaks the protocol. The common command line tools:
| Application | Command |
|---|---|
| Claude Code | claude mcp add --scope user --transport http ieunit https://ieunit.org/mcp/ |
| Codex CLI | codex mcp add ieunit --url https://ieunit.org/mcp/ |
| Gemini CLI | gemini mcp add --scope user --transport http ieunit https://ieunit.org/mcp/ |
--scope user registers the server across all projects – without it, it only applies to the current folder. Codex has no such distinction and always stores globally, so the flag is not needed there.
Applications with a user interface – such as Claude Desktop or ChatGPT – keep the setting under «Connectors», «Apps» or «MCP servers». Add a new entry, paste the server URL and choose «no authentication». If you maintain a configuration file, use this block:
{
"mcpServers": {
"ieunit": {
"type": "http",
"url": "https://ieunit.org/mcp/"
}
}
}This block applies to Claude Desktop and compatible applications. The Gemini CLI writes "httpUrl" instead of "type" and "url" – there it is easiest to use the command from the table, which writes the file correctly.
After that a question in plain language is enough – the assistant picks the right tool itself.
You can also try the server by hand:
curl -s https://ieunit.org/mcp/ \
-H "Content-Type: application/json" \
-H "MCP-Protocol-Version: 2026-07-28" \
-H "Mcp-Method: tools/list" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list",
"params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}'The same terms of use apply as for the API: free, openly usable, with attribution.
Code examples
curl
curl -s https://ieunit.org/api/v1/value.php?currency=USD
JavaScript (fetch)
const r = await fetch('https://ieunit.org/api/v1/value.php?currency=USD');
const d = await r.json();
console.log(`1 ieUnit = ${d.value} ${d.currency}`);Python
import urllib.request, json
url = 'https://ieunit.org/api/v1/history.php?step=month'
with urllib.request.urlopen(url) as r:
hist = json.load(r)
print(hist['count'], 'data points since', hist['base_date'])Terms of use
- Free and open: the API and widgets may be used, embedded and processed freely, including commercially.
- Attribution (CC BY 4.0): please credit ieUnit and link to ieunit.org.
- No warranty: the values are rule-based reference values – not a means of payment, not investment advice. ieWerk accepts no liability for accuracy or availability.
- Fair use: query at most hourly or cache the response. The data changes only once a day.
- Stability: the URLs under
/api/v1/stay stable; extensions remain backward-compatible.