Skip to content

gzordrai/orda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

orda

Rust client library for the aoe4guides.com API.

Orda provides a simple and type-safe interface for fetching build orders, favorites, and other data from aoe4guides.com.

Internally, it wraps the public REST API using reqwest and serde.

Features

  • Optional civilization and sort filters
  • Async-first API powered by reqwest
  • Lightweight - no global runtime, compatible with any Tokio environment

Install

Add Orda to your project using Cargo:

cargo add orda

Or manually in your Cargo.toml:

[dependencies]
orda = "0.1.1"

Usage

use orda::{OrdaClient, Civilization, SortBy};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = OrdaClient::new();

    // Fetch API status
    let status = client.get_status().await?;

    println!("API status: {}", status.status);

    // Fetch the 10 most popular French builds
    let builds = client
        .get_builds(Civilization::Fre, Some(SortBy::Score), false)
        .await?;

    println!("Fetched {} builds", builds.len());

    // Fetch a single build by ID
    let build = client.get_build("00I7J47dv26cPbKmXYkO", false).await?;

    println!("Build title: {:?}", build.title);

    Ok(())
}

Api overview

  • get_status() => Returns the API status (always "running")
  • get_builds(civ, order_by, overlay) => Fetches up to 10 build orders
  • get_build(id, overlay) => Fetches a single build order by ID
  • get_favorites(user_id, civ, order_by, overlay) => Fetches user favorites

License

Licensed under the Apache 2.0 license.

See the LICENSE file for details

About

Rust client library for the aoe4guides.com API

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages