Skip to content

Unofficial client to interact with the Exchange Rate API V6.

License

Notifications You must be signed in to change notification settings

dfm18/exchange-rate-api-client

Repository files navigation

Exchange Rate API Client

PyPI - Python Version PyPI - License PyPI Downloads

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.

Installation

Install package from PyPi with:

pip install exchange-rate-api-client

Usage

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)

Open Access

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)

Additional Examples

Fetch enriched data:

data = client.fetch_enriched_data(
    base_code="USD",
    target_code="JPY",
)
print(data)

Fetch historical data:

from datetime import date

data = client.fetch_historical_data(
    base_code="USD",
    date_obj=date(2023, 1, 1),
    amount=100,
)
print(data)

Requirements

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Feel free to submit issues or pull requests to improve the client.

Links

About

Unofficial client to interact with the Exchange Rate API V6.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages