A zero-dependency command-line client for the Frankfurter foreign-exchange API. Daily reference rates from 84 central banks, 201 currencies, back to 1948 — no API key, no login. Single file, Python 3 stdlib only, with a --json flag on every command so it drops straight into scripts and pipes into jq.
1pipx install exrate # or: pip install exrate
Commands
1exrate rate EUR USD # latest single pair
2exrate rate EUR USD --date 2020-03-15 # historical
3exrate convert 100 USD JPY # convert an amount (client-side)
4exrate rates --base USD --quotes EUR,GBP,JPY # several pairs at once
5exrate rates --from 2026-01-01 --quotes USD # daily time series
6exrate rates --from 2026-01-01 --group month # downsample to monthly
7exrate rates --from 2026-01-01 --quotes USD --csv # native CSV
8exrate currency AED # details + peg metadata
9exrate providers # data sources / their keys
1exrate currencies --json | jq -r '.[].iso_code' # script the code list
Notes
- Agent-friendly help. Running
exratewith no args prints full help (exit 0, not an error), and every subcommand documents its modes, exact JSON field names, and examples — so a tool-using LLM can drive it without trial and error. - Conversion is client-side. The API has no conversion endpoint, so
convertfetches the pair rate and multiplies, matching the official docs’ approach. - Provider control. Rates are blended across providers by default; pass
--providers ECBto pin a single official source. Clean exit codes: 0 success, 1 API/network error, 2 bad usage. - Releases publish to PyPI automatically via GitHub Actions + Trusted Publishing (OIDC, no stored tokens).