{"_id":"@blakebruner/clash-royale-api","_rev":"3-05c88e27744ab78a3379d57311c7527f","name":"@blakebruner/clash-royale-api","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@blakebruner/clash-royale-api","version":"1.0.0","keywords":["clash","royale","api","official","wrapper","game development"],"author":{"name":"Blake Bruner","email":"blakebruner00@gmail.com"},"license":"MIT","_id":"@blakebruner/clash-royale-api@1.0.0","maintainers":[{"name":"blakebruner","email":"blakebruner00@gmail.com"}],"homepage":"https://github.com/blakebruner/clash-royale-api#readme","bugs":{"url":"https://github.com/blakebruner/clash-royale-api/issues"},"dist":{"shasum":"fc816acce5df789eca403c69773df846d52e9025","tarball":"https://registry.npmjs.org/@blakebruner/clash-royale-api/-/clash-royale-api-1.0.0.tgz","fileCount":3,"integrity":"sha512-E69QrLWL0b6zTxEznS3J5Jp9Rv4MT2El4lin224+Zhe9U7xxNNtT+w56ggabOUhn/sjOyEhzMerY9VvMln765g==","signatures":[{"sig":"MEUCIEU7lx0Wqa1EKDikLYHAChCbeFfq3aHkN5IKap9Tm+1xAiEAkTWluz5R31UxPkefpaLw3LFT6I0Gh6jKDyoRqyM6epo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12109},"main":"lib/index.js","types":"lib/index.d.ts","config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"8f580becd4b0a8d4aec1b753abe743f06fa19fb6","scripts":{"test":"jest --config jest.config.ts","build":"tsc","commit":"npx git-cz","format":"prettier --write \"src/**/*.ts\"","prepare":"husky install","semantic-release":"semantic-release"},"_npmUser":{"name":"blakebruner","email":"blakebruner00@gmail.com"},"repository":{"url":"git+https://github.com/blakebruner/clash-royale-api.git","type":"git"},"_npmVersion":"11.5.2","description":"A Clash Royale API official wrapper for seamless integration with your applications.","directories":{},"lint-staged":{"src/**/*.ts":["eslint --fix","prettier --write"]},"_nodeVersion":"22.19.0","dependencies":{"axios":"^1.6.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","husky":"^8.0.3","eslint":"^8.57.0","rimraf":"^5.0.5","ts-jest":"^29.1.1","ts-node":"^10.9.1","typedoc":"^0.25.3","prettier":"^3.1.0","typescript":"^5.2.2","@types/jest":"^29.5.8","@types/node":"^20.14.0","lint-staged":"^15.1.0","semantic-release":"^24.2.3","eslint-config-prettier":"^9.0.0","@typescript-eslint/parser":"^6.11.0","cz-conventional-changelog":"3.1.1","@typescript-eslint/eslint-plugin":"^6.11.0"},"_npmOperationalInternal":{"tmp":"tmp/clash-royale-api_1.0.0_1758949266216_0.32303664373615204","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@blakebruner/clash-royale-api","version":"1.0.2","keywords":["clash","royale","api","official","wrapper","game development"],"author":{"name":"Blake Bruner","email":"blakebruner00@gmail.com"},"license":"MIT","_id":"@blakebruner/clash-royale-api@1.0.2","maintainers":[{"name":"blakebruner","email":"blakebruner00@gmail.com"}],"homepage":"https://github.com/blakebruner/clash-royale-api#readme","bugs":{"url":"https://github.com/blakebruner/clash-royale-api/issues"},"dist":{"shasum":"01ef49b953fbae88197145767ce1c2f4dd5ddde9","tarball":"https://registry.npmjs.org/@blakebruner/clash-royale-api/-/clash-royale-api-1.0.2.tgz","fileCount":78,"integrity":"sha512-Qu4xCLVeInUs8XSuMstd6CCc3q5leVM5afx4WEzFKkqhFjcMhCGItBI8Qi3oqeV3lT7WeTdLcBkRHNObQwKE+A==","signatures":[{"sig":"MEUCIQDy48Dd5V4I+aTDHDqi86XM4Ue3PAc5RobkkAAeNhcgZgIgeARa/AuXKl4KGLPsLpsvvTaIiBH83TQjiaxt+IS73/Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":70295},"main":"lib/index.js","types":"lib/index.d.ts","config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"exports":{".":{"types":"./lib/index.d.ts","default":"./lib/index.js","require":"./lib/index.js"}},"gitHead":"c5230c99e6e70734afbafdb91c9135a0a9b963ac","scripts":{"test":"jest --config jest.config.ts","build":"tsc","commit":"npx git-cz","format":"prettier --write \"src/**/*.ts\"","prepare":"husky install","semantic-release":"semantic-release"},"_npmUser":{"name":"blakebruner","email":"blakebruner00@gmail.com"},"repository":{"url":"git+https://github.com/blakebruner/clash-royale-api.git","type":"git"},"_npmVersion":"11.5.2","description":"A Clash Royale API official wrapper for seamless integration with your applications.","directories":{},"lint-staged":{"src/**/*.ts":["eslint --fix","prettier --write"]},"_nodeVersion":"22.19.0","dependencies":{"axios":"^1.6.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","husky":"^8.0.3","eslint":"^8.57.0","rimraf":"^5.0.5","ts-jest":"^29.1.1","ts-node":"^10.9.1","typedoc":"^0.25.3","prettier":"^3.1.0","typescript":"^5.2.2","@types/jest":"^29.5.8","@types/node":"^20.14.0","lint-staged":"^15.1.0","semantic-release":"^24.2.3","eslint-config-prettier":"^9.0.0","@typescript-eslint/parser":"^6.11.0","cz-conventional-changelog":"3.1.1","@typescript-eslint/eslint-plugin":"^6.11.0"},"_npmOperationalInternal":{"tmp":"tmp/clash-royale-api_1.0.2_1758950011625_0.6673844103905793","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@blakebruner/clash-royale-api","version":"1.0.3","main":"lib/index.js","types":"lib/index.d.ts","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/blakebruner/clash-royale-api.git"},"author":{"name":"Blake Bruner","email":"blakebruner00@gmail.com"},"license":"MIT","description":"A Clash Royale API official wrapper for seamless integration with your applications.","keywords":["clash","royale","api","official","wrapper","game development"],"bugs":{"url":"https://github.com/blakebruner/clash-royale-api/issues"},"homepage":"https://github.com/blakebruner/clash-royale-api#readme","scripts":{"commit":"npx git-cz","test":"jest --config jest.config.ts","build":"tsc","format":"prettier --write \"src/**/*.ts\"","semantic-release":"semantic-release","prepare":"husky install"},"devDependencies":{"@types/jest":"^29.5.8","@types/node":"^20.14.0","@typescript-eslint/eslint-plugin":"^6.11.0","@typescript-eslint/parser":"^6.11.0","cz-conventional-changelog":"3.1.1","eslint":"^8.57.0","eslint-config-prettier":"^9.0.0","husky":"^8.0.3","jest":"^29.7.0","lint-staged":"^15.1.0","prettier":"^3.1.0","rimraf":"^5.0.5","semantic-release":"^24.2.3","ts-jest":"^29.1.1","ts-node":"^10.9.1","typedoc":"^0.25.3","typescript":"^5.2.2"},"dependencies":{"axios":"^1.6.1"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"lint-staged":{"src/**/*.ts":["eslint --fix","prettier --write"]},"exports":{".":{"types":"./lib/index.d.ts","require":"./lib/index.js","default":"./lib/index.js"}},"_id":"@blakebruner/clash-royale-api@1.0.3","gitHead":"8be2d1b9d9eb62b821fcbea241bbb4aaf18a5997","_nodeVersion":"22.19.0","_npmVersion":"11.5.2","dist":{"integrity":"sha512-EOx6iDB6lhWwu1qMGbcwjY9joFIQFiEpJU8SXey4Dj3Ivj19CLDwfEn6iXHxUPAsx910Nj9g4sl4Gaws16zmmg==","shasum":"fb0e536b111e07d05632c58ae3110733a30b326d","tarball":"https://registry.npmjs.org/@blakebruner/clash-royale-api/-/clash-royale-api-1.0.3.tgz","fileCount":78,"unpackedSize":71079,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDUQp6pa6wuA96edrmbM3KXQBaMAeDS5EnFzBCD3kOyfgIgKxFxj0+byY4W7QMaaksX7fa8n+3LEdf48oKgbKJLxKg="}]},"_npmUser":{"name":"blakebruner","email":"blakebruner00@gmail.com"},"directories":{},"maintainers":[{"name":"blakebruner","email":"blakebruner00@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/clash-royale-api_1.0.3_1758950298452_0.22440947163419733"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-27T05:01:06.090Z","modified":"2025-09-27T05:18:19.141Z","1.0.0":"2025-09-27T05:01:06.390Z","1.0.2":"2025-09-27T05:13:31.835Z","1.0.3":"2025-09-27T05:18:18.643Z"},"bugs":{"url":"https://github.com/blakebruner/clash-royale-api/issues"},"author":{"name":"Blake Bruner","email":"blakebruner00@gmail.com"},"license":"MIT","homepage":"https://github.com/blakebruner/clash-royale-api#readme","keywords":["clash","royale","api","official","wrapper","game development"],"repository":{"type":"git","url":"git+https://github.com/blakebruner/clash-royale-api.git"},"description":"A Clash Royale API official wrapper for seamless integration with your applications.","maintainers":[{"name":"blakebruner","email":"blakebruner00@gmail.com"}],"readme":"<p align=\"center\">\n    <img src=\"https://raw.githubusercontent.com/AndreVarandas/clash-royale-api/master/art/logo.png\" width=\"400\" height=\"260\" alt=\"Clash Royale Official API Wrapper logo\">\n</p>\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 => {\n    // Do something with the cards\n  })\n  .catch(err => {\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","readmeFilename":"README.md"}