d97bc6f
Frankfurter is a free, open-source API for current and historical foreign exchange rates. It is based on data sets published by the European Central Bank.
No usage caps or API keys. Works great client-side in the browser or mobile apps. The public API is available at api.frankfurter.dev. If preferred, you can self-host.
Frankfurter provides endpoints to retrieve latest rates, historical data, or time series.
/* curl -s https://api.frankfurter.dev/v1/latest */
{
"base": "EUR",
"date": "2024-11-25",
"rates": {
"AUD": 1.6111,
"BGN": 1.9558,
"BRL": 6.0941,
"CAD": 1.4648,
"...": "..."
}
}
base
parameter. The default is EUR. /* curl -s https://api.frankfurter.dev/v1/latest?base=USD */
{
"base": "USD",
"date": "2024-11-25",
"rates": {
"AUD": 1.5351,
"BGN": 1.8636,
"BRL": 5.8067,
"CAD": 1.3957,
"...": "..."
}
}
/* curl -s https://api.frankfurter.dev/v1/latest?symbols=CHF */
{
"base": "EUR",
"date": "2024-11-25",
"rates": {
"CHF": 0.9324
}
}
/* curl -s https://api.frankfurter.dev/v1/1999-01-04 */
{
"base": "EUR",
"date": "1999-01-04",
"rates": {
"AUD": 1.91,
"CAD": 1.8004,
"CHF": 1.6168,
"CYP": 0.58231,
"...": "..."
}
}
/* curl -s https://api.frankfurter.dev/v1/1999-01-04?base=USD&symbols=EUR */
{
"base": "USD",
"date": "1999-01-04",
"rates": {
"EUR": 0.84825
}
}
/* curl -s https://api.frankfurter.dev/v1/2000-01-01..2000-12-31 */
{
"base": "EUR",
"start_date": "1999-12-30",
"end_date": "2000-12-29",
"rates": {
"1999-12-30": {
"AUD": 1.5422,
"CAD": 1.4608,
"CHF": 1.6051,
"CYP": 0.57667,
"...": "..."
},
"2000-01-03": {
"AUD": 1.5346,
"CAD": 1.4577,
"CHF": 1.6043,
"CYP": 0.5767,
"...": "..."
},
"2000-01-04": {
"AUD": 1.5677,
"CAD": 1.4936,
"CHF": 1.6053,
"CYP": 0.5775,
"...": "..."
},
"2000-01-05": {
"AUD": 1.5773,
"CAD": 1.5065,
"CHF": 1.606,
"CYP": 0.5778,
"...": "..."
},
"...": "..."
}
}
/* curl -s https://api.frankfurter.dev/v1/2024-01-01.. */
{
"base": "EUR",
"start_date": "2023-12-29",
"end_date": "2024-11-25",
"rates": {
"2023-12-29": {
"AUD": 1.6263,
"BGN": 1.9558,
"BRL": 5.3618,
"CAD": 1.4642,
"...": "..."
},
"2024-01-02": {
"AUD": 1.6147,
"BGN": 1.9558,
"BRL": 5.3562,
"CAD": 1.4565,
"...": "..."
},
"2024-01-03": {
"AUD": 1.6236,
"BGN": 1.9558,
"BRL": 5.3859,
"CAD": 1.4574,
"...": "..."
},
"2024-01-04": {
"AUD": 1.628,
"BGN": 1.9558,
"BRL": 5.3761,
"CAD": 1.4603,
"...": "..."
},
"...": "..."
}
}
/* curl -s https://api.frankfurter.dev/v1/2024-01-01..?symbols=USD */
{
"base": "EUR",
"start_date": "2023-12-29",
"end_date": "2024-11-25",
"rates": {
"2023-12-29": {
"USD": 1.105
},
"2024-01-02": {
"USD": 1.0956
},
"2024-01-03": {
"USD": 1.0919
},
"2024-01-04": {
"USD": 1.0953
},
"...": "..."
}
}
/* curl -s https://api.frankfurter.dev/v1/currencies */
{
"AUD": "Australian Dollar",
"BGN": "Bulgarian Lev",
"BRL": "Brazilian Real",
"CAD": "Canadian Dollar",
"...": "..."
}
function convert(from, to, amount) {
fetch(`https://api.frankfurter.dev/v1/latest?base=${from}&symbols=${to}`)
.then((resp) => resp.json())
.then((data) => {
const convertedAmount = (amount * data.rates[to]).toFixed(2);
alert(`${amount} ${from} = ${convertedAmount} ${to}`);
});
}
convert("EUR", "USD", 10);
If you prefer not to use our hosted service, you can self-host with Docker.
# Runs frankfurter on port 8080
docker run -d -p 8080:8080 \
--pull always \
lineofflight/frankfurter