A JavaScript wrapper for the official Wynncraft API, if you wish you may contribute to the wrapper. This wrapper is a modification of https://github.com/FraWolf/wynncraft.js, all rights of the fetchPlayer and fetchItem goes to the author of wynncraft.js.
This wrapper is really outdated and is not in use anymore, if you want to contribute to it upgrading it. Feel free to do so.
You only have a limited amount of API Calls per a certain period of time, this can differ per API endpoint. Please read more on the official documentation of the API. https://docs.wynncraft.com/
To get the latest version of WynnJS please use the following command in a command prompt.
npm i --save @devchromium/wynnjs@latest
const wynnJS = require("@devchromium/wynnjs");
const wynn = new WynnJS();
This will return the item object from the item name you input.
let item = // code to get itemname
wynn.fetchItem(item)
.then(res => {
// Code to display result
})
.catch(err => {
console.log(err);
});
This will return the guild object from the guild name you input (This does not work with guild prefixes).
let guild = // code to get guild
wynn.fetchGuild(guild)
.then(res => {
// Code to display result
})
.catch(err => {
console.log(err);
});
This will return all servers on the network.
wynn.fetchServers()
.then(res => {
// Code to display result
})
.catch(err => {
console.log(err);
});
This will return all the territories.
wynn.fetchTerritories()
.then(res => {
// Code to display result
})
.catch(err => {
console.log(err);
});
This will return the top 100 guilds.
Definiton of timeframe
: this can be alltime
wynn.fetchGuildLeaderboard(timeframe)
.then(res => {
// Code to display result
})
.catch(err => {
console.log(err);
});
This will return the top 100 guilds.
Definiton of timeframe
: this can be alltime
wynn.fetchPlayerLeaderboard(timeframe)
.then(res => {
// Code to display result
})
.catch(err => {
console.log(err);
});
This will return the top 100 guilds.
Definiton of timeframe
: this can be alltime
wynn.fetchPvPLeaderboard(timeframe)
.then(res => {
// Code to display result
})
.catch(err => {
console.log(err);
});
This will return a list of guild and player names which contain the search query, this is case-insensitive.
wynn.search(name)
.then(res => {
// Code to display result
})
.catch(err => {
console.log(err);
});
This will return the player object from the username you input.
let username = // code to get username
wynn.fetchPlayer(username)
.then(res => {
// Code to display result
})
.catch(err => {
console.log(err);
});
This will return the ingredient object from the ingredient name you input.
let ingredient = // code to get ingredient
wynn.fetchIngredient(ingredient)
.then(res => {
// Code to display result
})
.catch(err => {
console.log(err);
});