| Crates.io | fioapi |
| lib.rs | fioapi |
| version | 0.3.1 |
| created_at | 2026-01-12 21:56:01.64221+00 |
| updated_at | 2026-01-12 22:42:35.612514+00 |
| description | Async Rust client for the Fio banka REST API |
| homepage | https://github.com/wagnelib/fioapi-rs |
| repository | https://github.com/wagnelib/fioapi-rs |
| max_upload_size | |
| id | 2038917 |
| size | 100,707 |
Async Rust client for the Fio banka REST API. It mirrors the official API (see API_Bankovnictvi.pdf) and the bundled Python reference (fio_banka.py), exposing typed models, error mapping, and helpers for parsing JSON statements.
[dependencies]
fioapi = { path = "." }
Requires Rust 1.74+ and Tokio runtime.
use fioapi::{Client, TransactionReportFmt};
use std::env;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
env_logger::init();
dotenvy::dotenv().ok();
let token = env::var("FIO_API_TOKEN")?;
let client = Client::new(token)?;
let payload = client
.fetch_transaction_report_since_last_download(TransactionReportFmt::Json)
.await?;
let transactions = client.parse_transactions(&payload)?;
for txn in transactions {
println!("{} | {} {} {}", txn.transaction_id, txn.date, txn.amount, txn.currency);
}
Ok(())
}
cargo run --example fetch_transactions reads FIO_API_TOKEN from environment or .env and prints transactions from the last 30 days.cargo run --example set_last_unsuccessful_download_date [YYYY-MM-DD] sets the last unsuccessful download date (defaults to yesterday when no date is provided).cargo fmt, cargo clippy --all-targets --all-featurescargo testKeep secrets (API tokens) out of VCS; pass them via env vars or .env. Default base URL is https://fioapi.fio.cz/v1/rest; override with Client::with_base_url for testing.
MIT