Skip to main content

Crate exchange_rateapi

Crate exchange_rateapi 

Source
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§

ConvertResponse
Response from the /v1/convert endpoint.
ExchangeRateAPI
Client for the Exchange Rate API.
HistoricalResponse
Response from the /v1/history endpoint (single date).
LatestResponse
Response from the /v1/latest endpoint.
SymbolsResponse
A single currency entry returned by the /v1/symbols endpoint.
TimeSeriesResponse
Response from the /v1/timeseries endpoint.

Enums§

ExchangeRateAPIError
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.
SingleRateResponse
Response from the /v1/latest endpoint when requesting a single pair. Re-uses LatestResponse internally.