hywrapper-ts / Exports / HypixelClient
Class: HypixelClient
A client for interacting with the Hypixel API.
This client handles authentication, rate limiting, and automatic retries. It uses Promises for asynchronous requests.
Param
The Hypixel API key.
Param
The base URL for the Hypixel API.
Param
The duration for which successful responses should be cached.
Param
Whether to automatically retry requests that fail due to rate limiting.
Param
The maximum number of retries for rate-limited requests.
Table of contents
Constructors
Properties
Accessors
Methods
- fetch
- getAchievements
- getAuction
- getAuctions
- getAuctionsEnded
- getBazaar
- getBingo
- getBoosters
- getChallenges
- getCollections
- getCounts
- getElection
- getFiresales
- getGames
- getGarden
- getGuildAchievements
- getGuildById
- getGuildByName
- getGuildByPlayer
- getHousingActive
- getHousingHouse
- getHousingHouses
- getItems
- getLeaderboards
- getMuseum
- getNews
- getPlayer
- getPlayerBingo
- getProfile
- getProfiles
- getPunishmentStats
- getQuests
- getRecentGames
- getSkills
- getStatus
- getVanityCompanions
- getVanityPets
- parseRateLimit
Constructors
constructor
• new HypixelClient(options): HypixelClient
Parameters
| Name | Type |
|---|---|
options |
ClientOptions |
Returns
Defined in
src/client.ts:78
Properties
_lastRateLimit
• Private _lastRateLimit: null | RateLimit = null
Defined in
src/client.ts:76
apiKey
• Private Readonly apiKey: string
Defined in
src/client.ts:69
autoRetry
• Private Readonly autoRetry: boolean
Defined in
src/client.ts:72
axiosInstance
• Private Readonly axiosInstance: AxiosInstance
Defined in
src/client.ts:74
baseUrl
• Private Readonly baseUrl: string
Defined in
src/client.ts:70
defaultCacheDurationMinutes
• Private Readonly defaultCacheDurationMinutes: number
Defined in
src/client.ts:71
maxRetries
• Private Readonly maxRetries: number
Defined in
src/client.ts:73
Accessors
lastRateLimit
• get lastRateLimit(): null | RateLimit
The rate limit information from the last successful API request.
Returns
null | RateLimit
Defined in
src/client.ts:104
Methods
fetch
▸ fetch\<T>(endpoint, params?, authenticated?): Promise\<T>
Type parameters
| Name | Type |
|---|---|
T |
extends HypixelResponse |
Parameters
| Name | Type | Default value |
|---|---|---|
endpoint |
string |
undefined |
params |
Record\<string, string> |
{} |
authenticated |
boolean |
true |
Returns
Promise\<T>
Defined in
src/client.ts:439
getAchievements
▸ getAchievements(): Promise\<AchievementsResponse>
Retrieves the list of achievements. https://api.hypixel.net/v2/resources/achievements
Returns
Promise\<AchievementsResponse>
Defined in
src/client.ts:187
getAuction
▸ getAuction(uuid?, player?, profile?): Promise\<AuctionsResponse>
Searches for SkyBlock auctions by UUID, player, or profile. https://api.hypixel.net/v2/skyblock/auction
Parameters
| Name | Type | Description |
|---|---|---|
uuid? |
string |
The auction UUID. |
player? |
string |
The player UUID. |
profile? |
string |
The profile UUID. |
Returns
Promise\<AuctionsResponse>
Defined in
src/client.ts:287
getAuctions
▸ getAuctions(page?): Promise\<AuctionsResponse>
Retrieves active SkyBlock auctions. https://api.hypixel.net/v2/skyblock/auctions
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
page |
number |
0 |
The page number to get. |
Returns
Promise\<AuctionsResponse>
Defined in
src/client.ts:301
getAuctionsEnded
▸ getAuctionsEnded(): Promise\<AuctionsEndedResponse>
Retrieves recently ended SkyBlock auctions. https://api.hypixel.net/v2/skyblock/auctions_ended
Returns
Promise\<AuctionsEndedResponse>
Defined in
src/client.ts:309
getBazaar
▸ getBazaar(): Promise\<BazaarResponse>
Retrieves current bazaar data. https://api.hypixel.net/v2/skyblock/bazaar
Returns
Promise\<BazaarResponse>
Defined in
src/client.ts:317
getBingo
▸ getBingo(): Promise\<BingoResponse>
Retrieves the current SkyBlock bingo information. https://api.hypixel.net/v2/resources/skyblock/bingo
Returns
Promise\<BingoResponse>
Defined in
src/client.ts:267
getBoosters
▸ getBoosters(): Promise\<BoostersResponse>
Retrieves the current boosters. https://api.hypixel.net/v2/boosters
Returns
Promise\<BoostersResponse>
Defined in
src/client.ts:411
getChallenges
▸ getChallenges(): Promise\<ChallengesResponse>
Retrieves the list of challenges. https://api.hypixel.net/v2/resources/challenges
Returns
Promise\<ChallengesResponse>
Defined in
src/client.ts:195
getCollections
▸ getCollections(): Promise\<CollectionsResponse>
Retrieves the list of SkyBlock collections. https://api.hypixel.net/v2/resources/skyblock/collections
Returns
Promise\<CollectionsResponse>
Defined in
src/client.ts:235
getCounts
▸ getCounts(): Promise\<CountsResponse>
Retrieves the player counts across various games. https://api.hypixel.net/v2/counts
Returns
Promise\<CountsResponse>
Defined in
src/client.ts:419
getElection
▸ getElection(): Promise\<ElectionResponse>
Retrieves the current SkyBlock election information. https://api.hypixel.net/v2/resources/skyblock/election
Returns
Promise\<ElectionResponse>
Defined in
src/client.ts:259
getFiresales
▸ getFiresales(): Promise\<FiresalesResponse>
Retrieves current SkyBlock fire sales. https://api.hypixel.net/v2/skyblock/firesales
Returns
Promise\<FiresalesResponse>
Defined in
src/client.ts:375
getGames
▸ getGames(): Promise\<GamesResponse>
Retrieves the list of games. https://api.hypixel.net/v2/resources/games
Returns
Promise\<GamesResponse>
Defined in
src/client.ts:179
getGarden
▸ getGarden(profileUuid): Promise\<GardenResponse>
Retrieves SkyBlock garden information for a profile. https://api.hypixel.net/v2/skyblock/garden
Parameters
| Name | Type | Description |
|---|---|---|
profileUuid |
string |
The UUID of the SkyBlock profile. |
Returns
Promise\<GardenResponse>
Defined in
src/client.ts:357
getGuildAchievements
▸ getGuildAchievements(): Promise\<GuildsAchievementsResponse>
Retrieves the list of guild achievements. https://api.hypixel.net/v2/resources/guilds/achievements
Returns
Promise\<GuildsAchievementsResponse>
Defined in
src/client.ts:211
getGuildById
▸ getGuildById(id): Promise\<GuildResponse>
Retrieves a guild by an id. https://api.hypixel.net/v2/guild
Parameters
| Name | Type | Description |
|---|---|---|
id |
string |
The ID of the guild. |
Returns
Promise\<GuildResponse>
A GuildResponse containing the guild's data.
Defined in
src/client.ts:149
getGuildByName
▸ getGuildByName(name): Promise\<GuildResponse>
Retrieves a guild by a name. https://api.hypixel.net/v2/guild
Parameters
| Name | Type | Description |
|---|---|---|
name |
string |
The name of the guild. |
Returns
Promise\<GuildResponse>
A GuildResponse containing the guild's data.
Defined in
src/client.ts:171
getGuildByPlayer
▸ getGuildByPlayer(uuid): Promise\<GuildResponse>
Retrieves a guild by a player. https://api.hypixel.net/v2/guild
Parameters
| Name | Type | Description |
|---|---|---|
uuid |
string |
The UUID of the player. |
Returns
Promise\<GuildResponse>
A GuildResponse containing the guild's data.
Defined in
src/client.ts:160
getHousingActive
▸ getHousingActive(): Promise\<HousingActiveResponse>
Retrieves the currently active housing. https://api.hypixel.net/v2/housing/active
Returns
Promise\<HousingActiveResponse>
Defined in
src/client.ts:383
getHousingHouse
▸ getHousingHouse(houseUuid): Promise\<HousingHouseResponse>
Retrieves information about a specific housing instance. https://api.hypixel.net/v2/housing/house
Parameters
| Name | Type | Description |
|---|---|---|
houseUuid |
string |
The UUID of the housing instance. |
Returns
Promise\<HousingHouseResponse>
Defined in
src/client.ts:393
getHousingHouses
▸ getHousingHouses(uuid): Promise\<HousingHousesResponse>
Retrieves the housing instances owned by a player. https://api.hypixel.net/v2/housing/houses
Parameters
| Name | Type | Description |
|---|---|---|
uuid |
string |
The UUID of the player. |
Returns
Promise\<HousingHousesResponse>
Defined in
src/client.ts:403
getItems
▸ getItems(): Promise\<ItemsResponse>
Retrieves the list of SkyBlock items. https://api.hypixel.net/v2/resources/skyblock/items
Returns
Promise\<ItemsResponse>
Defined in
src/client.ts:251
getLeaderboards
▸ getLeaderboards(): Promise\<LeaderboardsResponse>
Retrieves the current leaderboards. https://api.hypixel.net/v2/leaderboards
Returns
Promise\<LeaderboardsResponse>
Defined in
src/client.ts:427
getMuseum
▸ getMuseum(profileUuid): Promise\<MuseumResponse>
Retrieves SkyBlock museum information for a profile. https://api.hypixel.net/v2/skyblock/museum
Parameters
| Name | Type | Description |
|---|---|---|
profileUuid |
string |
The UUID of the SkyBlock profile. |
Returns
Promise\<MuseumResponse>
Defined in
src/client.ts:347
getNews
▸ getNews(): Promise\<NewsResponse>
Retrieves SkyBlock news. https://api.hypixel.net/v2/skyblock/news
Returns
Promise\<NewsResponse>
Defined in
src/client.ts:275
getPlayer
▸ getPlayer(uuid): Promise\<PlayerResponse>
Retrieves data of a specific player, including game stats. https://api.hypixel.net/v2/player
Parameters
| Name | Type | Description |
|---|---|---|
uuid |
string |
The UUID of the player. |
Returns
Promise\<PlayerResponse>
A PlayerResponse containing the player's data.
Throws
HypixelException if the API returns an error.
Defined in
src/client.ts:116
getPlayerBingo
▸ getPlayerBingo(uuid): Promise\<BingoResponse>
Retrieves SkyBlock bingo data for a player. https://api.hypixel.net/v2/skyblock/bingo
Parameters
| Name | Type | Description |
|---|---|---|
uuid |
string |
The UUID of the player. |
Returns
Promise\<BingoResponse>
Defined in
src/client.ts:367
getProfile
▸ getProfile(uuid): Promise\<ProfileResponse>
Retrieves a specific SkyBlock profile by its UUID. https://api.hypixel.net/v2/skyblock/profile
Parameters
| Name | Type | Description |
|---|---|---|
uuid |
string |
The UUID of the profile. |
Returns
Promise\<ProfileResponse>
Defined in
src/client.ts:327
getProfiles
▸ getProfiles(uuid): Promise\<ProfilesResponse>
Retrieves all SkyBlock profiles for a player. https://api.hypixel.net/v2/skyblock/profiles
Parameters
| Name | Type | Description |
|---|---|---|
uuid |
string |
The UUID of the player. |
Returns
Promise\<ProfilesResponse>
Defined in
src/client.ts:337
getPunishmentStats
▸ getPunishmentStats(): Promise\<PunishmentStatsResponse>
Retrieves punishment statistics. https://api.hypixel.net/v2/punishmentstats
Returns
Promise\<PunishmentStatsResponse>
Defined in
src/client.ts:435
getQuests
▸ getQuests(): Promise\<QuestsResponse>
Retrieves the list of quests. https://api.hypixel.net/v2/resources/quests
Returns
Promise\<QuestsResponse>
Defined in
src/client.ts:203
getRecentGames
▸ getRecentGames(uuid): Promise\<RecentGamesResponse>
Retrieves the recently played games of a specific player. https://api.hypixel.net/v2/recentgames
Parameters
| Name | Type | Description |
|---|---|---|
uuid |
string |
The UUID of the player. |
Returns
Promise\<RecentGamesResponse>
A RecentGamesResponse containing the recent games data.
Defined in
src/client.ts:127
getSkills
▸ getSkills(): Promise\<SkillsResponse>
Retrieves SkyBlock skills information. https://api.hypixel.net/v2/resources/skyblock/skills
Returns
Promise\<SkillsResponse>
Defined in
src/client.ts:243
getStatus
▸ getStatus(uuid): Promise\<OnlineResponse>
Retrieves the current online status of a specific player. https://api.hypixel.net/v2/status
Parameters
| Name | Type | Description |
|---|---|---|
uuid |
string |
The UUID of the player. |
Returns
Promise\<OnlineResponse>
An OnlineResponse containing the player's online status.
Defined in
src/client.ts:138
getVanityCompanions
▸ getVanityCompanions(): Promise\<VanityResponse>
Retrieves the list of vanity companions. https://api.hypixel.net/v2/resources/vanity/companions
Returns
Promise\<VanityResponse>
Defined in
src/client.ts:227
getVanityPets
▸ getVanityPets(): Promise\<VanityResponse>
Retrieves the list of vanity pets. https://api.hypixel.net/v2/resources/vanity/pets
Returns
Promise\<VanityResponse>
Defined in
src/client.ts:219
parseRateLimit
▸ parseRateLimit(headers): null | RateLimit
Parameters
| Name | Type |
|---|---|
headers |
any |
Returns
null | RateLimit
Defined in
src/client.ts:534