Unofficial client to interact with the Exchange Rate API V6.
- Simple API client: Easy-to-use interface to interact with the Exchange Rate API.
- Open Access Support: Fetch exchange rates without requiring an API key.
Install package from PyPi with:
pip install exchange-rate-api-client
You can initializate a api client with your API key to access all endpoints:
from exchange_rate_api_client import ExchangeRateApiV6Client
client = ExchangeRateApiV6Client(api_key="<YOUR_API_KEY>")
# Example: Convert 100 USD to EUR
conversion = client.pair_conversion(
base_code="USD",
target_code="EUR",
amount=100,
)
print(conversion)
For basic access without an API key, fetch the latest exchange rates:
from exchange_rate_api_client import fetch_exchange_rates
# Example: Fetch exchange rates for USD
data = fetch_exchange_rates(base_code="USD")
print(data)
data = client.fetch_enriched_data(
base_code="USD",
target_code="JPY",
)
print(data)
from datetime import date
data = client.fetch_historical_data(
base_code="USD",
date_obj=date(2023, 1, 1),
amount=100,
)
print(data)
- Python 3.7 or higher
- An API key from Exchange Rate API for full access.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Feel free to submit issues or pull requests to improve the client.