Reference · Public data

Foreign exchange rates

Daily Euro and US Dollar reference exchange rates for 41 currencies since 1999.

European Central Bank (Euro foreign exchange reference rates) · Free reuse with attribution · commons_pubdata.reference.fx_rates

Read Markdown

Registered, not loaded yet: the table is not in the catalog. This page fills in after its first refresh.

Query it with DuckDB.

Bash
lhbox duckdb --catalog commons/pubdata
SQL · Latest exchange rates for the major currencies
SELECT date, currency, round(rate_per_eur, 4) AS per_eur, round(usd_per_unit, 4) AS usd_per_unit
FROM commons_pubdata.reference.fx_rates
WHERE date = (SELECT max(date) FROM commons_pubdata.reference.fx_rates)
  AND currency IN ('USD', 'GBP', 'JPY', 'CHF', 'CAD', 'AUD', 'CNY', 'BRL', 'INR', 'MXN')
ORDER BY currency;

Read it where you work.

Public, read-only data. With an account, lhbox duckdb attaches the catalog as commons_pubdata; an agent with the LakehouseBox connector opens it with open_public_catalog("commons/pubdata"). Without one, DuckDB reads the public files directly.

More example queries

  • Convert your daily invoices in local currency into EUR and USD (carrying Friday's rate over weekends)
    SQL
    SELECT i.invoice_id, i.invoice_date, i.currency, i.amount,
           round(i.amount * fx.eur_per_unit, 2) AS amount_eur,
           round(i.amount * fx.usd_per_unit, 2) AS amount_usd
    FROM my.invoices AS i
    ASOF JOIN commons_pubdata.reference.fx_rates AS fx
      ON i.currency = fx.currency AND i.invoice_date >= fx.date;

Know your columns.

ColumnTypeMeaning
datedatereference business day (CET, no weekend or TARGET holiday rows)
currencystringISO 4217 3-letter currency code (joins reference.countries on currency_code)
rate_per_eurdoubleunits of currency per 1 EUR (the official ECB quote)
eur_per_unitdoubleEUR per 1 unit of currency (multiply an amount in currency by this to get EUR)
usd_per_unitdoubleUSD per 1 unit of currency (multiply an amount in currency by this to get USD)

Join keys: date, currency.

Before you query.

  1. The ECB publishes rates only on TARGET business days (no Saturdays, Sundays or ECB holidays).
  2. When converting daily transactions that include weekends or holidays, use DuckDB's `ASOF JOIN ...
  3. ON t.currency = fx.currency AND t.date >= fx.date` so weekend dates pick up the preceding Friday's rate.
  4. EUR itself is included with rate_per_eur = 1.0 and eur_per_unit = 1.0 so a join never drops Euro-denominated rows.

Source & licence.

Source
European Central Bank (Euro foreign exchange reference rates)
Licence
Free reuse with attribution (ECB statistics reuse policy)
Attribution
Source: European Central Bank (ECB), Euro foreign exchange reference rates.
Coverage
41 major world currencies (ISO 4217); 1999-01-04 to the latest TARGET business day
Refresh
daily, the whole table replaced; source version n/a
Table
commons/pubdata · reference.fx_rates · Iceberg v? · browse the catalog
Recipe
pubdata/recipes/fx_rates.py, registry entry pubdata/registry/fx_rates.yaml

Source: European Central Bank (Euro foreign exchange reference rates) · Free reuse with attribution · Snapshot shown: not loadedHTML for people. Markdown for agents.