Skip to content
Discussion options

You must be logged in to vote

Install the official Python SDK:

pip install exchangerateapi

Usage:

from exchangerateapi import ExchangeRateAPI

client = ExchangeRateAPI(api_key="era_live_YOUR_KEY")

# Get latest rates
data = client.latest(base="USD", symbols=["EUR", "GBP", "JPY"])
print(data["rates"])  # {"EUR": 0.92, "GBP": 0.78, "JPY": 149.5}

# Convert amount
result = client.convert("USD", "EUR", 1000)
print(f"$1,000 = EUR {result['result']}")

# Historical rates
data = client.for_date("2026-01-15", base="USD", symbols=["EUR"])
print(data["rates"])  # {"EUR": 0.9187}

# Time series
data = client.time_series("2026-01-01", "2026-03-31", base="USD", symbols=["EUR"])

Zero dependencies — uses only Python standard library (

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cahthuranag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant