brawlhalla.js

Brawlhalla API Tool

Usage no npm install needed!

<script type="module">
  import brawlhallaJs from 'https://cdn.skypack.dev/brawlhalla.js';
</script>

README

Brawlhalla API Tool

Node.JS wrapper for the Brawlhalla API

Installation

Install via npm:

$ npm install --save brawlhalla.js

Import the module into your script:

const bh_api = require('brawlhalla.js');

Connect to the api with your personnal key:

bh_api.login('API KEY');

Methods

.getPlayerStats(playerID) Uses One Brawlhalla API Call

bh_api.getPlayerStats(playerID).then(player => {

}).catch(function(error){

});

.getPlayerRank(playerID) Uses One Brawlhalla API Call

bh_api.getPlayerRank(playerID).then(player => {

}).catch(function(error){

});

.getClanStats(clanID) Uses One Brawlhalla API Call

bh_api.getClanStats(clanID).then(clan => {

}).catch(function(error){

});

.getRankings(options) Uses One Brawlhalla API Call

bh_api.getRankings(options).then(rankings => {

}).catch(function(error){

});

Option object and properties are all optional. By default:

options = {
    bracket: '1v1', // '1v1' or '2v2'
    region: 'all', // 'all', 'us-e', 'us-w', 'eu', 'brz', 'aus', 'sea'
    page: 1,
    name: ''
}