https://github.com/jontze/tankerkoenig-rs
A strongly typed API wrapper for the Tankerkönig API, providing information related to fuel prices and gas station locations in Germany.
https://github.com/jontze/tankerkoenig-rs
api-wrapper rust rust-library tankerkoenig tankerkoenig-api
Last synced: 19 days ago
JSON representation
A strongly typed API wrapper for the Tankerkönig API, providing information related to fuel prices and gas station locations in Germany.
- Host: GitHub
- URL: https://github.com/jontze/tankerkoenig-rs
- Owner: jontze
- License: mit
- Created: 2021-12-10T14:19:34.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-13T01:50:15.000Z (5 months ago)
- Last Synced: 2025-05-07T06:16:33.224Z (25 days ago)
- Topics: api-wrapper, rust, rust-library, tankerkoenig, tankerkoenig-api
- Language: Rust
- Homepage: https://crates.io/crates/tankerkoenig
- Size: 3.96 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tankerkoenig-rs
[](https://github.com/jontze/tankerkoenig-rs/blob/main/LICENSE)


[](https://github.com/jontze/tankerkoenig-rs/actions/workflows/main.yml)
[](https://codecov.io/gh/jontze/tankerkoenig-rs)API wrapper for the [tankerkoenig-api](https://creativecommons.tankerkoenig.de/) written in rust.
The API of [tankerkoenig](https://creativecommons.tankerkoenig.de/) 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.
## 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`:
```toml
[dependencies]
tankerkoenig = "0.2.0"
# If you want to use the latest unreleased version:
tankerkoenig = { git = "https://github.com/jontze/tankerkoenig-rs" }```
## Requirements
1. Api Token for the [tankerkoenig-api](https://creativecommons.tankerkoenig.de/)
2. Async runtime like [tokio](https://crates.io/crates/tokio)## Quickstart
```rust
use tankerkoenig::Tankerkoenig;
use tankerkoenig::models;async fn request_station_details() -> Result {
let tanker = Tankerkoenig::new("")?;
let details = tanker.station.fetch_details("id-of-a-fuel-station").await?;
Ok(details)
}
```