Giter Site home page Giter Site logo

clashpi's Introduction

Description

This package contains a simple, asynchronous, free, dependency-free node.js library for using the Clash Royale API.

Installation

  • Install node.js using from here.
  • Install clashpi with npm install clashpi
  • You will need a Clash Royale API key to use this library. To obtain a key, create an account here or if you already have one log in here. Afterwards click on My Account from where you can access your API keys. Copy the entire key.

Usage

Example:

First import the library and create a Client object.

const { Client } = require('clashpi');
const client = new Client(APIKEY);

Then call functions on the Client object.

client.getPlayer('#JGJYQ2P2V')
    .then(player => client
        .getUpcomingChests(player).then(console.log));

// OR

client.getUpcomingChests('#JGJYQ2P2V')
    .then(console.log);

client.getPlayerRanks('2023-03')
    .then(console.log);

Documentation

  • getCards(rarity = [Rarity.COMMON, Rarity.RARE, Rarity.EPIC, Rarity.LEGENDARY, Rarity.CHAMPION], name = [])

Get a list of all cards in the game, or filter by rarity or name

  • getChallenges()

Get a list of all challenges

  • getPlayer(tag)

Get all information about a specific player

  • getUpcomingChests(tag, index = undefined)

Get all (or a specific) upcoming chests of a specific player

  • getBattleLog(tag)

Get the battle log of a specific player

  • getLocations(limit = undefined)

Get a list of all locations in the game

  • getClan(tag)

Get all information about a specific clan

  • getClanRanks(locationId, clanWars = false, limit = undefined)

Get a ranking of all clans in a certain location, either by clan ranking or by clan-war ranking

  • getPlayerRanks(seasonId, pathOfLegends = false, limit = undefined)

Get ranking of all players that played in a specific season, either by trophies or by path of legend rank

  • getTournaments(name, limit = undefined)

Get a list of all tournaments containing a specific name

  • getTournament(tag)

Get all information of about a specific tournament

  • getGlobalTournament()

Get a list of all global tournaments

clashpi's People

Contributors

maloefuds avatar leonie217 avatar davidmodzz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.