Crates.io | tankerkoenig |
lib.rs | tankerkoenig |
version | 0.3.0 |
source | src |
created_at | 2022-06-15 00:03:03.291584 |
updated_at | 2024-11-02 12:21:17.344295 |
description | API wrapper for the tankerkoenig api |
homepage | https://github.com/jontze/tankerkoenig-rs |
repository | https://github.com/jontze/tankerkoenig-rs |
max_upload_size | |
id | 606168 |
size | 97,363 |
API wrapper for the tankerkoenig-api written in rust.
The API of tankerkoenig gives you realtime fuel prices for germany with Creative Commons License. This rust wrapper provides you ready deserialized structs and an easy to use and strictly typed api.
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]
tankerkoenig = "0.2.0"
# If you want to use the latest unreleased version:
tankerkoenig = { git = "https://github.com/jontze/tankerkoenig-rs" }
use tankerkoenig::Tankerkoenig;
use tankerkoenig::models;
async fn request_station_details() -> Result<models::station::DetailsResponse, tankerkoenig::Error> {
let tanker = Tankerkoenig::new("<your-api-key>")?;
let details = tanker.station.fetch_details("id-of-a-fuel-station").await?;
Ok(details)
}