supercell-api is a promise based api wrapper for all supercell games.
$ npm install supercell-api
- Changed every non-required parameters to options.
Example
.searchClan(name, (limit), (minMembers), (maxMembers), (minScore), (locationId)).searchClan(name, {
limit: '',
// maxMembers: '',
// maxMembers: '',
// minScore: '',
// locationId: ''
})- Fixed spelling in example (
spercelltosupercell)
const supercell = require('supercell-api');
const api = new supercell.BrawlStars('brawl stars api key here');
api.getPlayer('#XXXXXXXX').then(data => console.log(data));Example output model
{
"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"
}| Parameters | Options | Description | |
|---|---|---|---|
.getPlayer() |
playerTag | Get information about a single player by player tag. | |
.getBattleLog() |
playerTag | Get list of recent battle results for a player. | |
.getClub() |
clubTag | Get information about a single clan by club tag. | |
.getClubMemberList() |
clubTag, {options} | llimit | List club members. |
.getEventList() |
Get event rotation for ongoing events. | ||
.getBrawler() |
brawlerId | Get information about a brawler. | |
.getBrawlerList() |
{options} | limit | Get list of available brawlers. |
.getPlayerRankingList() |
countryCode, {options} | limit | Get player rankings for a country or global rankings. |
.getClubRankingList() |
countryCode, {options} | limit | Get club rankings for a country or global rankings. |
.getBrawlerRankingList() |
countryCode, brawlerId, {options} | limit | Get brawler rankings for a country or global rankings. |
.getPowerPlaySeasonRankingList() |
countryCode, {options} | limit | Get power play rankings for a country or global rankings. |
const supercell = require('supercell-api');
const api = new supercell.ClashRoyale('clash royale api key here');
api.getPlayer('#XXXXXXXX').then(data => console.log(data));Example output model
{
"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
}| Parameters | Options | Description | |
|---|---|---|---|
.getPlayer() |
playerTag | Get information about a single player by player tag. | |
.getUpcomingChestList() |
playerTag | Get list of reward chests that the player will receive next in the game. | |
.getBattleLog() |
playerTag | Get list of recent battle results for a player. | |
.getCardList() |
{options} | limit | Get list of available cards. |
.searchClan() |
name, {options} | limit, minMembers, maxMembers, minScore, locationId | Search all clans by name and/or filtering the results using various criteria. |
.getClan() |
clanTag | Get information about a single clan by clan tag. | |
.getClanMemberList() |
clanTag, {options} | limit | List clan members. |
.getCurrentRiverRace() |
clanTag | Retrieve information about clan's current river race. | |
.getRiverRaceLog() |
clanTag | Retrieve clan's river race log. | |
.searchTournament() |
name, {options} | limit | Search all tournaments by name. |
.getTournament() |
tournamentTag | Get information about a single tournament by a tournament tag. | |
.getGlobalTournammentList() |
Get list of global tournaments. | ||
.getLocationList() |
{options} | limit | List locations. |
.getLocation() |
locationId | Get information about specific location. | |
.getLocationClanRankingList() |
locationId, {options} | limit | Get clan rankings for a specific location. |
.getLocationPlayerRankingList() |
locationId, {options} | limit | Get player rankings for a specific location. |
.getLocationClanWarRankingList() |
locationId, {options} | limit | Get clan war rankings for a specific location. |
.getGlobalSeasonList() |
Lists top player league seasons. | ||
.getGlobalSeason() |
seasonId | Get top player league season. | |
.getGlobalSeasonPlayerRanking() |
seasonId, {options} | limit | Get top player rankings for a season. |
.getGlobalTournamentRanking() |
tournamentTag, {options} | limit | Get global tournament rankings. |
const supercell = require('supercell-api');
const api = new supercell.ClashOfClans('clash of clans api key here');
api.getPlayer('#XXXXXXXX').then(data => console.log(data));Example output model
{
"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
}| Parameters | Options | Description | |
|---|---|---|---|
.getPlayer() |
playerTag | Get information about a single player by player tag. | |
.searchClan() |
name, {options} | limit, minMembers, maxMembers, minClanPoints, warFrequency, locationId, labelIds | Search all clans by name and/or filtering the results using various criteria. |
.getClan() |
clanTag | Get information about a single clan by clan tag. | |
.getClanMemberList() |
clanTag, {options} | limit | List clan members. |
.getCurrentClanWar() |
clanTag | Retrieve information about clan's current clan war. | |
.getClanWarLog() |
clanTag, {options} | limit | Retrieve clan's clan war log. |
.getClanWar() |
warTag | Retrieve information about individual clan war league war. | |
.getCurrentClanWarGroup() |
clanTag | Retrieve information about clan's current clan war league group. | |
.getLeagueList() |
{options} | limit | List leagues. |
.getLeague() |
leagueId | Get league information. | |
.getLeagueSeasonList() |
leagueId, {options} | limit | Get league seasons. |
.getLeagueSeason() |
leagueId, seasonId, {options} | limit | Get league season rankings. |
.getWarLeagueList() |
{options} | limit | List war leagues. |
.getWarLeague() |
leagueId | Get war league information. | |
.getLocationList() |
{options} | limit | List locations. |
.getLocation() |
locationId | Get information about specific location. | |
.getLocationClanRankingList() |
locationId, {options} | limit | Get clan rankings for a specific location. |
.getLocationPlayerRankingList() |
locationId, {options} | limit | Get player rankings for a specific location. |
.getLocationClanVersusRankingList() |
locationId, {options} | limit | Get clan versus rankings for a specific location. |
.getLocationPlayerVersusRankingList() |
locationId, {options} | limit | Get player versus rankings for a specific location. |
.getGoldPass() |
Get information about the current gold pass season. | ||
.getPlayerLabelList() |
{options} | limit | List player labels. |
.getClanLabelList() |
{options} | limit | List clan labels. |