Expand description
§Exchange Rate API SDK
Official Rust SDK for Exchange Rate API – real-time mid-market exchange rates for 160+ currencies.
§Quick Start
use exchange_rateapi::ExchangeRateAPI;
let client = ExchangeRateAPI::new("era_live_your_api_key");
// Get latest rates for USD
let response = client.latest("USD", None).unwrap();
println!("USD to EUR: {}", response.rates["EUR"]);
// Convert 100 USD to GBP
let result = client.convert("USD", "GBP", 100.0).unwrap();
println!("100 USD = {} GBP", result.result);Structs§
- Convert
Response - Response from the
/v1/convertendpoint. - Exchange
RateAPI - Client for the Exchange Rate API.
- Historical
Response - Response from the
/v1/historyendpoint (single date). - Latest
Response - Response from the
/v1/latestendpoint. - Symbols
Response - A single currency entry returned by the
/v1/symbolsendpoint. - Time
Series Response - Response from the
/v1/timeseriesendpoint.
Enums§
- Exchange
RateAPI Error - Errors returned by the Exchange Rate API SDK.
- Period
- Preset time periods for
ExchangeRateAPI::get_historical_rates.
Type Aliases§
- Result
- Convenience alias for results returned by this crate.
- Single
Rate Response - Response from the
/v1/latestendpoint when requesting a single pair. Re-usesLatestResponseinternally.