JS wrapper for the Hypixel and Mojang APIs.
npm install hypixel-node
const{Hypixel, Mojang}=require('hypixel-node');consthypixel=newHypixel(HYPIXEL_API_KEY);constmojang=newMojang();const{Hypixel}=require('hypixel-node');consthypixel=newHypixel(HYPIXEL_API_KEY);// With Callbackshypixel.getPlayer('Hypixel',(error,player)=>{if(error)returnconsole.log(error);console.log(player)});// Promisifiedhypixel.findGuildByPlayer('Hypixel').then(guild=>{ ... }).catch(error=>{ ... });| Args | Returns | |
|---|---|---|
| getKeyInfo | record | |
| getBoosters | boosters | |
| getLeaderboards | leaderboards | |
| getOnlinePlayers | playerCount | |
| getWatchdogStats | [object] | |
| getGuildByName | name | guild |
| getGuildByPlayer | uuid | guild |
| getGuild* | id/guildname/uuid/ign | guild |
| getFriends | uuid | records |
| getSession | uuid | session |
| getPlayer | username/uuid | player |
*Note: If you use an "ign" with
getGuild, it will use 3 api calls.
| Property | Method | Description | Type |
|---|---|---|---|
| player | getLevel | Returns the Hypixel level for the player. | Number |
| getRank | Returns the rank of the player. | String | |
| isOnline | Returns 'true' of the player is online. | Boolean | |
| guild | getGuildLevel | Returns information about the guild's level. | Object |
async()=>{letplayer=awaithypixel.getPlayer('Hypixel');console.log(player.getRank())// "[OWNER]"console.log(player.getRank(false))// "OWNER"console.log(player.getLevel())// 223console.log(player.isOnline())// falseletguild=awaithypixel.getGuild('RandyGuild');console.log(guild.getGuildLevel())/* { level: 4, totalExp: 1500000, expToNextLevel: 250000 } */}const{Mojang}=require('hypixel-node');constmojang=newMojang();// With Callbacksmojang.getUUID('Hypixel',(error,uuid)=>{if(error)returnconsole.log(error);console.log(uuid)});// Promisifiedmojang.getNameHistory('Hypixel').then(guild=>{ ... }).catch(error=>{ ... });| Args | Returns | |
|---|---|---|
| getUUID | name | uuid |
| getName | uuid | name |
| getStatus | [object] | |
| getNameHistory | name/uuid | [object] |