XE API: Get historical exchange rate
Gets XE's daily mid-market exchange rate for a past UTC date and converts an amount with it.
Unofficial. Not affiliated with or endorsed by XE.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Date, required
date Past date of the XE daily UTC table, for example 2024-01-15.
2023-06-12
- Amount optional
amount Amount of the starting currency to convert, for example 100.
25
Number. Default
1.- To Currency, required
to_currency Currency to convert to, by name or three-letter code, for example US Dollar or USD.
Japanese Yen
- From Currency, required
from_currency Currency to convert from, by name or three-letter code, for example euro or EUR.
euro
Input as JSON
{ "date": "2023-06-12", "amount": 25, "to_currency": "Japanese Yen", "from_currency": "euro"}Output
{ "date": "2023-06-12", "rate": 150.1492105901754, "to_currency": "JPY", "inverse_rate": 0.006660041675007197, "from_currency": "EUR", "table_page_link": "https://www.xe.com/currencytables/?from=EUR&date=2023-06-12" , "converted_amount": 3753.73, "to_currency_name": "Japanese Yen", "from_currency_name": "Euro"}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"xe.com/get_historical_rate","input":{"date":"2023-06-12","amount":25,"to_currency":"Japanese Yen","from_currency":"euro"}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "xe.com/get_historical_rate" , "input": { "date": "2023-06-12", "amount": 25, "to_currency": "Japanese Yen", "from_currency": "euro" }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "xe.com/get_historical_rate" , "input": { "date": "2023-06-12", "amount": 25, "to_currency": "Japanese Yen", "from_currency": "euro" } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run xe.com/get_historical_rate# with {"date":"2023-06-12","amount":25,"to_currency":"Japanese Yen","from_currency":"euro"}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "from_currency", "to_currency", "date" ], "properties": { "date": { "type": "string", "description": "Past date of the XE daily UTC table, for example 2024-01-15." }, "amount": { "type": "number", "default": 1, "description": "Amount of the starting currency to convert, for example 100." }, "to_currency": { "type": "string", "description": "Currency to convert to, by name or three-letter code, for example US Dollar or USD." }, "from_currency": { "type": "string", "description": "Currency to convert from, by name or three-letter code, for example euro or EUR." } }}Output schema
{ "type": "object", "required": [ "date", "from_currency", "from_currency_name", "to_currency", "to_currency_name", "rate", "inverse_rate", "converted_amount", "table_page_link" ], "properties": { "date": { "type": "string" }, "rate": { "type": "number" }, "to_currency": { "type": "string" }, "inverse_rate": { "type": "number" }, "from_currency": { "type": "string" }, "table_page_link": { "type": "string" }, "converted_amount": { "type": "number" }, "to_currency_name": { "type": "string" }, "from_currency_name": { "type": "string" } }}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
xe.com/get_historical_rate- Returns
- date, currency codes and names, rate, inverse rate, converted amount, table link
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method xe.com/get_historical_rate with the inputs above.
Ask your agent
- What was the mid-market rate for converting 250 euros to US dollars on 2024-03-08?
- How much were 1000 Japanese yen worth in British pounds on 2023-11-22?
- Look up the XE daily rate from Canadian dollar to Swiss franc for 2022-06-30, amount 500.
- Convert 75 Australian dollars into Indian rupees using the historical rate from 2024-01-15 on xe.com.
- I need the inverse rate and table link for pounds sterling to euro on 2021-09-14 for a 320 GBP conversion.
See more
All XE methodsConverts an amount between two currencies using XE's displayed mid-market rate. It also returns the rate time and an XE converter link. Rates are informational, not transfer quotes.
xe.com/convert_currencyGets Wise's current mid-market exchange rate and converted amount for two currencies, with optional daily rate history.
wise.com/get_exchange_rateConverts an amount between currencies using ECB euro reference rates, including euro and cross-currency conversions. Uses the latest preceding published rate when the date has none.
ecb.europa.eu/convert_currencyGets the official ECB euro reference exchange rates for a day, or the latest published day. Weekends, holidays and dates before publication return the previous published day.
ecb.europa.eu/get_euro_exchange_ratesConverts an amount between two currencies using the current Google Finance quote. Rates may be delayed.
google.com/convert_currencyGets the U.S. Treasury quarterly reporting exchange rate for a country or currency on a given date. If that quarter has no published record, it uses the latest preceding quarter.
treasury.gov/get_reporting_exchange_ratesGets a coin's price, market cap and 24-hour volume at 00:00 UTC on a past date. Non-USD currencies are available only for the last 365 days.
coingecko.com/get_coin_price_on_dateFinds the closest Wayback Machine capture of a web page to a past date and returns its title and readable text.
web.archive.org/get_archived_page