npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

supercell-apis

v1.0.7

Published

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

Downloads

7

Readme

Status License


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: '' })