hypixel

package module
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

README

hypixel-api

ci lint CodeQL Advanced Dependabot Updates Go Report Card GitHub release License

Hypixel API wrapper in Golang

📕 Hypixel API

⚠️ Hypixel API Policy

License

GPL-3.0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback added in v1.0.2

type Callback func(request Request, response Response, err error) (Response, error)

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(key string, rate *RateLimit) *Client

NewClient creates a new hypixel client key is your hypixel api key

https://api.hypixel.net/

func (*Client) AuthHeader added in v1.0.1

func (c *Client) AuthHeader(header ...http.Header) http.Header

AuthHeader Add api key to header

https://api.hypixel.net/#section/Authentication/ApiKey

func (*Client) Get added in v1.0.2

func (c *Client) Get(r Request) (Response, error)

Get Hypixel API HTTP Request

func (*Client) GetAPIKey

func (c *Client) GetAPIKey() string

func (*Client) GetAchievements added in v1.0.1

func (c *Client) GetAchievements() (Response, error)

GetAchievements Achievements

https://api.hypixel.net/#tag/Resources/paths/~1v2~1resources~1achievements/get

func (*Client) GetActiveAuctions added in v1.0.1

func (c *Client) GetActiveAuctions(page uint) (Response, error)

GetActiveAuctions Active auctions Returns the currently active auctions sorted by last updated first and paginated.

https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1skyblock~1auctions/get

func (*Client) GetActiveNetworkBoosters added in v1.0.1

func (c *Client) GetActiveNetworkBoosters() (Response, error)

GetActiveNetworkBoosters Active Network Boosters NEED API Key

https://api.hypixel.net/#tag/Other/paths/~1v2~1boosters/get

func (*Client) GetActiveOrUpcomingFireSales added in v1.0.1

func (c *Client) GetActiveOrUpcomingFireSales() (Response, error)

GetActiveOrUpcomingFireSales Active/Upcoming Fire Sales Retrieve the currently active or upcoming Fire Sales for SkyBlock.

https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1skyblock~1firesales/get

func (*Client) GetAuctions added in v1.0.1

func (c *Client) GetAuctions(uuid, player, profile string) (Response, error)

GetAuctions Request auction(s) by the auction UUID, player UUID, or profile UUID. Returns the auctions selected by the provided query. Only one query parameter can be used in a single request, and cannot be filtered by multiple. NEED API Key

https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1skyblock~1auction/get

func (*Client) GetBaseURL

func (c *Client) GetBaseURL() string

func (*Client) GetBazaar added in v1.0.1

func (c *Client) GetBazaar() (Response, error)

GetBazaar Bazaar Returns the list of products along with their sell summary, buy summary and quick status. Product Description The returned product info has 3 main fields:

buy_summary sell_summary quick_status buy_summary and are the current top 30 orders for each transaction type (in-game example: Stock of Stonks).sell_summary

quick_status is a computed summary of the live state of the product (used for advanced mode view in the bazaar):

sellVolume and are the sum of item amounts in all orders.buyVolume sellPrice and are the weighted average of the top 2% of orders by volume.buyPrice movingWeek is the historic transacted volume from last 7d + live state. sellOrders and are the count of active orders. buyOrders

https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1skyblock~1bazaar/get

func (*Client) GetBingoData added in v1.0.1

func (c *Client) GetBingoData(uuid string) (Response, error)

GetBingoData Bingo data by player Bingo data for participated events of the provided player. NEED API Key

https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1skyblock~1bingo/get

func (*Client) GetCallback added in v1.0.2

func (c *Client) GetCallback() Callback

func (*Client) GetChallenges added in v1.0.1

func (c *Client) GetChallenges() (Response, error)

GetChallenges Challenges

https://api.hypixel.net/#tag/Resources/paths/~1v2~1resources~1challenges/get

func (*Client) GetCurrentLeaderboards added in v1.0.1

func (c *Client) GetCurrentLeaderboards() (Response, error)

GetCurrentLeaderboards Current Leaderboards NEED API Key

https://api.hypixel.net/#tag/Other/paths/~1v2~1leaderboards/get

func (*Client) GetCurrentPlayerCounts added in v1.0.1

func (c *Client) GetCurrentPlayerCounts() (Response, error)

GetCurrentPlayerCounts Current Player Counts NEED API Key

https://api.hypixel.net/#tag/Other/paths/~1v2~1counts/get

func (*Client) GetCurrentlyActivePublicHouses added in v1.0.1

func (c *Client) GetCurrentlyActivePublicHouses() (Response, error)

GetCurrentlyActivePublicHouses currently active public houses. This data may be cached for a short period of time. NEED API Key

https://api.hypixel.net/#tag/Housing/paths/~1v2~1housing~1active/get

func (*Client) GetFullPath

func (c *Client) GetFullPath(path string) string

func (*Client) GetGamesInformation added in v1.0.1

func (c *Client) GetGamesInformation() (Response, error)

GetGamesInformation Game Information Returns information about Hypixel Games. This endpoint is in early development and we are working to add more information when possible

https://api.hypixel.net/#tag/Resources/paths/~1v2~1resources~1games/get

func (*Client) GetGardenData added in v1.0.1

func (c *Client) GetGardenData(profile string) (Response, error)

GetGardenData Garden data by profile ID SkyBlock garden data for the provided profile. NEED API Key

https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1skyblock~1garden/get

func (*Client) GetGuild

func (c *Client) GetGuild(id, player, name string) (Response, error)

GetGuild Retrieve a Guild by a player, id, or name NEED API Key

https://api.hypixel.net/#tag/Player-Data/paths/~1v2~1guild/get

func (*Client) GetGuildAchievements added in v1.0.1

func (c *Client) GetGuildAchievements() (Response, error)

GetGuildAchievements Guild Achievements

https://api.hypixel.net/#tag/Resources/paths/~1v2~1resources~1guilds~1achievements/get

func (*Client) GetHTTPClient

func (c *Client) GetHTTPClient() *http.Client

func (*Client) GetMuseumData added in v1.0.1

func (c *Client) GetMuseumData(profile string) (Response, error)

GetMuseumData Museum data by profile ID SkyBlock museum data for all members of the provided profile. The data returned can differ depending on the players in-game API settings. NEED API Key

https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1skyblock~1museum/get

func (*Client) GetPlayerData

func (c *Client) GetPlayerData(uuid string) (Response, error)

GetPlayerData Data of a specific player, including game stats NEED API Key

https://api.hypixel.net/#tag/Player-Data

func (*Client) GetPreRequestHook added in v1.0.2

func (c *Client) GetPreRequestHook() PreRequestHook

func (*Client) GetProfileByUUID added in v1.0.1

func (c *Client) GetProfileByUUID(profile string) (Response, error)

GetProfileByUUID Profile by UUID SkyBlock profile data, such as stats, objectives etc. The data returned can differ depending on the players in-game API settings. NEED API Key

https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1skyblock~1profile/get

func (*Client) GetProfilesByPlayer added in v1.0.1

func (c *Client) GetProfilesByPlayer(uuid string) (Response, error)

GetProfilesByPlayer Profiles by player NEED API Key

https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1skyblock~1profiles/get

func (*Client) GetPunishmentStatistics added in v1.0.1

func (c *Client) GetPunishmentStatistics() (Response, error)

GetPunishmentStatistics Punishment Statistics NEED API Key

https://api.hypixel.net/#tag/Other/paths/~1v2~1punishmentstats/get

func (*Client) GetQuests added in v1.0.1

func (c *Client) GetQuests() (Response, error)

GetQuests Quests

https://api.hypixel.net/#tag/Resources/paths/~1v2~1resources~1quests/get

func (*Client) GetRate added in v1.0.1

func (c *Client) GetRate() *RateLimit

func (*Client) GetRecentGames

func (c *Client) GetRecentGames(uuid string) (Response, error)

GetRecentGames The recently played games of a specific player NEED API Key

https://api.hypixel.net/#tag/Player-Data/paths/~1v2~1recentgames/get

func (*Client) GetRecentlyEndedAuctions added in v1.0.1

func (c *Client) GetRecentlyEndedAuctions() (Response, error)

GetRecentlyEndedAuctions Recently ended auctions SkyBlock auctions which ended in the last 60 seconds.

https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1skyblock~1auctions_ended/get

func (*Client) GetSkyBlockCollections added in v1.0.1

func (c *Client) GetSkyBlockCollections() (Response, error)

GetSkyBlockCollections Collections Information regarding Collections in the SkyBlock game.

https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1resources~1skyblock~1collections/get

func (*Client) GetSkyBlockCurrentBingoEvent added in v1.0.1

func (c *Client) GetSkyBlockCurrentBingoEvent() (Response, error)

GetSkyBlockCurrentBingoEvent Current Bingo Event Information regarding the current bingo event and its goals.

https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1resources~1skyblock~1bingo/get

func (*Client) GetSkyBlockElectionAndMayor added in v1.0.1

func (c *Client) GetSkyBlockElectionAndMayor() (Response, error)

GetSkyBlockElectionAndMayor Election and Mayor Information regarding the current mayor and ongoing election in SkyBlock.

https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1resources~1skyblock~1election/get

func (*Client) GetSkyBlockItems added in v1.0.1

func (c *Client) GetSkyBlockItems() (Response, error)

GetSkyBlockItems Items Information regarding items in the SkyBlock game.

https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1resources~1skyblock~1items/get

func (*Client) GetSkyBlockNews added in v1.0.1

func (c *Client) GetSkyBlockNews() (Response, error)

GetSkyBlockNews News NEED API Key

https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1resources~1skyblock~1news/get

func (*Client) GetSkyBlockSkills added in v1.0.1

func (c *Client) GetSkyBlockSkills() (Response, error)

GetSkyBlockSkills Skills Information regarding skills in the SkyBlock game.

https://api.hypixel.net/#tag/SkyBlock/paths/~1v2~1resources~1skyblock~1skills/get

func (*Client) GetSpecificHouseInformation added in v1.0.1

func (c *Client) GetSpecificHouseInformation(house string) (Response, error)

GetSpecificHouseInformation Information about a specific house. This data may be cached for a short period of time. NEED API Key

https://api.hypixel.net/#tag/Housing/paths/~1v2~1housing~1house/get

func (*Client) GetSpecificPlayerPublicHouses added in v1.0.1

func (c *Client) GetSpecificPlayerPublicHouses(player string) (Response, error)

GetSpecificPlayerPublicHouses The public houses for a specific player.// This data may be cached for a short period of time. NEED API Key

https://api.hypixel.net/#tag/Housing/paths/~1v2~1housing~1houses/get

func (*Client) GetStatus

func (c *Client) GetStatus(uuid string) (Response, error)

GetStatus The current online status of a specific player NEED API Key

https://api.hypixel.net/#tag/Player-Data/paths/~1v2~1status/get

func (*Client) GetVanityCompanions added in v1.0.1

func (c *Client) GetVanityCompanions() (Response, error)

GetVanityCompanions Vanity Companions

https://api.hypixel.net/#tag/Resources/paths/~1v2~1resources~1vanity~1companions/get

func (*Client) GetVanityPets added in v1.0.1

func (c *Client) GetVanityPets() (Response, error)

GetVanityPets Vanity Pets

https://api.hypixel.net/#tag/Resources/paths/~1v2~1resources~1vanity~1pets/get

func (*Client) SetAPIKey

func (c *Client) SetAPIKey(key string)

func (*Client) SetBaseURL

func (c *Client) SetBaseURL(url string)

func (*Client) SetCallback added in v1.0.2

func (c *Client) SetCallback(callBack Callback)

func (*Client) SetHTTPClient

func (c *Client) SetHTTPClient(client *http.Client)

func (*Client) SetPreRequestHook added in v1.0.2

func (c *Client) SetPreRequestHook(beforeSend PreRequestHook)

func (*Client) SetRate added in v1.0.1

func (c *Client) SetRate(rate *RateLimit)

type Params

type Params map[any]any

Params http query use fmt.Sprint parse to string

func (Params) Del

func (p Params) Del(k any)

func (Params) Get

func (p Params) Get(k any) any

func (Params) Has

func (p Params) Has(k any) bool

func (Params) Set

func (p Params) Set(k, v any)

func (Params) String

func (p Params) String(full string) string

String Generate url string If value is empty, it will be ignored

type PreRequestHook added in v1.0.2

type PreRequestHook func(request Request) (Response, error)

type RateLimit

type RateLimit struct {
	// contains filtered or unexported fields
}

func NewRateLimit

func NewRateLimit() *RateLimit

func (*RateLimit) Reset

func (r *RateLimit) Reset()

Reset clears all rate-limit state

func (*RateLimit) String

func (r *RateLimit) String() string

String impl fmt.Stringer

func (*RateLimit) UpdateFromResponse added in v1.0.4

func (r *RateLimit) UpdateFromResponse(resp *http.Response) error

UpdateFromResponse updates rate limit state based on the HTTP response.

func (*RateLimit) WaitIfNeeded

func (r *RateLimit) WaitIfNeeded()

WaitIfNeeded blocks until rate-limit reset if remaining ≤ 0 and resetAt is in the future.

type Request added in v1.0.2

type Request struct {
	Method  string
	Header  http.Header
	Path    string
	URL     string // Replace full url in PreRequestHook and Callback!
	Params  Params
	Payload []byte
}

type Response added in v1.0.2

type Response struct {
	Header  http.Header
	Path    string
	URL     string // Replace full url in Callback
	Status  int
	Content []byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL