#dhl #ups #logistics #usps #fedex

logistics-api

Track your packages from all over the world. Supports logicsitcs from DHL, UPS, FedEx, USPS, and more.

7 releases

0.1.6 Mar 27, 2023
0.1.5 Mar 27, 2023

#1 in #dhl

Download history 19/week @ 2024-07-23 9/week @ 2024-07-30 1/week @ 2024-09-17 19/week @ 2024-09-24

71 downloads per month

MIT license

8KB
139 lines

Logistics API

Supported APIs

  • DHL (✅)
  • UPS (🕒)
  • Fedex (🕒)

Usage

With Blocking I/O

use logistics_api::DHL;

fn main() {
  let dhl = DHL::new("YOUR_API_KEY");

  let tracking = dhl.tracking.get_tracking_sync("YOUR_TRACKING_NUMBER");

  match tracking {
    Ok(tracking) => println!("{:#?}", tracking),
    Err(err) => println!("{:#?}", err),
  }
}

Using Async I/O

use logistics_api::DHL;

#[tokio::main]
async fn main() {
  let dhl = DHL::new("YOUR_API_KEY");

  let tracking = dhl.tracking.get_tracking("YOUR_TRACKING_NUMBER").await;

  match tracking {
    Ok(tracking) => println!("{:#?}", tracking),
    Err(err) => println!("{:#?}", err),
  }
}

Dependencies

~4–16MB
~217K SLoC