dukascopy-fx
A Rust library for fetching historical forex (currency exchange) data from Dukascopy's tick data API. This library provides a simple and efficient way to retrieve exchange rates, handle weekends, and cache data for improved performance.
This library was created because I couldn't find a free API that provides historical forex data with minute- or tick-level precision. Dukascopy's API is free and offers high-precision tick data for a wide range of currency pairs.
Features
- Fetch Historical Forex Data: Retrieve tick data for specific currency pairs and timestamps.
- Weekend Handling: Automatically fetches the last available tick from Friday for weekend timestamps.
- Caching: Implements an LRU cache to reduce redundant API requests.
- Error Handling: Provides detailed error messages for invalid data, HTTP errors, and more.
- Customizable: Supports custom cache sizes, logging, and HTTP clients.
Usage
Fetching Exchange Rates
use ;
use ;
async