1.0.0 • Published 3 months ago

royale-api v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Clash Royale API for NPM

NPM Downloads NPM License

A wrapper for the Clash Royale API.
This package is not affiliated with Supercell or RoyaleAPI.

Getting a token

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.

Usage

First, install the package using NPM or your favorite package manager:

npm install @natoune/royale-api

Usage example:

const RoyaleAPI = require("@natoune/royale-api");

const cr = new RoyaleAPI("token");

cr.getPlayer("#AAAAAAAA").then((player) => {
	console.log(player);
});

Methods

There is one method for each endpoint of the Clash Royale API (see documentation):

Clans

  • 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>

Players

  • getPlayer(playerTag: string): Promise<object>
  • getPlayerUpcomingChests(playerTag: string): Promise<object>
  • getPlayerBattleLog(playerTag: string): Promise<object>

Cards

  • getCards(options?: object): Promise<object>

Tournaments

  • getTournaments(options?: object): Promise<object>
  • getTournament(tournamentTag: string): Promise<object>

Locations

  • 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>

Challenges

  • getChallenges(): Promise<object>

Global Tournaments

  • getGlobalTournaments(): Promise<object>

Contributing

Contributions to the "royale-api" project are welcome. To contribute, follow these steps:

  1. Fork the repository
  2. Create a new branch: git checkout -b feature/my-feature
  3. Make your changes and commit them: git commit -m "Add my feature"
  4. Push your changes to the branch: git push origin feature/my-feature
  5. Open a pull request

License

This project is licensed under the MIT License.

1.0.0

3 months ago