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 and rate-limit state.
Implementations§
Source§impl HypixelClient
impl HypixelClient
Sourcepub fn new(api_key: impl Into<String>) -> Self
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.
Sourcepub fn unauthenticated() -> Self
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.
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Start building a client with custom configuration.
Sourcepub fn rate_limit(&self) -> RateLimit
pub fn rate_limit(&self) -> RateLimit
The most recent rate-limit state reported by the API.
Source§impl HypixelClient
impl HypixelClient
Sourcepub async fn player(&self, uuid: &str) -> Result<Option<Player>>
pub async fn player(&self, uuid: &str) -> Result<Option<Player>>
Fetch a player’s network profile by UUID. Requires an API key.
Sourcepub async fn recent_games(&self, uuid: &str) -> Result<Vec<RecentGame>>
pub async fn recent_games(&self, uuid: &str) -> Result<Vec<RecentGame>>
Fetch a player’s recently played games by UUID. Requires an API key.
Sourcepub async fn status(&self, uuid: &str) -> Result<Session>
pub async fn status(&self, uuid: &str) -> Result<Session>
Fetch a player’s current online session by UUID. Requires an API key.
Sourcepub async fn guild_by_id(&self, id: &str) -> Result<Option<Guild>>
pub async fn guild_by_id(&self, id: &str) -> Result<Option<Guild>>
Fetch a guild by its id. Requires an API key.
Sourcepub async fn guild_by_player(&self, uuid: &str) -> Result<Option<Guild>>
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.
Sourcepub async fn guild_by_name(&self, name: &str) -> Result<Option<Guild>>
pub async fn guild_by_name(&self, name: &str) -> Result<Option<Guild>>
Fetch a guild by name. Requires an API key.
Sourcepub async fn boosters(&self) -> Result<Vec<Booster>>
pub async fn boosters(&self) -> Result<Vec<Booster>>
Fetch all currently active and queued boosters. Requires an API key.
Sourcepub async fn counts(&self) -> Result<Counts>
pub async fn counts(&self) -> Result<Counts>
Fetch live player counts across the network. Requires an API key.
Sourcepub async fn leaderboards(&self) -> Result<HashMap<String, Vec<Leaderboard>>>
pub async fn leaderboards(&self) -> Result<HashMap<String, Vec<Leaderboard>>>
Fetch the configured leaderboards for each game. Requires an API key.
Sourcepub async fn punishment_stats(&self) -> Result<PunishmentStats>
pub async fn punishment_stats(&self) -> Result<PunishmentStats>
Fetch network-wide moderation statistics. Requires an API key.
Sourcepub async fn housing_active(&self) -> Result<Vec<HousingHouse>>
pub async fn housing_active(&self) -> Result<Vec<HousingHouse>>
Fetch the Housing houses the player is currently in. Requires an API key.
Sourcepub async fn housing_house(&self, house: &str) -> Result<HousingHouse>
pub async fn housing_house(&self, house: &str) -> Result<HousingHouse>
Fetch a single Housing house by its id. Requires an API key.
Sourcepub async fn housing_houses(&self, player: &str) -> Result<Vec<HousingHouse>>
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
impl HypixelClient
Sourcepub async fn resource_games(&self) -> Result<HashMap<String, Game>>
pub async fn resource_games(&self) -> Result<HashMap<String, Game>>
Fetch the network game definitions. Keyless.
Sourcepub async fn resource_achievements(&self) -> Result<Value>
pub async fn resource_achievements(&self) -> Result<Value>
Fetch the achievements resource as raw JSON. Keyless.
Sourcepub async fn resource_challenges(&self) -> Result<Value>
pub async fn resource_challenges(&self) -> Result<Value>
Fetch the challenges resource as raw JSON. Keyless.
Sourcepub async fn resource_quests(&self) -> Result<Value>
pub async fn resource_quests(&self) -> Result<Value>
Fetch the quests resource as raw JSON. Keyless.
Sourcepub async fn resource_guild_achievements(&self) -> Result<Value>
pub async fn resource_guild_achievements(&self) -> Result<Value>
Fetch the guild achievements resource as raw JSON. Keyless.
Sourcepub async fn resource_vanity_pets(&self) -> Result<Value>
pub async fn resource_vanity_pets(&self) -> Result<Value>
Fetch the vanity pets resource as raw JSON. Keyless.
Sourcepub async fn resource_vanity_companions(&self) -> Result<Value>
pub async fn resource_vanity_companions(&self) -> Result<Value>
Fetch the vanity companions resource as raw JSON. Keyless.
Sourcepub async fn resource_skyblock_collections(&self) -> Result<CollectionsResource>
pub async fn resource_skyblock_collections(&self) -> Result<CollectionsResource>
Fetch the SkyBlock collections resource. Keyless.
Sourcepub async fn resource_skyblock_skills(&self) -> Result<SkillsResource>
pub async fn resource_skyblock_skills(&self) -> Result<SkillsResource>
Fetch the SkyBlock skills resource, including per-level XP tables. Keyless.
Sourcepub async fn resource_skyblock_items(&self) -> Result<Vec<SkyBlockItem>>
pub async fn resource_skyblock_items(&self) -> Result<Vec<SkyBlockItem>>
Fetch the SkyBlock item definitions. Keyless.
Sourcepub async fn resource_skyblock_election(&self) -> Result<ElectionResource>
pub async fn resource_skyblock_election(&self) -> Result<ElectionResource>
Fetch the current SkyBlock mayor and election state. Keyless.
Sourcepub async fn resource_packs(&self) -> Result<Vec<ResourcePack>>
pub async fn resource_packs(&self) -> Result<Vec<ResourcePack>>
Fetch the currently deployed resource packs. Keyless.
Sourcepub async fn resource_skyblock_bingo(&self) -> Result<Value>
pub async fn resource_skyblock_bingo(&self) -> Result<Value>
Fetch the active SkyBlock bingo event as raw JSON. Keyless.
Source§impl HypixelClient
impl HypixelClient
Sourcepub async fn skyblock_profiles(
&self,
uuid: &str,
) -> Result<Vec<SkyBlockProfile>>
pub async fn skyblock_profiles( &self, uuid: &str, ) -> Result<Vec<SkyBlockProfile>>
Fetch all SkyBlock profiles for a player by UUID. Requires an API key.
Sourcepub async fn skyblock_profile(
&self,
profile: &str,
) -> Result<Option<SkyBlockProfile>>
pub async fn skyblock_profile( &self, profile: &str, ) -> Result<Option<SkyBlockProfile>>
Fetch a single SkyBlock profile by its profile id. Requires an API key.
Sourcepub async fn skyblock_museum(&self, profile: &str) -> Result<Option<Museum>>
pub async fn skyblock_museum(&self, profile: &str) -> Result<Option<Museum>>
Fetch a profile’s museum data by profile id. Requires an API key.
Sourcepub async fn skyblock_garden(&self, profile: &str) -> Result<Option<Garden>>
pub async fn skyblock_garden(&self, profile: &str) -> Result<Option<Garden>>
Fetch a profile’s garden data by profile id. Requires an API key.
Sourcepub async fn skyblock_bingo(&self, uuid: &str) -> Result<Vec<Value>>
pub async fn skyblock_bingo(&self, uuid: &str) -> Result<Vec<Value>>
Fetch a player’s bingo participation by UUID. Requires an API key.
Sourcepub async fn skyblock_auction(
&self,
uuid: Option<&str>,
player: Option<&str>,
profile: Option<&str>,
) -> Result<Vec<SkyBlockAuction>>
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.
Sourcepub async fn skyblock_auctions(&self, page: u32) -> Result<AuctionsPage>
pub async fn skyblock_auctions(&self, page: u32) -> Result<AuctionsPage>
Fetch one page of the global active-auction listing. Keyless.
Sourcepub async fn skyblock_auctions_ended(&self) -> Result<Vec<EndedAuction>>
pub async fn skyblock_auctions_ended(&self) -> Result<Vec<EndedAuction>>
Fetch the most recently ended auctions. Keyless.
Sourcepub async fn skyblock_bazaar(&self) -> Result<Bazaar>
pub async fn skyblock_bazaar(&self) -> Result<Bazaar>
Fetch the current bazaar order books for every product. Keyless.
Sourcepub async fn skyblock_firesales(&self) -> Result<Vec<FireSale>>
pub async fn skyblock_firesales(&self) -> Result<Vec<FireSale>>
Fetch the currently scheduled fire sales. Keyless.
Sourcepub async fn skyblock_news(&self) -> Result<Vec<NewsItem>>
pub async fn skyblock_news(&self) -> Result<Vec<NewsItem>>
Fetch the latest SkyBlock news posts. Keyless.
Trait Implementations§
Source§impl Clone for HypixelClient
impl Clone for HypixelClient
Source§fn clone(&self) -> HypixelClient
fn clone(&self) -> HypixelClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more