freecurrencyapi-rs

Crates.iofreecurrencyapi-rs
lib.rsfreecurrencyapi-rs
version0.1.0
sourcesrc
created_at2023-05-31 09:18:18.046216
updated_at2023-05-31 09:18:18.046216
descriptionAn API wrapper for freecurrencyapi.com
homepagehttps://github.com/everapihq/freecurrencyapi-rs
repositoryhttps://github.com/everapihq/freecurrencyapi-rs
max_upload_size
id878632
size13,524
MarTechDev (martechdev)

documentation

https://freecurrencyapi.com/docs

README

freecurrencyapi-rs: Rust Currency Converter

This package is a Rust wrapper for freecurrencyapi.com that aims to make the usage of the API as easy as possible in your project. Freecurrencyapi.com is a free currency API that provides realtime as well as historic foreign exchange data.

Installation

This crate is under development. Especially the response parsing needs some more testing. However, if you still want to use it, you can install it by adding this to your Cargo.toml:

[dependencies]
freecurrencyapi = "0.1.0"

Requirements

  1. API Key for freecurrencyapi.com
  2. Async runtime like tokio

Quickstart

use freecurrencyapi::Freecurrencyapi;
use freecurrencyapi::models;

async fn request_latest() -> Result<models::DetailsResponse, freecurrencyapi::Error> {
    let c_api = Freecurrencyapi::new("<your-api-key>")?;
    let details = c_api.latest("id-of-a-fuel-station").await?;
     Ok(details)
}

Endpoints accessible with a free account:

  • status
  • currencies
  • latest
  • historical

Find out more about our endpoints, parameters and response data structure in the docs

License

The MIT License (MIT). Please see License File for more information.

Commit count: 1

cargo fmt