Fetch and query exchange rate data published by the European Central Bank.
Rates are stored locally in a SQLite database and can be queried offline. Cross-rates between non-EUR currencies are calculated from their respective EUR reference rates.
Downloads the full historical dataset (~27 years of daily rates):
ecbx initializeecbx updateecbx status
ecbx --verbose status # also lists all available currenciesThe date argument is currently required in practice — defaulting to the latest available rate when no date is given is a known limitation.
# Specific date
ecbx convert 2024-01-05 EUR USD 100
# Compact date format also works
ecbx convert 20240105 EUR USD 100# Latest available date
ecbx rates
# Specific date
ecbx rates 2024-01-05ecbx matrix 2024-01-05 USD
ecbx matrix --format json 2024-01-05 USDecbx currencies| Option | Description |
|---|---|
--db PATH |
Use a custom database file instead of the default XDG path |
--verbose |
Show additional information |
The default database is stored at $XDG_CONFIG_HOME/ecbx/rates.db (usually ~/.config/ecbx/rates.db).