{"id":15018366,"url":"https://github.com/andrevarandas/clash-royale-api","last_synced_at":"2026-02-28T17:04:19.813Z","repository":{"id":34136234,"uuid":"169659918","full_name":"AndreVarandas/clash-royale-api","owner":"AndreVarandas","description":"A wrapper for the OFFICIAL Clash Royale API","archived":false,"fork":false,"pushed_at":"2024-11-18T23:18:48.000Z","size":1826,"stargazers_count":22,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T20:29:43.945Z","etag":null,"topics":["api","api-wrapper","clash-royale-api","clash-royale-official","clashroyale","supercell"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndreVarandas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-07T23:37:33.000Z","updated_at":"2024-12-26T16:26:56.000Z","dependencies_parsed_at":"2023-02-18T03:31:01.656Z","dependency_job_id":"b8063665-278c-4b89-b3d5-3699dad8d776","html_url":"https://github.com/AndreVarandas/clash-royale-api","commit_stats":{"total_commits":93,"total_committers":9,"mean_commits":"10.333333333333334","dds":0.6129032258064516,"last_synced_commit":"747447ef73ad3f0cbf8964f84570b317cd496788"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreVarandas%2Fclash-royale-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreVarandas%2Fclash-royale-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreVarandas%2Fclash-royale-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreVarandas%2Fclash-royale-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndreVarandas","download_url":"https://codeload.github.com/AndreVarandas/clash-royale-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237869256,"owners_count":19379290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-wrapper","clash-royale-api","clash-royale-official","clashroyale","supercell"],"created_at":"2024-09-24T19:51:53.222Z","updated_at":"2025-10-23T18:30:49.815Z","avatar_url":"https://github.com/AndreVarandas.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/AndreVarandas/clash-royale-api/master/art/logo.png\" width=\"400\" height=\"260\" alt=\"Clash Royale Official API Wrapper logo\"\u003e\n\u003c/p\u003e\n\n# Clash Royale Official API Wrapper\n\n[![npm (scoped)](https://img.shields.io/npm/v/@varandas/clash-royale-api.svg)](https://www.npmjs.com/package/@varandas/clash-royale-api)\n[![npm](https://img.shields.io/npm/dm/@varandas/clash-royale-api.svg)](https://npmcharts.com/compare/@varandas/clash-royale-api)\n\n[![Build Status](https://travis-ci.org/AndreVarandas/clash-royale-api.svg?branch=master)](https://travis-ci.org/AndreVarandas/clash-royale-api)\n[![Codecov Coverage](https://img.shields.io/codecov/c/github/AndreVarandas/clash-royale-api/master.svg?style=flat-square)](https://codecov.io/gh/AndreVarandas/clash-royale-api/)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Known Vulnerabilities](https://snyk.io/test/github/AndreVarandas/clash-royale-api/badge.svg?targetFile=package.json)](https://snyk.io/test/github/AndreVarandas/clash-royale-api?targetFile=package.json)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/AndreVarandas/clash-royale-api/blob/master/LICENSE)\n\nAn asynchronous wrapper for the official Clash Royale API.\n\nOfficial API Link [https://developer.clashroyale.com](https://developer.clashroyale.com)\n\n## Important note\n\nThis wrapper will only work from a nodejs server app. The official clash royale api is, unfortunately, blocking requests done directly from the browser.\n\n## Getting started\n\nIn order to use the official api, you will need a token. This token can be obtained at the Official API website [https://developer.clashroyale.com](https://developer.clashroyale.com). - For each token an ip address is associated, so make sure to use the token in the same server where you got it.\n\nYou can also use a **proxy server** to make the requests, such as [https://docs.royaleapi.com/proxy.html](https://docs.royaleapi.com/proxy.html) - More details below in the usage section.\n\nOnce you register and get the token, you are ready to start.\n\n## Usage\n\nInstall the package:\n\n- `yarn add @varandas/clash-royale-api`\n\nOR\n\n- `npm i --save @varandas/clash-royale-api`\n\nUsage:\n\n```javascript\n// Import the package\nconst { ClashRoyaleAPI } = require('@varandas/clash-royale-api')\n\n// Initialize the api\nconst api = new ClashRoyaleAPI('the token you got from the api')\n\n// Use the api to get cards\napi\n  .getCards()\n  .then(cards =\u003e {\n    // Do something with the cards\n  })\n  .catch(err =\u003e {\n    // handle errors\n  })\n\n// Using the proxy server (https://proxy.royaleapi.dev/v1)\n// Create a key on the the official API and whitelist (include) this IP: 45.79.218.79\n// Use https://proxy.royaleapi.dev/v1\nconst api = new ClashRoyaleAPI(\n  'the token you got from the api',\n  'https://proxy.royaleapi.dev/v1',\n)\n\n// Use the api to get cards\n...\n```\n\n## About the proxy server\n\nThe proxy server is a service provided by the RoyaleAPI team. It allows you to make requests to the official API from the browser.\n\nIf you want to host your own proxy server, there is a nuxt web app you can use available at [https://github.com/AndreVarandas/royale-proxy-api](https://github.com/AndreVarandas/royale-proxy-api).\n\n## Methods\n\nAll api calls are asynchronous and used in the same way as above in the getCards example.\n\n**Clans**\n\n- `getClans(params: IClanRequestParams)` - Returns a list of all the available clans.\n- `getClanByTag(tag: string)` - Returns details about a specific clan.\n- `getClanMembers(tag: string)` - Returns a list of clan members.\n- `getClanWarlog(tag: string)` - Returns the war log for a clan\n- `getClanCurrentWar(tag: string)` - Retrieve information about clan's current clan war\n- `getClanCurrentRiverRace(tag: string)` - Retrieve information about clan's current river race\n\n**Players**\n\n- `getPlayerByTag(tag: string)` - Get information about a single player by player tag.\n- `getPlayerUpcomingChests(tag: string)` - Get list of reward chests that the player will receive next in the game.\n- `getPlayerBattleLog(tag: string)` - Get list of recent battle results for a player.\n\n**Tournaments**\n\n- `getTournaments(params: ITournamentRequestParams)` - Search all tournaments by name.\n- `getTournamentByTag(tag: string)` - Get information about a single tournament by a tournament tag.\n- `getGlobalTournaments` - List all available global tournaments.\n\n**Cards**\n\n- `getCards` - Get list of all available cards.\n\n**Locations**\n\n- `getLocations(params: ILocationRequestParams)` - List all available locations.\n- `getLocationById(id: string, params: ILocationFullRequestParams)` - Get information about specific location.\n- `getClanRankinsForLocation(id: string, params: ILocationFullRequestParams)` - Get clan rankings for a specific location.\n- `getPlayerRankingsForLocation(id: string, params: ILocationFullRequestParams)` - Get player rankings for a specific location.\n- `getClanWarRankingsForLocation(id: string, params: ILocationFullRequestParams)` - Get clan rankings for a specific location.\n\n**Leaderboards**\n\n- `getLeaderboards()` - List leaderboards for different trophy roads.\n- `getLeaderboardById(leaderboardId: number, params: ILeaderboardRequestParams)` - Get players on a specific leaderboard.\n\n## Configuration Objects\n\n**IClanRequestParams**\n\n```typescript\n/**\n * Note:\n * Only the name property is required.\n */\nexport interface IClanRequestParams {\n  /**\n   * Search clans by name.\n   * If name is used as part of search query, it needs to be at least three\n   * characters long. Name search parameter is interpreted as wild card\n   * search, so it may appear anywhere in the clan name.\n   */\n  name: string\n  /**\n   * Filter by clan location identifier. For list of available locations,\n   * refer to getLocations operation.\n   */\n  locationId?: number\n  /**\n   * Filter by minimum amount of clan members.\n   */\n  minMembers?: number\n  /**\n   * Filter by maximum amount of clan members.\n   */\n  maxMembers?: number\n  /**\n   * Filter by minimum amount of clan score.\n   */\n  minScore?: number\n  /**\n   * Limit the number of items returned in the response.\n   */\n  limit?: number\n  /**\n   * Return only items that occur after this marker.\n   * After marker can be found from the response, inside the 'paging' property.\n   * Note that only after or before can be specified for a request, not both.\n   */\n  after?: number\n  /**\n   * Return only items that occur before this marker.\n   * Before marker can be found from the response, inside the 'paging' property.\n   * Note that only after or before can be specified for a request, not both.\n   */\n  before?: number\n}\n```\n\n**ITournamentRequestParams**\n\n```typescript\n/**\n * Note:\n * Only the name property is required.\n */\nexport interface ITournamentRequestParams {\n  /**\n   * Search tournaments by name.\n   */\n  name: string\n  /**\n   * Limit the number of items returned in the response.\n   */\n  limit?: number\n  /**\n   * Return only items that occur after this marker.\n   * After marker can be found from the response, inside the 'paging' property.\n   * Note that only after or before can be specified for a request, not both.\n   */\n  after?: number\n  /**\n   * Return only items that occur before this marker.\n   * Before marker can be found from the response, inside the 'paging' property.\n   * Note that only after or before can be specified for a request, not both.\n   */\n  before?: number\n}\n```\n\n**ILocationRequestParams**\n\n```typescript\nexport interface ILocationRequestParams {\n  /**\n   * Limit the number of items returned in the response.\n   */\n  limit?: number\n  /**\n   * Return only items that occur after this marker.\n   * After marker can be found from the response,\n   * inside the 'paging' property. Note that only\n   * after or before can be specified for a request, not both.\n   */\n  after?: number\n  /**\n   * Return only items that occur before this marker.\n   * Before marker can be found from the response,\n   * inside the 'paging' property. Note that only\n   * after or before can be specified for a request, not both.\n   */\n  before?: number\n}\n```\n\n**ILeaderboardRequestParams**\n\n```typescript\nexport interface ILeaderboardRequestParams {\n  /**\n   * Limit the number of items returned in the response.\n   */\n  limit?: number\n  /**\n   * Return only items that occur after this marker.\n   * After marker can be found from the response, inside the 'paging' property.\n   * Note that only after or before can be specified for a request, not both.\n   */\n  after?: string\n  /**\n   * Return only items that occur before this marker.\n   * Before marker can be found from the response, inside the 'paging' property.\n   * Note that only after or before can be specified for a request, not both.\n   */\n  before?: string\n}\n```\n\n[LICENSE - MIT](LICENSE)\n\n---\n\n## Credits\n\nLogo by [Caneco](https://twitter.com/caneco).\n\n---\n\nThis content is not affiliated with, endorsed, sponsored, or specifically approved by Supercell and Supercell is not responsible for it. For more information see [Supercell’s Fan Content Policy](http://www.supercell.com/fan-content-policy).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrevarandas%2Fclash-royale-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrevarandas%2Fclash-royale-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrevarandas%2Fclash-royale-api/lists"}