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-api-nodejs

v0.1.5

Published

Easy-to-use Hypixel Wrapper for your project!

Downloads

18

Readme

Hypixel JavaScript API

An easy-to-use Hypixel API Wrapper for Node.js. Coded with ❤ by MineBlock64 ! Version: 0.1.5

Installation

npm i hypixel-api-nodejs

Usage

To use the commands, you need an API key that can be gathered by running /api new on the Hypixel server. The value returned by the function is a JavaScript Object already parsed that can be immediatly used.

Format

Every functions have this format:

hypixel.getPlayerByName(key, ign).then(datas => {
    console.log(datas);
}).catch(err => {
    console.log("ERROR: " + err);
});

Functions

Get player informations from the In-Game Name:

hypixel.getPlayerByName(key, ign);

Get player informations from the UUID:

hypixel.getPlayerByUuid(key, uuid);

Get guild informations from its name:

hypixel.getGuildByName(key, name);

Get guild informations from its ID:

hypixel.getGuildById(key, id);

Get guild informations from a members' UUID:

hypixel.getGuildByPlayer(key, uuid);

Get player's friends from its UUID:

hypixel.getFriendsByUuid(key, uuid);

Get informations about your own API key:

hypixel.getKeyInformations(key);

Get leaderboards of every mini-games:

hypixel.getLeaderboards(key);

Get informations about every boosters currently active on the network:

hypixel.getBoosters(key);

Get session informations from player's UUID: (ATTENTION: The endpoint of this is going to be deprecated as said on the Hypixel API GitHub!)

hypixel.getSession(key, uuid);

Get Watchdog informations:

hypixel.getWatchdogInformations(key, uuid);

Examples

const hypixel = require("hypixel-api-nodejs");
var key = '';   //Your own api key

hypixel.getPlayerByName(key, 'MineBlock64').then(player => {    //Retrieve JavaScript Object from request
	var lastlogin = player.player.lastLogin;   //Get player's last connection on the server
	var date = new Date(lastlogin);   //Milliseconds to date
	console.log(date.toString());
});
const hypixel = require("hypixel-api-nodejs");
var key = '';   //Your own api key
var days = 0;

hypixel.getGuildByName(key, 'The+Moon').then(guild => {   //Spaces must be set as "+" or "%2B" depending on your encoding
	var exp = guild.guild.members[0].expHistory;   //Get selected members' experience of this week

	for(i = 0; i < exp.length; i++) {
		console.log("Experience " + days + " ago:  " + exp[i]);
		days++;
	}
});
const hypixel = require("hypixel-api-nodejs");
var key = '';   //Your own api key

hypixel.getPlayerByUuid(key, 'da8ac1c348c04dd695df800c29fbddc3').then(player => {   //Retrieve JavaScript Object from request
	var mm = player.player.stats.MurderMystery;   //Get player's Murder Mystery Statistics

	console.log(mm.wins);   //Total Murder Mystery wins
	console.log(mm.deaths_mountain_MURDER_CLASSIC);   //Total deaths amount on the Moutain map in the Classic mode
	console.log(mm.quickest_murderer_win_time_seconds_transport);   //Return the quickest time as murderer on the Transport map in seconds
	console.log(mm.packages);   //Return an array of every items/favorite maps this player has
	console.log(mm.wasSpecialRoleLastGame);   //Return a boolean; true if the player has got a special role (Murderer/Detective) the current or last game played; false if the player was Innocent
	console.log(mm.suicides);   //Total suicides in the game
});
const hypixel = require("hypixel-api-nodejs");
var key = '';   //Your own api key

hypixel.getKeyInformations(key).then(mykey => {   //Retrieve JavaScript Object from request
	console.log(mykey.record.totalQueries);   //Display the total amount of time your key has been used to make a request
});
const hypixel = require("hypixel-api-nodejs");
var key = '';   //Your own api key
var position = 1;

hypixel.getLeaderboards(key).then(leaderboards => {   //Retrieve JavaScript Object from request
	var mmlb = leaderboards.leaderboards.MURDER_MYSTERY[0].leaders;   //Fetching top 15 overall leaders of Murder Mystery

	for(i = 0; i < mmlb.length; i++) {
		hypixel.getPlayerByUuid(key, mmbl[i]).then(player => {   //Request player's datas from the UUID
			var ign = player.player.displayName;   //Getting In-Game Name value
			console.log(position + ". " + ign);
			position++;
		});
	}
});

/* Console:
1. BadRoller
2. Gigizu_
3. Li1Sur
4. ViolentCookiez
5. if7ueh7
6. TragicallyTrue
7. Waiting4Hytale
8. iTPcencioh
9. Freakilicious
10. JKRN
11. Nqdine
12. xmasPanPan4044
13. TheFirstOracle
14. MineBlock64
15. YeoWun            */