reliefweb

Crates.ioreliefweb
lib.rsreliefweb
version0.1.2
created_at2025-09-03 13:01:51.379598+00
updated_at2025-09-10 11:25:47.704075+00
descriptionA Rust client for the ReliefWeb API
homepagehttps://github.com/cpellet/reliefweb-rust
repositoryhttps://github.com/cpellet/reliefweb-rust
max_upload_size
id1822479
size123,921
Cyrus Pellet (cpellet)

documentation

https://docs.rs/reliefweb

README

ReliefWeb Rust Client

crates.io docs.rs

A fully asynchronous Rust client for the ReliefWeb API, providing typed endpoints for reports, disasters, countries, jobs, blogs, books, sources, and trainings.


Features

  • Fully typed resources with serde support.
  • Async support with reqwest + tokio.
  • Support for filtering, sorting, limiting, and profiles.
  • Prebuilt endpoints for:
    • reports
    • disasters
    • countries
    • jobs
    • training
    • sources
    • blogs
    • books
  • Automatic URL and query parameter handling.

Installation

Add to your Cargo.toml:

[dependencies]
reliefweb-rust = "0.1.0"
tokio = { version = "1.47.1", features = ["full"] }

Usage

use reliefweb_rust::{Client, QueryParams, APIVersion};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let client = Client::new("api.reliefweb.int", "my_app_name", APIVersion::V2)?;

    // List reports
    let reports = client.reports()
        .list(Some(&QueryParams::new().limit(5)))
        .await?;

    for report in reports.data {
        println!("Report: {:?}", report.fields.title);
    }

    // Get a single report
    if let Some(first_report) = reports.data.first() {
        let report_detail = client.reports()
            .get(&first_report.id, None, None, None)
            .await?;
        println!("Full report details: {:?}", report_detail.data[0].fields);
    }

    Ok(())
}

QueryParams

You can filter, sort, and limit results using QueryParams:

use reliefweb_rust::{QueryParams, QueryProfile};

let params = QueryParams::new()
    .limit(10)
    .profile(QueryProfile::Minimal);

Documentation

Full API documentation is available at docs.rs

License

Licensed under MIT.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Commit count: 6

cargo fmt