A wrapper for the Clash Royale API.
This package is not affiliated with Supercell or RoyaleAPI.
To use Clash Royale API for NPM, you need to get an API token from the Clash Royale Developer Portal.
You can also use another API provider like RoyaleAPI.
First, install the package using NPM or your favorite package manager:
npm install royale-api
Usage example:
const RoyaleAPI = require("royale-api");
const cr = new RoyaleAPI("token");
cr.getPlayer("#AAAAAAAA").then((player) => {
console.log(player);
});
There is one method for each endpoint of the Clash Royale API (see documentation):
getClanWarLog(clanTag: string, options?: object): Promise<object>
getClans(options?: object): Promise<object>
getClanRiverRaceLog(clanTag: string, options?: object): Promise<object>
getClanCurrentWar(clanTag: string): Promise<object>
getClan(clanTag: string): Promise<object>
getClanMembers(clanTag: string, options?: object): Promise<object>
getClanCurrentRiverRace(clanTag: string): Promise<object>
getPlayer(playerTag: string): Promise<object>
getPlayerUpcomingChests(playerTag: string): Promise<object>
getPlayerBattleLog(playerTag: string): Promise<object>
getCards(options?: object): Promise<object>
getTournaments(options?: object): Promise<object>
getTournament(tournamentTag: string): Promise<object>
getLocationClanRankings(locationId: number, options?: object): Promise<object>
getLocationPlayerRankings(locationId: number, options?: object): Promise<object>
getLocationClanWarRankings(locationId: number, options?: object): Promise<object>
getSeasonPathOfLegends(seasonId: string, options?: object): Promise<object>
getSeason(seasonId: string): Promise<object>
getSeasonPlayerRankings(seasonId: string, options?: object): Promise<object>
getSeasons(): Promise<object>
getLocations(options?: object): Promise<object>
getSeasonsV2(): Promise<object>
getLocation(locationId: number): Promise<object>
getGlobalTournamentRankings(tournamentTag: string, options?: object): Promise<object>
getLocationPathOfLegends(locationId: number, options?: object): Promise<object>
getChallenges(): Promise<object>
getGlobalTournaments(): Promise<object>
Contributions to the "royale-api" project are welcome. To contribute, follow these steps:
- Fork the repository
- Create a new branch:
git checkout -b feature/my-feature
- Make your changes and commit them:
git commit -m "Add my feature"
- Push your changes to the branch:
git push origin feature/my-feature
- Open a pull request
This project is licensed under the MIT License.