Skip to main content

ecb-exchange-rate

Official European Central Bank exchange rates — ~41 currencies vs EUR, history since 1999.

pip install ecb-exchange-rate
from ecb_exchange_rate import get_rate

pair = get_rate("USD", "EUR")
print(pair["rate"], "published", pair["rate_date"])

No API key needed for the latest published table.

What these rates are

The numbers European Central Bank itself publishes — fixed once published, carrying the institution's own date. Tax filings, customs valuations, invoicing rules and statutory accounts generally require this published rate, not a live market rate; the two routinely differ by a percent or more.

For live mid-market rates, use allratestoday. For all 100+ sources in one package, use allratestoday-central-bank.

API

Function API key? Returns
get_latest_rates() no Newest published table
get_rate(source, target) no One pair from it
get_rates_for_date(date, ...) yes The table in force on a date
get_history(symbol=..., from_date=..., to_date=...) yes Date-by-date official series

Keyed calls read api_key= or the ALLRATES_API_KEY environment variable. Get a free key at https://allratestoday.com/register (no card).

Three things that will bite you

  1. rate_date is the answer, not the date you asked for. European Central Bank publishes on business days only, so a weekend request returns the last published table. Record the date that comes back — it is the audit trail.
  2. derived: True means the pair was cross-computed within European Central Bank's own table because it does not publish that pair directly. Rates are never crossed between institutions.
  3. Zero dependencies — standard library only, so it adds nothing to your lockfile.

MIT licensed. Rates are served as published by European Central Bank; AllRatesToday is not affiliated with it.

Metadata

Release files for ecb-exchange-rate 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ecb-exchange-rate 1.0.0
File Size Uploaded
ecb_exchange_rate-1.0.0.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ecb-exchange-rate 1.0.0
File Interpreter ABI Platform
ecb_exchange_rate-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / ecb_exchange_rate-1.0.0.tar.gz

Download URL ecb_exchange_rate-1.0.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fae573dbd48a9864daa8b882036aa635082ed444e69729fd60c8f71e7d564cdc
BLAKE2b-256 checksum
How to use checksums
057983c0bafe1f170d78a0504f63b7bd2dcb73c4d4515e32ed858ec2f7599a18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / ecb_exchange_rate-1.0.0-py3-none-any.whl

Download URL ecb_exchange_rate-1.0.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
169bfcad5823e4dd2a1fb7f0737e2f17d0ee1c37631b7c1c5982f4e575903732
BLAKE2b-256 checksum
How to use checksums
ed28c22921e9bad484f91b9e53aebb3d979a67bf1ad2b97c427dd0d91406d1a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page