hypixel
v1.0.3
Published
A node client library for the Hypixel API
Downloads
13
Readme
Hypixel API for Node.js
This is a client library for the public Hypixel API.
const Hypixel = require('hypixel');
const client = new Hypixel({ key: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' });
// old school callbacks
client.getPlayerByUsername('PxlPanda', (err, player) => {
if (err) {
return console.info('Nope!');
}
// or a Promise if no callback provided
client.findGuildByPlayer(player.uuid)
.then((guildId) => {
...
})
.catch((err) => {
...
});
});
Installation
npm install hypixel
Notes
When querying data by player UUIDs make sure to remove dashes.
Examples
Create a Client instance
const Hypixel = require('hypixel');
const client = new Hypixel({ key: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' });
Get Key Info
client.getKeyInfo((err, info) => { ... });
Find Guild Id By Name
client.findGuildByName(name, (err, guildId) => { ... });
Find Guild Id By Player
client.findGuildByPlayer(playerUuid, (err, guildId) => { ... });
Get Guild Info
client.getGuild(guildId, (err, guild) => { ... });
Get Active Boosters
client.getBoosters((err, boosters) => { ... });
Get Friends
client.getFriends(playerUuidOrUsername, (err, friends) => { ... });
Get Session
client.getSession(playerUuidOrUsername, (err, sessionId) => { ... });
Get Player Info
client.getPlayer(playerUuid, (err, player) => { ... });
Get Player Info (by username)
client.getPlayer(username, (err, player) => { ... });