Skip to content

simon-schlueter/hypixel-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.getPlayerByUsername(username, (err, player) => { ... });

About

This is a Node.js client library for the public Hypixel API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •