npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hypixel-javascript

v1.0.6

Published

A good Hypixel API wrapper with many different features.

Downloads

3

Readme

hypixel-javascript

About:

hypixel-javascript is a new and powerful Hypixel Node.js module to interact with Hypixel.

  • 100% coverage of the Hypixel API.
  • Adapt inputs and methods and converts whenever possible.
  • Helpful addons that reduce your workload.
  • Ultra lightweight using minimal dependencies.

Support & Bug Reporting:

hypixel-javascript is a new module created by CactiveNetwork, you can get support on your code, report any issues and more by joining the discord at discord.gg/NeqVuSy.

Installation & Usage:

In your project run npm install hypixel-javascript.

Next enter the following in your main file (index.js by default).

const Hypixel = require('hypixel-javascript');
const client = new Hypixel.Client("YOUR_API_KEY");

You need a Hypixel API key in order to use this library, join mc.hypixel.net and run /api new to get one.

Example Usage:

const Hypixel = require('hypixel-javascript');
const client = new Hypixel.Client("YOUR_API_KEY"); // API Key

client.getPlayer('caykie') // Get player automatically
    .then(console.log);

// or you can do;

(async () => {
    const data = await client.getPlayer('caykie');
    console.log(data.player);
})();

Queries:

General:

Fetch Player Data:

For this method, you can specify a username or UUID as the username will automatically convert to UUID, however being slightly slower. Different methods could be chosen, due to a change by Hypixel they have substantially limited the previous way of getting data through username directly.

// Slightly slower
client.getPlayer('caykie')
    .then(console.log);

// Fastest way
client.getPlayer('eea2d4fd-a8b8-413b-9439-f06faaf7e109')
    .then(console.log);

Legacy Player Data:

This is strongly not recommended as you will most likely need to cache data if you are fetching based on the username of the player. We strongly recommend using the data fetch above.

client.legacyGetPlayer('caykie')
    .then(console.log);

client.legacyGetPlayer('eea2d4fd-a8b8-413b-9439-f06faaf7e109', 'uuid')
    .then(console.log);

Fetch Player Friends:

This method technically only supports UUIDs, and we do recommend using them. You can still supply a player username, however it will take slightly longer to fetch data from the Mojang API.

// Better to use
client.getFriends('eea2d4fd-a8b8-413b-9439-f06faaf7e109')
    .then(console.log);

// Slightly slower
client.getFriends("caykie")
    .then(console.log);

Fetch Player Recent Games:

The player that you are requesting to get must have their recent games settings in the /settings menu on Hypixel enabled, otherwise you will not be able to see their recent games.

Again you can specify a username if you want, however we strongly recommend using a UUID if you can as it reduces wait time from additional requests.

// Better to use
client.getRecentGames('eea2d4fd-a8b8-413b-9439-f06faaf7e109')
    .then(console.log);

// Slightly slower
client.getRecentGames('caykie')
    .then(console.log);

Fetch Player Status:

If the player specified is online and they have the setting to show player status enabled in /settings on Hypixel, this information will show, it is on by default for all players except for staff.

Again you can specify a username if you want, however we strongly recommend using a UUID if you can as it reduces wait time from additional requests.

// Better to use
client.getStatus('eea2d4fd-a8b8-413b-9439-f06faaf7e109')
    .then(console.log);

// Slightly slower
client.getStatus('caykie')
    .then(console.log);

Fetch Guild:

You MUST provide a method on the Guild, depending on if you do it by the ID, Guild Member or Name.

client.getGuild("CactiveNetwork", "name")
    .then(console.log);

Fetch SkyBlock Profile:

For this, you must specify a profile ID or player UUID to get multiple.

If you enter a username, it will still convert but slightly slower than normal.

client.getSkyBlockProfile("eea2d4fd-a8b8-413b-9439-f06faaf7e109", "uuid")
    .then(console.log);

Fetch SkyBlock Auctions on Player:

Specify a Player, Profile or UUID then provide a method of 'uuid', 'player', or 'profile'.

You can provide a username, as said before it is slightly slower than normal.

client.getSkyBlockAuctions("eea2d4fd-a8b8-413b-9439-f06faaf7e109", "uuid")
    .then(console.log);

Get Active SkyBlock Auctions:

Optionally specify a page, defaulting to 0 and see the active SkyBlock auctions.

client.getActiveSkyBlockAuctions(0)
    .then(console.log);

Resources:

Get Player Count:

You can get the Player Count of all of Hypixel or just certain gamemodes.

client.getPlayerCounts
    .then(console.log);

Get Leaderboards:

Get all of the different gamemode leaderboards.

client.getLeaderboards
    .then(console.log);

Get Punishment Statistics:

Get total and recent punishment statistics by staff & watchdog.

client.getPunishmentStatistics
    .then(console.log);

Get Active Network Boosters:

Get the currently active network boosters that apply to all players.

client.getActiveBoosters
    .then(console.log);

Get List of Achievements:

Get a list of all the achievements and related information.

client.resourceAchievements
    .then(console.log);

Get List of Challenges:

Get a list of all the challenges and related information.

client.resourceChallenges
    .then(console.log);

Get List of Quests:

Get a list of all the quests and related information.

client.resourceQuests
    .then(console.log);

Get List of Guild Achievements:

Get a list of all the guild achievements and related information.

client.resourceGuildAchievements
    .then(console.log);

Get List of Guild Permissions:

Get a list of all the guild permissions and related information.

client.resourceGuildPermissions
    .then(console.log);

Get List of SkyBlock Collections:

Get a list of all the SkyBlock collections and related information.

client.resourceSkyBlockCollections
    .then(console.log);

Get List of SkyBlock Skills:

Get a list of all the SkyBlock skills and related information.

client.resourceSkyBlockSkills
    .then(console.log);

Get SkyBlock News:

Get a list of the SkyBlock news pages on the forums for game updates and bug fixes.

client.getSkyBlockNews
    .then(console.log);

Get Ended SkyBlock Auctions:

Get a list of the ended SkyBlock auctions on the Hypixel Network.

client.getEndedSkyBlockAuctions
    .then(console.log);

Get SkyBlock Bazaar:

Get SkyBlock Bazaar information.

client.getSkyBlockBazaar
    .then(console.log);

Additional Resources:

Convert Username or UUID to either:

Sends a request to Mojang to get the Username and or UUID.

const log = console.log;

log(Hypixel.convertUser("eea2d4fd-a8b8-413b-9439-f06faaf7e109")); // caykie

// If you want to force something to be a UUID or Username do;

log(Hypixel.convertUser("eea2d4fd-a8b8-413b-9439-f06faaf7e109", "uuid")); // eea2d4fd-a8b8-413b-9439-f06faaf7e109

Added Dashes to UUID:

Does not send any requests and instantly adds dashes to a UUID if not done already.

const log = console.log;

log(Hypixel.fixUUID("eea2d4fda8b8413b9439f06faaf7e109")); // eea2d4fd-a8b8-413b-9439-f06faaf7e109

Get Method of Converting to Name or UUID:

This will respond with either uuid or name.

const log = console.log;

log(Hypixel.getMethod("eea2d4fda8b8413b9439f06faaf7e109")); // uuid
log(Hypixel.getMethod("eea2d4fd-a8b8-413b-9439-f06faaf7e109")); // uuid
log(Hypixel.getMethod("caykie")); // name