| Crates.io | exchangerateapi-rust |
| lib.rs | exchangerateapi-rust |
| version | 0.1.0 |
| created_at | 2025-10-27 18:27:34.467669+00 |
| updated_at | 2025-10-27 18:27:34.467669+00 |
| description | Rust client for exchangerateapi.net: latest and historical endpoints |
| homepage | https://exchangerateapi.net |
| repository | https://github.com/exchangerateapinet/exchangerateapi-rust |
| max_upload_size | |
| id | 1903512 |
| size | 53,924 |
Rust client for exchangerateapi.net with two focused endpoints.
Add to Cargo.toml:
exchangerateapi-rust = "0.1"
use exchangerateapi_rust::Client;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let api_key = std::env::var("EXCHANGERATEAPI_KEY").unwrap_or_else(|_| "YOUR_API_KEY".into());
let client = Client::new(api_key)?;
let latest = client.latest("USD", None).await?;
println!("latest: {}", latest.rates);
Ok(())
}
let subset = client.latest("EUR", Some(&["USD","GBP","JPY"])) .await?;
let hist = client.historical("2024-01-02", "USD", None).await?;
Run with your API key:
EXCHANGERATEAPI_KEY=your_api_key cargo run --example latest
EXCHANGERATEAPI_KEY=your_api_key cargo run --example historical
A generous free tier exists for development and light workloads. Review current limits at exchangerateapi.net.
MIT