https://github.com/dfm18/exchange-rate-api-client
Unofficial client to interact with the Exchange Rate API V6.
https://github.com/dfm18/exchange-rate-api-client
exchange-rate-api python rest-api-client
Last synced: about 1 month ago
JSON representation
Unofficial client to interact with the Exchange Rate API V6.
- Host: GitHub
- URL: https://github.com/dfm18/exchange-rate-api-client
- Owner: dfm18
- License: mit
- Created: 2025-01-21T00:06:55.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-01-24T13:51:48.000Z (4 months ago)
- Last Synced: 2025-03-24T12:17:34.456Z (about 2 months ago)
- Topics: exchange-rate-api, python, rest-api-client
- Language: Python
- Homepage:
- Size: 72.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
# Exchange Rate API Client



Unofficial client to interact with the [Exchange Rate API](https://www.exchangerate-api.com/) 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:
```bash
pip install exchange-rate-api-client
```## Usage
### API Client
You can initializate a api client with your API key to access all endpoints:
```python
from exchange_rate_api_client import ExchangeRateApiV6Clientclient = ExchangeRateApiV6Client(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:
```python
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:
```python
data = client.fetch_enriched_data(
base_code="USD",
target_code="JPY",
)
print(data)
```#### Fetch historical data:
```python
from datetime import datedata = client.fetch_historical_data(
base_code="USD",
date_obj=date(2023, 1, 1),
amount=100,
)
print(data)
```## Requirements
- Python 3.7 or higher
- An API key from [Exchange Rate API](https://www.exchangerate-api.com/) for full access.## License
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
## Contributing
Contributions are welcome! Feel free to submit issues or pull requests to improve the client.
## Links
- [API Documentation](https://www.exchangerate-api.com/docs/overview)
- [Project Page](https://pypi.org/project/exchange-rate-api-client/)