hypixel

1.0.3 • Public • Published

Hypixel API for Node.js

This is a client library for the public Hypixel API.

NPM

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) => { ... });

Readme

Keywords

none

Package Sidebar

Install

npm i hypixel

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

47.1 kB

Total Files

7

Last publish

Collaborators

  • cdepanda