Skip to main content

HypixelClient

Struct HypixelClient 

Source
pub struct HypixelClient { /* private fields */ }
Expand description

An asynchronous client for the Hypixel Public API.

Construct one with HypixelClient::new for a keyed client, or HypixelClient::builder for finer control. The client is cheap to clone; clones share the same connection pool, rate-limit state, and cache.

Implementations§

Source§

impl HypixelClient

Source

pub fn new(api_key: impl Into<String>) -> Self

Create a client authenticated with the given API key.

Keys are issued from the Hypixel Developer Dashboard.

Source

pub fn unauthenticated() -> Self

Create a client without an API key.

Only the keyless endpoints (all resources/*, plus the SkyBlock auctions, auctions_ended, bazaar, firesales, and news endpoints) may be called; any keyed endpoint returns Error::MissingApiKey.

Source

pub fn builder() -> ClientBuilder

Start building a client with custom configuration.

Source

pub fn rate_limit(&self) -> RateLimit

The most recent rate-limit state reported by the API.

Source§

impl HypixelClient

Source

pub async fn player(&self, uuid: &str) -> Result<Option<Player>>

Fetch a player’s network profile by UUID. Requires an API key.

Source

pub async fn recent_games(&self, uuid: &str) -> Result<Vec<RecentGame>>

Fetch a player’s recently played games by UUID. Requires an API key.

Source

pub async fn status(&self, uuid: &str) -> Result<Session>

Fetch a player’s current online session by UUID. Requires an API key.

Source

pub async fn guild_by_id(&self, id: &str) -> Result<Option<Guild>>

Fetch a guild by its id. Requires an API key.

Source

pub async fn guild_by_player(&self, uuid: &str) -> Result<Option<Guild>>

Fetch a guild by the UUID of one of its members. Requires an API key.

Source

pub async fn guild_by_name(&self, name: &str) -> Result<Option<Guild>>

Fetch a guild by name. Requires an API key.

Source

pub async fn boosters(&self) -> Result<Vec<Booster>>

Fetch all currently active and queued boosters. Requires an API key.

Source

pub async fn counts(&self) -> Result<Counts>

Fetch live player counts across the network. Requires an API key.

Source

pub async fn leaderboards(&self) -> Result<HashMap<String, Vec<Leaderboard>>>

Fetch the configured leaderboards for each game. Requires an API key.

Source

pub async fn punishment_stats(&self) -> Result<PunishmentStats>

Fetch network-wide moderation statistics. Requires an API key.

Source

pub async fn housing_active(&self) -> Result<Vec<HousingHouse>>

Fetch the Housing houses the player is currently in. Requires an API key.

Source

pub async fn housing_house(&self, house: &str) -> Result<HousingHouse>

Fetch a single Housing house by its id. Requires an API key.

Source

pub async fn housing_houses(&self, player: &str) -> Result<Vec<HousingHouse>>

Fetch the Housing houses owned by a player. Requires an API key.

Source§

impl HypixelClient

Source

pub async fn resource_games(&self) -> Result<HashMap<String, Game>>

Fetch the network game definitions. Keyless.

Source

pub async fn resource_achievements(&self) -> Result<Value>

Fetch the achievements resource as raw JSON. Keyless.

Source

pub async fn resource_challenges(&self) -> Result<Value>

Fetch the challenges resource as raw JSON. Keyless.

Source

pub async fn resource_quests(&self) -> Result<Value>

Fetch the quests resource as raw JSON. Keyless.

Source

pub async fn resource_guild_achievements(&self) -> Result<Value>

Fetch the guild achievements resource as raw JSON. Keyless.

Source

pub async fn resource_vanity_pets(&self) -> Result<Value>

Fetch the vanity pets resource as raw JSON. Keyless.

Source

pub async fn resource_vanity_companions(&self) -> Result<Value>

Fetch the vanity companions resource as raw JSON. Keyless.

Source

pub async fn resource_skyblock_collections(&self) -> Result<CollectionsResource>

Fetch the SkyBlock collections resource. Keyless.

Source

pub async fn resource_skyblock_skills(&self) -> Result<SkillsResource>

Fetch the SkyBlock skills resource, including per-level XP tables. Keyless.

Source

pub async fn resource_skyblock_items(&self) -> Result<Vec<SkyBlockItem>>

Fetch the SkyBlock item definitions. Keyless.

Source

pub async fn resource_skyblock_election(&self) -> Result<ElectionResource>

Fetch the current SkyBlock mayor and election state. Keyless.

Source

pub async fn resource_packs(&self) -> Result<Vec<ResourcePack>>

Fetch the currently deployed resource packs. Keyless.

Source

pub async fn resource_skyblock_bingo(&self) -> Result<Value>

Fetch the active SkyBlock bingo event as raw JSON. Keyless.

Source§

impl HypixelClient

Source

pub async fn skyblock_profiles( &self, uuid: &str, ) -> Result<Vec<SkyBlockProfile>>

Fetch all SkyBlock profiles for a player by UUID. Requires an API key.

Source

pub async fn skyblock_profile( &self, profile: &str, ) -> Result<Option<SkyBlockProfile>>

Fetch a single SkyBlock profile by its profile id. Requires an API key.

Source

pub async fn skyblock_museum(&self, profile: &str) -> Result<Option<Museum>>

Fetch a profile’s museum data by profile id. Requires an API key.

Source

pub async fn skyblock_garden(&self, profile: &str) -> Result<Option<Garden>>

Fetch a profile’s garden data by profile id. Requires an API key.

Source

pub async fn skyblock_bingo(&self, uuid: &str) -> Result<Vec<Value>>

Fetch a player’s bingo participation by UUID. Requires an API key.

Source

pub async fn skyblock_auction( &self, uuid: Option<&str>, player: Option<&str>, profile: Option<&str>, ) -> Result<Vec<SkyBlockAuction>>

Fetch the active auctions of a player, profile, or single auction. Provide exactly one of uuid, player, or profile. Requires an API key.

Source

pub async fn skyblock_auctions(&self, page: u32) -> Result<AuctionsPage>

Fetch one page of the global active-auction listing. Keyless.

Source

pub async fn skyblock_auctions_all(&self) -> Result<Vec<SkyBlockAuction>>

Fetch every page of the global active-auction listing, concurrently. Keyless.

The listing spans 100+ pages; pages after the first are fetched in waves of eight. Ordering across pages is not guaranteed. The full listing is tens of megabytes, so expect this to take a few seconds.

Source

pub async fn skyblock_auctions_ended(&self) -> Result<Vec<EndedAuction>>

Fetch the most recently ended auctions. Keyless.

Source

pub async fn skyblock_bazaar(&self) -> Result<Bazaar>

Fetch the current bazaar order books for every product. Keyless.

Source

pub async fn skyblock_firesales(&self) -> Result<Vec<FireSale>>

Fetch the currently scheduled fire sales. Keyless.

Source

pub async fn skyblock_news(&self) -> Result<Vec<NewsItem>>

Fetch the latest SkyBlock news posts. Keyless.

Trait Implementations§

Source§

impl Clone for HypixelClient

Source§

fn clone(&self) -> HypixelClient

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HypixelClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more