Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
battlenet-api
Advanced tools
A Node JS wrapper for the Battle.net API
Add battlenet-api
to your application's package.json
file and run:
npm install
Alternatively:
npm install battlenet-api --save
Simply require()
the Battle.net API within your application:
var bnet = require('battlenet-api');
And then access the API methods to request data:
bnet.wow.character.profile(obj, callback);
Each API method receives a parameters object for the request, and a callback function to execute once the request has completed. The available request parameters are explained for each method below.
callback
takes three arguments: error
, response
, and body
.
The World of Warcraft API methods are available through the wow
object of the Battle.net API.
var wow = bnet.wow;
Each API method will take region
as one of its parameters. The possible values are us
, eu
, kr
, tw
.
Parameters
region
the region of the achievment.
id
the unique achievement ID.
Usage
bnet.wow.achievement({region: 'us', id: 2144}, function(err, resp, body) {
console.log(body);
});
All character requests require the following parameters:
region
the region of the character.
realm
the slugified realm of the character.
name
the name of the character.
Returns basic profile data about the character.
Usage
bnet.wow.character.profile({region: 'us', realm: 'proudmoore', name: 'charni'}, function(err, resp, body) {
console.log(body);
});
Returns the achievement data of the character.
Usage
bnet.wow.character.achievements({region: 'us', realm: 'proudmoore', name: 'charni'}, function(err, resp, body) {
console.log(body);
});
Returns the appearance data of the character.
Usage
bnet.wow.character.appearance({region: 'us', realm: 'proudmoore', name: 'charni'}, function(err, resp, body) {
console.log(body);
});
Returns the guild data of the character.
Usage
bnet.wow.character.guild({region: 'us', realm: 'proudmoore', name: 'charni'}, function(err, resp, body) {
console.log(body);
});
Returns the hunter pet data of the character (where applicable).
Usage
bnet.wow.character.hunterPets({region: 'us', realm: 'proudmoore', name: 'charni'}, function(err, resp, body) {
console.log(body);
});
Returns the item data of the character.
Usage
bnet.wow.character.items({region: 'us', realm: 'proudmoore', name: 'charni'}, function(err, resp, body) {
console.log(body);
});
Returns the mount data of the character.
Usage
bnet.wow.character.mounts({region: 'us', realm: 'proudmoore', name: 'charni'}, function(err, resp, body) {
console.log(body);
});
Returns the pet data of the character.
Usage
bnet.wow.character.pets({region: 'us', realm: 'proudmoore', name: 'charni'}, function(err, resp, body) {
console.log(body);
});
Returns the pet slots data of the character.
Usage
bnet.wow.character.petSlots({region: 'us', realm: 'proudmoore', name: 'charni'}, function(err, resp, body) {
console.log(body);
});
Returns the progression data of the character.
Usage
bnet.wow.character.progression({region: 'us', realm: 'proudmoore', name: 'charni'}, function(err, resp, body) {
console.log(body);
});
Returns the PVP data of the character.
Usage
bnet.wow.character.pvp({region: 'us', realm: 'proudmoore', name: 'charni'}, function(err, resp, body) {
console.log(body);
});
Returns the quest data of the character.
Usage
bnet.wow.character.quests({region: 'us', realm: 'proudmoore', name: 'charni'}, function(err, resp, body) {
console.log(body);
});
Returns the reputation data of the character.
Usage
bnet.wow.character.reputation({region: 'us', realm: 'proudmoore', name: 'charni'}, function(err, resp, body) {
console.log(body);
});
Returns the statistics data of the character.
Usage
bnet.wow.character.stats({region: 'us', realm: 'proudmoore', name: 'charni'}, function(err, resp, body) {
console.log(body);
});
Returns the talent data of the character.
Usage
bnet.wow.character.talents({region: 'us', realm: 'proudmoore', name: 'charni'}, function(err, resp, body) {
console.log(body);
});
Returns the title data of the character.
Usage
bnet.wow.character.titles({region: 'us', realm: 'proudmoore', name: 'charni'}, function(err, resp, body) {
console.log(body);
});
Returns an audit of the character's equipment.
Usage
bnet.wow.character.audit({region: 'us', realm: 'proudmoore', name: 'charni'}, function(err, resp, body) {
console.log(body);
});
Returns the specified character fields aggregated in a single request.
Parameters
fields
an array of one or more character fields.
Usage
bnet.wow.character.aggregate({region: 'us', realm: 'proudmoore', name: 'charni', fields: ['pets', 'petSlots']}, function(err, resp, body) {
console.log(body);
});
FAQs
A Node.JS library for the Battle.net Community Platform API
The npm package battlenet-api receives a total of 54 weekly downloads. As such, battlenet-api popularity was classified as not popular.
We found that battlenet-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.