Frankfurter

Star

Frankfurter is a free 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
Returns the country of the IP making the request, typically the user's browser or app.
/* 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);
Note: 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. If you require to run high-volume queries server-side, consider querying the European Central Bank data directly.
  2. We called it Frankfurter because that's where the European Central Bank hangs its hat.