supercell-api
v1.1.2
Published
A promise based api wrapper for supercell games.
Downloads
10
Maintainers
Readme
supercell-api documentation
supercell-api is a promise based api wrapper for all supercell games.
Install
$ npm install supercell-api
Changelog
- Changed every non-required parameters to options.
Old search method
.searchClan(name, (limit), (minMembers), (maxMembers), (minScore), (locationId))
New search method
.searchClan(name, {
limit: '',
// maxMembers: '',
// maxMembers: '',
// minScore: '',
// locationId: ''
})
- Fixed spelling in example (
spercell
tosupercell
)
Brawl Stars API
Example
const supercell = require('supercell-api');
const api = new supercell.BrawlStars('brawl stars api key here');
api.getPlayer('#XXXXXXXX').then(data => console.log(data));
{
"club": {
"tag": "string",
"name": "string"
},
"isQualifiedFromChampionshipChallenge": true,
"3vs3Victories": 0,
"icon": {
"id": 0
},
"tag": "string",
"name": "string",
"trophies": 0,
"expLevel": 0,
"expPoints": 0,
"highestTrophies": 0,
"powerPlayPoints": 0,
"highestPowerPlayPoints": 0,
"soloVictories": 0,
"duoVictories": 0,
"bestRoboRumbleTime": 0,
"bestTimeAsBigBrawler": 0,
"brawlers": [
{
"gadgets": [
{
"name": {},
"id": 0
}
],
"starPowers": [
{
"name": {},
"id": 0
}
],
"id": 0,
"rank": 0,
"trophies": 0,
"highestTrophies": 0,
"power": 0,
"name": {}
}
],
"nameColor": "string"
}
Clash Royale API
Example
const supercell = require('supercell-api');
const api = new supercell.ClashRoyale('clash royale api key here');
api.getPlayer('#XXXXXXXX').then(data => console.log(data));
{
"clan": {
"badgeId": 0,
"tag": "string",
"name": "string",
"badgeUrls": {}
},
"arena": {
"name": {},
"id": 0,
"iconUrls": {}
},
"role": "string",
"wins": 0,
"losses": 0,
"totalDonations": 0,
"leagueStatistics": {
"bestSeason": {
"trophies": 0,
"rank": 0,
"bestTrophies": 0,
"id": "string"
},
"currentSeason": {
"trophies": 0,
"rank": 0,
"bestTrophies": 0,
"id": "string"
},
"previousSeason": {
"trophies": 0,
"rank": 0,
"bestTrophies": 0,
"id": "string"
}
},
"cards": [
{
"id": 0,
"count": 0,
"level": 0,
"starLevel": 0,
"name": {},
"maxLevel": 0,
"iconUrls": {}
}
],
"currentFavouriteCard": {
"iconUrls": {},
"name": {},
"id": 0,
"maxLevel": 0
},
"badges": [
{
"maxLevel": 0,
"progress": 0,
"target": 0,
"level": 0,
"name": "string"
}
],
"tag": "string",
"name": "string",
"expLevel": 0,
"trophies": 0,
"bestTrophies": 0,
"donations": 0,
"donationsReceived": 0,
"achievements": [
{
"stars": 0,
"value": 0,
"name": {},
"target": 0,
"info": {},
"completionInfo": {}
}
],
"battleCount": 0,
"threeCrownWins": 0,
"challengeCardsWon": 0,
"challengeMaxWins": 0,
"tournamentCardsWon": 0,
"tournamentBattleCount": 0,
"currentDeck": [
{
"id": 0,
"count": 0,
"level": 0,
"starLevel": 0,
"name": {},
"maxLevel": 0,
"iconUrls": {}
}
],
"warDayWins": 0,
"clanCardsCollected": 0,
"starPoints": 0
}
Clash of Clans API
Example
const supercell = require('supercell-api');
const api = new supercell.ClashOfClans('clash of clans api key here');
api.getPlayer('#XXXXXXXX').then(data => console.log(data));
{
"league": {
"name": {},
"id": 0,
"iconUrls": {}
},
"clan": {
"tag": "string",
"clanLevel": 0,
"name": "string",
"badgeUrls": {}
},
"role": "string",
"attackWins": 0,
"defenseWins": 0,
"townHallLevel": 0,
"townHallWeaponLevel": 0,
"versusBattleWins": 0,
"legendStatistics": {
"bestVersusSeason": {
"trophies": 0,
"id": "string",
"rank": 0
},
"legendTrophies": 0,
"currentSeason": {
"trophies": 0,
"id": "string",
"rank": 0
},
"bestSeason": {
"trophies": 0,
"id": "string",
"rank": 0
},
"previousSeason": {
"trophies": 0,
"id": "string",
"rank": 0
},
"previousVersusSeason": {
"trophies": 0,
"id": "string",
"rank": 0
}
},
"troops": [
{
"level": 0,
"name": {},
"maxLevel": 0,
"village": "string",
"superTroopIsActive": true
}
],
"heroes": [
{
"level": 0,
"name": {},
"maxLevel": 0,
"village": "string",
"superTroopIsActive": true
}
],
"spells": [
{
"level": 0,
"name": {},
"maxLevel": 0,
"village": "string",
"superTroopIsActive": true
}
],
"labels": [
{
"name": {},
"id": 0,
"iconUrls": {}
}
],
"tag": "string",
"name": "string",
"expLevel": 0,
"trophies": 0,
"bestTrophies": 0,
"donations": 0,
"donationsReceived": 0,
"builderHallLevel": 0,
"versusTrophies": 0,
"bestVersusTrophies": 0,
"warStars": 0,
"achievements": [
{
"stars": 0,
"value": 0,
"name": {},
"target": 0,
"info": {},
"completionInfo": {},
"village": "string"
}
],
"versusBattleWinCount": 0
}