/supercell-apis

A powerful javascript library for interacting with Clash Of Clans, Clash Royale, Brawl Stars api's.

Primary LanguageJavaScriptMIT LicenseMIT

Project logo

supercell-apis

Status License


A powerful javascript library for interacting with Clash Of Clans, Clash Royale, Brawl Stars api's.

Installation

You can install supercell-apis using npm:

npm install supercell-apis

Example: Configuration

const { Token, ClashOfClans, ClashRoyale, BrawlStars } = require('supercell-apis');

(async () => {

    // First argument: clashofclans / clashroyale / brawlstars
    // Second argument: Email
    // Third argument: Password
    // Optional, name and limit
    const token = await new Token('clashofclans', '<email>', '<password>', { name: '<token-name>', limit: '<token-limit>' }).init();
    console.log(token);

    // Clash Of Clans
    const Coc = new ClashOfClans('<token>', { cache: 120 }); // Optional Cache
    const coc_data = await Coc.locations(); 
    console.log(coc_data);

    // Clash Royale
    const Cr = new ClashRoyale('<token>', { cache: 120 }); // Optional Cache
    const cr_data = await Cr.locations();
    console.log(cr_data);

    // Brawl Stars
    const Bs = new BrawlStars('<token>', { cache: 120 }); // Optional Cache
    const bs_data = await Bs.brawlers();
    console.log(bs_data);
})();

List of Apis

'Clash Of Clans'

Note: <> : required and {} : optional (not always)

.clans({ name: '<required>', warFrequency: '', locationId: '', minMembers: '', maxMembers: '', minClanPoints: '', minClanLevel: '', limit: '', after: '', before: '', labelIds: '' })

.clan('<tag>')

.members('<tag>')

.war('<tag>')

.warLog('<tag>', { limit: '', after: '', before: '' })

.cwlRounds('<tag>') 

.cwl('<tag>') 

.player('<tag>')

.playerVerify('<tag>', '<apiToken>')

.clanLabels({ limit: '', after: '', before: '' }) 

.playerLabels({ limit: '', after: '', before: '' })

.locations('<locationId>', { limit: '', after: '', before: '' })

.clansRank('<locationId>', { limit: '', after: '', before: '' }) 

.playersRank('<locationId>', { limit: '', after: '', before: '' })

.clansVersusRank('<locationId>', { limit: '', after: '', before: '' }) 

.playersVersusRank('<locationId>', { limit: '', after: '', before: '' })

.leagues('<leagueId>', { limit: '', after: '', before: '' })

.warLeagues('<leagueId>', { limit: '', after: '', before: '' })

.leaguesSeason('<leagueId>', '<seasonId>',  { limit: '', after: '', before: '' }) 

'Clash Royale'

Note: <> : required and {} : optional (not always)

.riverRaceLog('<tag>', { limit: '', after: '', before: '' })

.war('<tag>')

.clan('<tag>')

.warLog('<tag>', { limit: '', after: '', before: '' }) 

.members('<tag>', { limit: '', after: '', before: '' })

.clans({ name: '<required>', locationId: '', minMembers: '', maxMembers: '', minScore: '', limit: '', after: '', before: '', labelIds: '' }) 

.currentRiverRace('<tag>')

.player('<tag>') 

.playerBattleLog('<tag>') 

.playersUpcomingChests('<tag>')

.cards({ limit: '', after: '', before: '' }) 

.tournaments({ name: '', limit: '', after: '', before: '' })

.tournamentsById('<tournamentId>') 

.locations('<locationId>', { limit: '', after: '', before: '' })

.clansRank('<locationId>', { limit: '', after: '', before: '' }) 

.playersRank('<locationId>', { limit: '', after: '', before: '' }) 

.clanWarsRank('<locationId>', { limit: '', after: '', before: '' }) 

.globalTournamentRank('<tournamentId>', { limit: '', after: '', before: '' })

.globalTournament()

'Brawl Stars'

Note: <> : required and {} : optional (not always)

.player('<tag>')

.playerBattleLog('<tag>') 

.club('<tag>')

.members('<tag>') 

.brawlers({ name: '', limit: '', after: '', before: '' })

.brawlersById('<tournamentId>')

.clubsRank('<countryCode>', { limit: '', after: '', before: '' }) 

.playersRank('<countryCode>', { limit: '', after: '', before: '' })

.powerplay('<countryCode>', '<seasonId>', { limit: '', after: '', before: '' }) 

.brawlersRank('<countryCode>', '<brawlersId>',  { limit: '', after: '', before: '' })