Skip to main content

Crate halo_api

Crate halo_api 

Source
Expand description

Unofficial Halo Infinite REST API client for Rust: CSR/rank lookups, service records, match history, and more.

This crate is not affiliated with, endorsed by or supported by Microsoft.

§Quick start

use std::sync::Arc;

use halo_api::clients::hi::models::PlaylistId;
use halo_api::auth::HaloAuthClient;
use halo_api::clients::hi::{HaloInfiniteClient, Player};
use xbox::auth::LegacyPasswordProvider;
use xbox::XboxClient;

let xbox_client = Arc::new(XboxClient::new(LegacyPasswordProvider::new(
    "my-username",
    "my-password",
)));
let auth = HaloAuthClient::from_xbox_client(xbox_client.clone());
let halo = HaloInfiniteClient::new(auth);

let xuid = xbox_client.gamertag_to_xuid("Some Gamertag").await?;
let csr = halo.playlist_csr(PlaylistId::RANKED_ARENA, &Player::from(&xuid)).await?;

println!("{csr:?}");

Re-exports§

pub use clients::hi::HaloInfiniteClient;
pub use clients::hi::InfiniteClientError;

Modules§

auth
clients