Frankfurter

Star

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. If preferred, you can self-host with Docker.

Usage

Frankfurter provides endpoints to retrieve latest rates, historical data, or time series.

Latest Rates
Fetch the latest working day's rates, updated daily around 16:00 CET.
/* curl -s https://api.frankfurter.app/latest */
Change the base currency using the base parameter. The default is EUR.
/* curl -s https://api.frankfurter.app/latest?base=USD */
Limit the response to specific target currencies.
/* curl -s https://api.frankfurter.app/latest?symbols=CHF */
Historical Rates
Retrieve rates for a specific past date.
/* curl -s https://api.frankfurter.app/1999-01-04 */
Change the base currency and filter target currencies.
/* curl -s https://api.frankfurter.app/1999-01-04?base=USD&symbols=EUR */
Time Series Data
Fetch rates over a period.
/* curl -s https://api.frankfurter.app/2000-01-01..2000-12-31 */
Fetch rates up to the present.
/* curl -s https://api.frankfurter.app/2024-01-01.. */
Tip: Filter currencies to reduce response size and improve performance.
/* curl -s https://api.frankfurter.app/2024-01-01..?symbols=USD */
Available currencies
Get supported currency symbols and their full names.
/* curl -s https://api.frankfurter.app/currencies */
Currency Conversion
Perform currency conversion by fetching the exchange rate and calculating in your code.
function convert(from, to, amount) {
  fetch(`https://api.frankfurter.app/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);
Click or tap to execute the code.

Deployment

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 \
  -e "DATABASE_URL=$POSTGRES_URL" \
  hakanensari/frankfurter

Notes

  1. For high-volume queries, it’s more efficient to query the European Central Bank data directly server-side than through our API.