API Reference#
This section outlines the API of hypixel.py.
Version Info#
Client#
- defadd_key
- asyncbans
- defclear_cache
- defclear_hypixel_cache
- defclear_mojang_cache
- asyncclose
- asyncget_name
- asyncget_uuid
- asyncguild_from_id
- asyncguild_from_name
- asyncguild_from_player
- asynckey
- asyncleaderboards
- asyncplayer
- asyncplayer_count
- asyncplayer_status
- defremove_key
- asyncvalidate_keys
- class hypixel.Client(keys=None, *, loop=None, **options)#
Class for interacting with both the Mojang and Hypixel APIs.
- Parameters:
keys (Union[
str, List[str]]) –The Hypixel API key(s) the client will use to access the API.
Warning
KeyRequiredwill be raised if a method is called that requires an API key and none were passed or added withadd_key().Warning
Please note that using multiple keys is disallowed by Hypixel: “You may not use methods such as multiple accounts to bypass the API limits.” Refer to (https://github.com/HypixelDev/PublicAPI/issues/229) and (https://api.hypixel.net/#section/Introduction/Rules) for more information. Hypixel.py does not encourage the use of multiple keys.
loop (
asyncio.AbstractEventLoop) – The loop the client will use for asynchronous operations. Defaults toNonein which case the event loop is created usingasyncio.get_event_loop().autoverify (
bool) – Runsvalidate_keys()on client initialization. Defaults toFalse.cache (
bool) –Whether or not API calls are cached. If
True, new requests won’t be made for the same calls to request methods if the response for the passed arguments is still stored. Defaults toFalse.Note
Cached items will be accessible either until the size limit is reached (
self.cache_size), or the cached data expires (self.cache_time).Note
The cache uses an async, time-invalidating, least recently used implementation. This means it works on asynchronous functions, can invalidate items that have been in the cache for x amount of time, and can remove least recently used items if the size limit is reached.
Limitations
When a cached item is time-invalidated, it does not get removed from the cache and can inflate the cache size with multiple of the same item if they were called far enough apart from each other and
self.cache_timeis notNone. Also,self.cache_timeis based on the time from when it’s first added to the cache, and not refreshed on the last access to that cached item. This could also be considered a feature and is therefore a design decision.cache_h (
bool) – Whether or not to cache Hypixel API calls. Refer toself.cachefor more information. Defaults toself.cache.cache_m (
bool) – Whether or not to cache Mojang API calls. Refer toself.cachefor more information. Defaults toself.cache.cache_size (
int) – The amount of cached items that are stored before deleting the oldest items. IfNone(the default), then there is no limit.cache_size_h (
int) – Cache size for the Hypixel API. Refer toself.cache_sizefor more information. Defaults toself.cache_size.cache_size_m (
int) – Cache size for the Mojang API. Refer toself.cache_sizefor more information. Defaults toself.cache_size.cache_time (
int) –The amount of time (in seconds) cached items can be stored before getting invalidated. Defaults to
60.Note
The timestamp of a cached item is stored when the function is called, not when it is returned. So, the time the API takes to get the request counts towards the time invalidation. That’s why it’s recommended to have a value of at least 10, but for the average use case it should be at least 60 to get any cache hits.
cache_time_h (
int) – Cache time for the Hypixel API. Refer toself.cache_timefor more information. Defaults toself.cache_time.cache_time_m (
int) – Cache time for the Mojang API. Refer toself.cache_timefor more information. Defaults toself.cache_time.rate_limit (
bool) –Whether or not to handle rate limits. Defaults to
True.Note
For the Hypixel API, this will wait for the ‘Retry-After’ header’s amount of time either until a non-429 status is returned, or ‘Retry-After’ exceeds
self.timeout.Note
For the Mojang API, this will wait for
ExponentialBackoff.delay()amount of time either until a non-429 status is returned, or the time from the last invocation exceedsself.timeoutin which caseTimeoutErroris raised. The delay time is reset on every new Mojang method call.rate_limit_h (
bool) – Whether or not to handle Hypixel API rate limits. Seeself.rate_limitfor more information. Defaults toself.rate_limit.rate_limit_m (
bool) – Whether or not to handle Mojang API rate limits. Seeself.rate_limitfor more information. Defaults toself.rate_limit.timeout (
int) –The maximum amount of time (in seconds) to wait for a request. This includes both waiting for a request to return, and waiting for rate limit retry times if
self.rate_limitisTrue. Defaults to10.Warning
Noneis a valid argument; however, it is advised against using because there’s no fallback without a timeout, and there are chances you might end up waiting a very long time.Warning
If
self.rate_limitisTrue(default), then for Mojang API requests, if a 429 response is received and the interval is greater thanself.timeout, then it will raise aTimeoutError.
- Raises:
LoopPolicyError – Raised when the event loop policy is misconfigured.
MalformedApiKey – Raised when an invalidly formed API key is passed.
- property keys#
A list of Hypixel API key(s) that were passed or added to the client.
Can also be
None.- Type:
List[
str]
- property hypixel_cache_info#
A named tuple that represents cache information for all Hypixel API related methods.
This is the same as
functools.lru_cache.cache_info(). Fields arehits,misses,maxsize, andcurrsize. All of which are anintexceptmaxsizewhich can also beNone.- Type:
- property mojang_cache_info#
A named tuple that represents cache information for all Mojang related methods.
This is the same as
functools.lru_cache.cache_info(). Fields arehits,misses,maxsize, andcurrsize. All of which are anintexceptmaxsizewhich can also beNone.- Type:
- await close()#
Safely closes the aiohttp session.
Note
This is here to handle the closing of the
self.ClientSessionby yourself if you are done using the Client. You can also use the Client with an asynchronous context manager (async with) if you want to handle session cleanup automatically.Warning
Make sure this is awaited before the program ends if you aren’t using a context manager.
Warning
Calling a client method that requires an open aiohttp session after this is called will raise a
ClosedSessionexception.
- await validate_keys()#
Validates the keys passed into the client.
This method requests data from Hypixel.
Note
This first checks for malformed UUIDs, and then requests key objects from the API to check if the keys are valid.
Note
An error is raised when the first invalid key is found, so this is not viable for testing all of your keys at once if more than one is invalid.
- Raises:
InvalidApiKey – The API key used is invalid.
MalformedApiKey – Raised when an invalidly formed API key is passed.
- add_key(key)#
Adds a key to
keysand update internal attributes.- Parameters:
key (
str) – The Hypixel API key to add to the Client.
- remove_key(key)#
Removes a key from
keysand update internal attributes.- Parameters:
key (
str) – The Hypixel API key to remove from the Client.
- clear_cache()#
Clear hypixel and mojang caches.
- clear_mojang_cache()#
Clear mojang cache.
- clear_hypixel_cache()#
Clear hypixel cache.
- await get_uuid(name)#
Returns the uuid of a player from their username.
This method requests data from Mojang.
- Parameters:
name (
str) – The username of the player.- Raises:
ApiError – An unexpected error occurred with the Mojang API.
ClosedSession –
self.ClientSessionis closed.InvalidPlayerId – The passed player name is not a string.
PlayerNotFound – The passed player name does not exist.
RateLimitError – The rate limit is exceeded and
self.rate_limit_misFalse.TimeoutError – The request took longer than
self.timeout, or the retry delay time is longer thanself.timeout.
- Returns:
The uuid of the player.
- Return type:
- await get_name(uuid)#
Returns the username of a player from their uuid.
This method requests data from Mojang.
- Parameters:
uuid (
str) – The uuid of the player.- Raises:
ApiError – An unexpected error occurred with the Mojang API.
ClosedSession –
self.ClientSessionis closed.InvalidPlayerId – The passed player uuid is not a string.
PlayerNotFound – The passed player uuid does not exist.
RateLimitError – The rate limit is exceeded and
self.rate_limit_misFalse.TimeoutError – The request took longer than
self.timeout, or the retry delay time is longer thanself.timeout.
- Returns:
The name of the player.
- Return type:
- await player(id_)#
Returns player info.
This method requests data from Hypixel.
Note
If a username is passed instead of a uuid, then API errors can also apply to Mojang’s API since it will be called to get the uuid.
- Parameters:
id_ (
str) – The username or uuid of a player.- Raises:
ApiError – An unexpected error occurred with the Hypixel or Mojang API.
ClosedSession –
self.ClientSessionis closed.InvalidApiKey – The API key used is invalid.
KeyRequired – The client does not have any keys.
PlayerNotFound – The passed player id does not exist in Mojang’s or Hypixel’s databases.
RateLimitError – The rate limit is exceeded and
self.rate_limit_hisFalse.TimeoutError – The request took longer than
self.timeout, or the retry delay time is longer thanself.timeout.
- Returns:
A player model used to abstract data.
- Return type:
- await player_count()#
Returns the number of players connected to Hypixel.
This method requests data from Hypixel.
- Raises:
ApiError – An unexpected error occurred with the Hypixel API.
ClosedSession –
self.ClientSessionis closed.InvalidApiKey – The API key used is invalid.
KeyRequired – The client does not have any keys.
RateLimitError – The rate limit is exceeded and
self.rate_limit_hisFalse.TimeoutError – The request took longer than
self.timeout, or the retry delay time is longer thanself.timeout.
- Returns:
The number of players connected to Hypixel.
- Return type:
- await key(key)#
Returns key info.
This method requests data from Hypixel.
- Parameters:
key (
str) –The Hypixel API key the model will be made for.
Note
Can be passed with or without dashes.
- Raises:
ApiError – An unexpected error occurred with the Hypixel API.
ClosedSession –
self.ClientSessionis closed.InvalidApiKey – The API key used is invalid.
RateLimitError – The rate limit is exceeded and
self.rate_limit_hisFalse.TimeoutError – The request took longer than
self.timeout, or the retry delay time is longer thanself.timeout.
- Returns:
A key model used to abstract data.
- Return type:
- await bans()#
Returns staff and watchdog ban info.
This method requests data from Hypixel.
- Raises:
ApiError – An unexpected error occurred with the Hypixel API.
ClosedSession –
self.ClientSessionis closed.InvalidApiKey – The API key used is invalid.
KeyRequired – The client does not have any keys.
RateLimitError – The rate limit is exceeded and
self.rate_limit_hisFalse.TimeoutError – The request took longer than
self.timeout, or the retry delay time is longer thanself.timeout.
- Returns:
A ban model used to abstract data.
- Return type:
- await player_status(id_)#
Get the status of a player.
- await guild_from_id(id_)#
Get a guild from the id.
- await guild_from_player(id_)#
Get a guild from a player.
- await guild_from_name(name)#
Get a guild from the name.
- await leaderboards()#
Get the game leaderboards.
API Models#
API Models are dataclasses that are not meant to be manually constructed.
Danger
These are not intended to be created by users and should be treated as read-only.
Note
Although attributes are technically modifiable, it is not recommended to do so.
Bans#
Guild#
- class hypixel.Guild#
Guild model object.
- id#
- name#
- exp#
- created#
- level#
- legacy_rank = None#
- members#
- ranks#
- winners = 0#
- experience_kings = 0#
- most_online_players = 0#
- joinable = False#
- tag = None#
- tag_color = None#
- description = None#
- preferred_games#
- publicly_listed = False#
- game_exp#
Key#
Leaderboards#
Player#
- class hypixel.models.player.Player#
Player model object.
Tip
You can use the
==operator to compare twoPlayerclasses.- first_login#
The first login time represented as a datetime in the UTC timezone.
- Type:
- name#
The username of the player with correct capitalization.
Note
If the player changed their username after
last_login, then this attribute will be outdated.- Type:
- last_login#
The last login time represented as a datetime in the UTC timezone.
- Type:
- last_logout#
The last logout time represented as a datetime in the UTC timezone.
- Type:
- achievements#
A list of achievement name strings.
Tip
You can use
hypixel.Achievement.from_type()to get the achievement object from its type name string. You can also usebuild_achievements()to build a list ofAchievementobjects.- Type:
List[
str]
- channel#
The current text channel the player is in.
Note
Will be
Noneif the player’sOnline StatusAPI setting is disabled.- Type:
Optional[
str]
- rank#
A string representation of the player’s rank if it exists; otherwise
None.Possible values are
'VIP','VIP+','MVP','MVP+','MVP++','YOUTUBE','PIG+++','MOJANG','GAME MASTER','ADMIN', and'OWNER'.- Type:
Optional[
str]
- plus_color#
The player’s plus color if their rank has a plus in it; otherwise
None.- Type:
Optional[
Color]
- most_recent_game#
The player’s most recent game they played.
Note
Will be
Noneif the player’sRecent GamesAPI setting is disabled.- Type:
Optional[
Game]
- murder_mystery#
A model for abstracting murder mystery data.
- Type:
- tkr#
A model for abstracting tkr data.
- Type:
- build_achievements()#
Converts the achievements in
achievementsto List[Achievement].Warning
If the package
hypixel.py-datais not installed, this will convertachievementsto an empty list.
- class hypixel.models.player.Arcade#
Arcade(_data: dict, coins: int = 0)
- coins = 0#
- ctw#
- hypixel_says#
- mini_walls#
- party_games#
- class hypixel.models.player.CaptureTheWool#
CaptureTheWool(captures: int = 0, kills_assists: int = 0)
- captures = 0#
- kills_assists = 0#
- class hypixel.models.player.HypixelSays#
HypixelSays(rounds: int = 0, wins: int = 0, top_score: int = 0)
- rounds = 0#
- wins = 0#
- top_score = 0#
- losses#
- wlr#
- class hypixel.models.player.MiniWalls#
MiniWalls(kills: int = 0, deaths: int = 0, wins: int = 0, final_kills: int = 0, wither_kills: int = 0, wither_damage: int = 0, arrows_hit: int = 0, arrows_shot: int = 0)
- kills = 0#
- deaths = 0#
- wins = 0#
- final_kills = 0#
- wither_kills = 0#
- wither_damage = 0#
- arrows_hit = 0#
- arrows_shot = 0#
- kdr#
- class hypixel.models.player.PartyGames#
PartyGames(wins: int = 0, wins_2: int = 0, wins_3: int = 0)
- wins = 0#
- wins_2 = 0#
- wins_3 = 0#
- total_wins#
- class hypixel.models.player.Bedwars#
Base model for bedwars stats.
Note
Overall stats only include core modes.
- games#
Total games played.
Note
This number is usually a bit higher than self.wins + self.losses for an unknown reason.
- Type:
- winstreak#
Winstreak.
Note
If the player has winstreaks disabled in their API settings, then this will be
None.- Type:
Optional[
int]
- solo#
A model for abstracting solo bedwars data.
- Type:
- doubles#
A model for abstracting doubles bedwars data.
- Type:
- threes#
A model for abstracting threes bedwars data.
- Type:
- fours#
A model for abstracting fours bedwars data.
- Type:
- teams#
A model for abstracting teams bedwars data.
- Type:
- class hypixel.models.player.BedwarsMode#
Base model for bedwars mode stats.
- games#
Total games played.
Note
This number tends to be a bit higher than self.wins + self.losses for an unknown/unresearched reason.
- Type:
- class hypixel.models.player.Blitz#
Blitz(coins: int = 0, kills: int = 0, deaths: int = 0, wins: int = 0, wins_solo: int = 0, wins_team: int = 0, arrows_hit: int = 0, arrows_shot: int = 0, chests_opened: int = 0, games: int = 0)
- coins = 0#
- kills = 0#
- deaths = 0#
- wins = 0#
- wins_solo = 0#
- wins_team = 0#
- arrows_hit = 0#
- arrows_shot = 0#
- chests_opened = 0#
- games = 0#
- kdr#
- wlr#
- ar#
- class hypixel.models.player.Duels#
Duels(_data: dict, coins: int = 0, kills: int = 0, deaths: int = 0, wins: int = 0, losses: int = 0, melee_hits: int = 0, melee_swings: int = 0, arrows_hit: int = 0, arrows_shot: int = 0)
- coins = 0#
- kills = 0#
- deaths = 0#
- wins = 0#
- losses = 0#
- melee_hits = 0#
- melee_swings = 0#
- arrows_hit = 0#
- arrows_shot = 0#
- wlr#
- mr#
- ar#
- title#
- blitz#
- bow#
- boxing#
- bridge#
- classic#
- combo#
- mega_walls#
- no_debuff#
- op#
- parkour#
- skywars#
- sumo#
- tnt_games#
- uhc#
- class hypixel.models.player.DuelsMode#
DuelsMode(_data: dict, _mode: str, kills: int = 0, deaths: int = 0, wins: int = 0, losses: int = 0, melee_hits: int = 0, melee_swings: int = 0, arrows_hit: int = 0, arrows_shot: int = 0)
- kills = 0#
- deaths = 0#
- wins = 0#
- losses = 0#
- melee_hits = 0#
- melee_swings = 0#
- arrows_hit = 0#
- arrows_shot = 0#
- wlr#
- mr#
- ar#
- title#
- class hypixel.models.player.MurderMystery#
MurderMystery(_data: dict, coins: int = 0, games: int = 0, wins: int = 0, kills: int = 0, deaths: int = 0, bow_kills: int = 0, knife_kills: int = 0, thrown_knife_kills: int = 0, murderer_wins: int = 0, detective_wins: int = 0)
- coins = 0#
- games = 0#
- wins = 0#
- kills = 0#
- deaths = 0#
- bow_kills = 0#
- knife_kills = 0#
- thrown_knife_kills = 0#
- murderer_wins = 0#
- detective_wins = 0#
- kdr#
- assassins#
- classic#
- double_up#
- hardcore#
- showdown#
- class hypixel.models.player.MurderMysteryMode#
MurderMysteryMode(games: int = 0, wins: int = 0, kills: int = 0, deaths: int = 0, bow_kills: int = 0, knife_kills: int = 0, thrown_knife_kills: int = 0, removed: bool = False)
- games = 0#
- wins = 0#
- kills = 0#
- deaths = 0#
- bow_kills = 0#
- knife_kills = 0#
- thrown_knife_kills = 0#
- removed = False#
- kdr#
- class hypixel.models.player.Paintball#
Paintball(coins: int = 0, wins: int = 0, kills: int = 0, deaths: int = 0, killstreaks: int = 0, shots_fired: int = 0)
- coins = 0#
- wins = 0#
- kills = 0#
- deaths = 0#
- killstreaks = 0#
- shots_fired = 0#
- kdr#
- skr#
- class hypixel.models.player.Parkour#
Parkour(_data: dict)
- arcade#
- bedwars#
- blitz#
- build_battle#
- cops_and_crims#
- duels#
- main#
- mega_walls#
- murder_mystery#
- skywars#
- smash#
- tnt#
- uhc#
- warlords#
- class hypixel.models.player.ParkourLobby#
ParkourLobby(completed: datetime.datetime, time: datetime.timedelta)
- completed#
- time#
- class hypixel.models.player.Skywars#
Skywars(_data: dict, coins: int = 0, kills: int = 0, deaths: int = 0, wins: int = 0, losses: int = 0, games: int = 0, arrows_hit: int = 0, arrows_shot: int = 0, winstreak: Union[int, NoneType] = None, souls: int = 0, exp: int = 0)
- level#
- coins = 0#
- kills = 0#
- deaths = 0#
- wins = 0#
- losses = 0#
- games = 0#
- arrows_hit = 0#
- arrows_shot = 0#
- winstreak = None#
- souls = 0#
- exp = 0#
- kdr#
- wlr#
- ar#
- ranked#
- solo_normal#
- solo_insane#
- team_normal#
- team_insane#
- mega_normal#
- mega_doubles#
- class hypixel.models.player.SkywarsMode#
SkywarsMode(kills: int = 0, deaths: int = 0, wins: int = 0, losses: int = 0)
- kills = 0#
- deaths = 0#
- wins = 0#
- losses = 0#
- kdr#
- wlr#
- class hypixel.models.player.Socials#
Socials(discord: Union[str, NoneType] = None, youtube: Union[str, NoneType] = None, twitter: Union[str, NoneType] = None, twitch: Union[str, NoneType] = None, instagram: Union[str, NoneType] = None, hypixel_forums: Union[str, NoneType] = None)
- discord = None#
- youtube = None#
- twitter = None#
- twitch = None#
- instagram = None#
- hypixel_forums = None#
- class hypixel.models.player.TurboKartRacers#
TurboKartRacers(coins: int = 0, laps: int = 0, gold: int = 0, silver: int = 0, bronze: int = 0, blue_torpedo_hits: int = 0, banana_hits: int = 0, bananas_received: int = 0, wins: int = 0)
- coins = 0#
- laps = 0#
- gold = 0#
- silver = 0#
- bronze = 0#
- blue_torpedo_hits = 0#
- banana_hits = 0#
- bananas_received = 0#
- wins = 0#
- br#
- class hypixel.models.player.Uhc#
Uhc(_data: dict, coins: int = 0, score: int = 0, parkour_1: bool = False, parkour_2: bool = False)
- level#
- coins = 0#
- score = 0#
- parkour_1 = False#
- parkour_2 = False#
- wins#
- kills#
- deaths#
- heads_eaten#
- ultimates_crafted#
- solo#
- team#
- brawl#
- kdr#
- class hypixel.models.player.UhcMode#
UhcMode(wins: int = 0, kills: int = 0, deaths: int = 0, heads_eaten: int = 0, ultimates_crafted: int = 0)
- wins = 0#
- kills = 0#
- deaths = 0#
- heads_eaten = 0#
- ultimates_crafted = 0#
- kdr#
- class hypixel.models.player.WoolGames#
WoolGames(_data: dict, level: int = 1, coins: int = 0, exp: int = 0)
- level = 1#
- coins = 0#
- exp = 0#
- wool_wars#
- class hypixel.models.player.WoolGamesMode#
WoolGamesMode(kills: int = 0, deaths: int = 0, assists: int = 0, wins: int = 0, games: int = 0, blocks_broken: int = 0, wool_placed: int = 0, selected_class: str = None)
- kills = 0#
- deaths = 0#
- assists = 0#
- wins = 0#
- losses#
- games = 0#
- blocks_broken = 0#
- wool_placed = 0#
- selected_class = None#
- kdr#
- wlr#
Status#
Data Classes#
These classes are data containers.
They hold metadata for what would otherwise be arbitrary strings returned by the API.
Achievement#
- class hypixel.Achievement#
Represents a Hypixel achievement.
- global_unlocked#
The percentage of players who have unlocked the achievement.
Note
For achievements which
legacyisTrue, this attribute will beNone.- Type:
Optional[
float]
- game_unlocked#
The percentage of players who have unlocked the achievement that have played the game.
Note
Achievements that do not have a game associated with them will have this attribute as
None.- Type:
Optional[
float]
- classmethod from_type(type_name)#
Constructs an
Achievementfrom its type name.This method requires the
hypixel.py-datapackage.Warning
Some achievements that come from the Hypixel API will return
None. This is because the API does not provide the data for some older achievements.- Parameters:
type_name (
str) – The type name used in Hypixel API attributes.- Returns:
The constructed achievement, or
Noneif the achievement could not be found.- Return type:
Optional[
Achievement]
Color#
- class hypixel.Color#
Represents a Minecraft color.
Game#
- clsGame.from_id
- clsGame.from_type
Utilities#
- defdelay
- class hypixel.ExponentialBackoff(timeout=2048)#
An implementation of the exponential backoff algorithm.
Provides a convenient interface to implement an exponential backoff for reconnecting or retrying transmissions.
Once instantiated, the delay method will return the next interval to wait for when retrying a connection or transmission. The maximum delay increases exponentially with each retry up to a maximum of 2^10 * base.
- Raises:
TimeoutError – Raised when the difference of time from the last request is greater than the client’s timeout.
- delay()#
Compute the next delay.
Returns the next delay to wait according to the exponential backoff algorithm. This is a value between 0 and base * 2^exp where exponent starts off at 1 and is incremented at every invocation of this method up to a maximum of 10.
If a period of more than base * 2^11 has passed since the last retry, the exponent is reset to 1.
Exceptions#
- exception hypixel.HypixelException#
Base exception for hypixel.py
Theoretically, this can be used to catch all errors from this library.
- exception hypixel.ArgumentError(message)#
Raised when a passed argument is faulty.
Inherits from
HypixelExceptionNote
Could be from either an invalid type or if the argument passed does not yield an API response.
- exception hypixel.InvalidPlayerId(player_id)#
Raised when a passed player id is not a string.
Inherits from
ArgumentError
- exception hypixel.PlayerNotFound(player)#
Raised when a requested player does not exist.
Inherits from
ArgumentError
- exception hypixel.KeyNotFound(key)#
Raised when a requested key does not exist.
Inherits from
ArgumentError
- exception hypixel.ApiError(response, api, message=None)#
Base exception for when an API request fails.
Inherits from
HypixelException- response#
The client response object that was received.
- Type:
- exception hypixel.TimeoutError(api)#
Raised when the client did not receive a response within the required time.
Inherits from
ApiError
- exception hypixel.RateLimitError(retry_after, api, response)#
Raised when the rate limit is reached.
Inherits from
ApiErrorNote
Will not be raised if
Client.handle_rate_limitsisTrue(default).- retry_after#
The time to wait until to retry a request.
- Type:
- exception hypixel.InvalidApiKey(key, message=None)#
Base exception for invalid API key exceptions.
Inherits from
ArgumentErrorNote
Will not be raised until a request is made unless the key is malformed or
Client.validate_keys()is called.Warning
For simplicity, if multiple API keys are invalid, only the first one will be included, even if
Client.validate_keys()is called multiple times.
- exception hypixel.MalformedApiKey(key)#
Raised when a passed API key is not in valid uuid format.
Inherits from
InvalidApiKeyandValueError- key#
The key that caused the error. See
InvalidApiKeyfor details.- Type:
- exception hypixel.KeyRequired(path)#
Raised when an API key is required but none were passed.
Inherits from
InvalidApiKeyandTypeError
- exception hypixel.ClosedSession#
Raised when the Client tries to make an API call after
Client.close()is called.Inherits from
HypixelExceptionandRuntimeErrorNote
If
Client.cacheisTrueand the response is stored in cache,ClosedSessionwon’t be raised and the function will return normally.
- exception hypixel.LoopPolicyError#
Raised when the event loop policy is misconfigured.
Inherits from
HypixelExceptionandRuntimeError
- exception hypixel.GuildNotFound(guild)#
Raised when a requested guild does not exist.
Inherits from
ArgumentError