API Reference

This section outlines the functions and methods that are available as part of hypixel.py.

It is automatically generated and updated from the Docstrings present within the source.

Note

This documentation is designed to be as easy to read and understand as possible. It aims to be a comprehensive reference for the API, but please note that there may be missing functions or methods.

Version Information

There is one main way to get the version for this library.

hypixel.__version__

Return the version number as a string. Example: '0.6.5'

Miscellaneous Functions

hypixel.setKeys(api_keys)[source]

This function is used to set your Hypixel API keys. It also checks that they are valid/working.

Raises:HypixelAPIError – If any of the keys are invalid or don’t work, this will be raised.
Parameters:api_keys (list) –

A list of the API keys that you would like to use.

Example: ['740b8cf8-8aba-f2ed-f7b10119d28'].

hypixel.setCacheTime(seconds)[source]

This function sets how long the request cache should last, in seconds.

Parameters:seconds (float) – How long you would like Hypixel-API requests to be cached for.

Player

class hypixel.Player(UUID)[source]

This class represents a player on Hypixel as a single object. A player has a UUID, a username, statistics etc.

Raises:PlayerNotFoundException – If the player cannot be found, this will be raised.
Parameters:Username/UUID (string) – Either the UUID or the username (Deprecated) for a Minecraft player.
JSON

The raw JSON receieved from the Hypixel API.

Type:string
UUID

The player’s UUID.

Type:string
getGuildID()[source]

This function is used to get a GuildID from a player.

getLevel()[source]

This function calls leveling.py to calculate a player’s network level.

getName()[source]

Just return player’s name.

getPlayerInfo()[source]

This is a simple function to return a bunch of common data about a player.

getRank()[source]

This function returns a player’s rank, from their data.

getSession()[source]

This function is used to get a player’s session information.

Guild

class hypixel.Guild(GuildID)[source]

This class represents a guild on Hypixel as a single object. A guild has a name, members etc.

Parameters:GuildID (string) – The ID for a Guild. This can be found by using Player.getGuildID().
JSON

The raw JSON receieved from the Hypixel API.

Type:string
GuildID

The Guild’s GuildID.

Type:string
getMembers()[source]

This function enumerates all the members in a guild. Mojang’s API rate-limits this weirdly. This is an extremely messy helper function. Use at your own risk.

Exceptions

exception hypixel.HypixelAPIError[source]

Simple exception if something’s gone very wrong and the program can’t continue.

exception hypixel.PlayerNotFoundException[source]

Simple exception if a player/UUID is not found. This exception can usually be ignored. You can catch this exception with except hypixel.PlayerNotFoundException: