A web application that allows users to look up Clash of Clans player profiles using the official Clash of Clans API.
- Clean and modern UI with Clash of Clans theme
- Player profile lookup using player tags
- Displays detailed player information including:
- Town Hall level
- Experience level
- Trophies and best trophies
- War stars
- Attack and defense wins
- Clan information (if player is in a clan)
This project has a specific limitation due to Clash of Clans API requirements:
- IP Whitelisting: The Clash of Clans API requires each API key to have specific IP addresses whitelisted
- No Dynamic IPs: The API doesn't support dynamic IP addresses or wildcard IP entries
- Limited IP Slots: Each API key can only whitelist a limited number of IPs (usually 10-20)
Due to these restrictions, the application can only work from whitelisted IP addresses. This makes it impractical to host publicly where users could access it from any IP address.
- Node.js (v14 or higher)
- npm (comes with Node.js)
- A Clash of Clans Developer Account and API Key
- Visit Clash of Clans Developer Portal
- Create an account or log in
- Create a new API key
- Add your current IP address to the whitelist
- You can find your IP by visiting whatismyip.com
-
Clone this repository:
git clone https://github.com/rohanongithub/clash-of-clans-lookup.git cd clash-of-clans-lookup -
Install dependencies:
npm install
-
Open
server.jsand replace the API_TOKEN with your own:let API_TOKEN = 'your-api-token-here';
-
Start the server:
npm start
-
Open your browser and visit:
http://localhost:3000
The project structure is organized as follows:
├── server.js # Express server and API proxy
├── index.html # Main HTML file
├── styles.css # Styling
├── app.js # Frontend JavaScript
└── README.md # This file
-
Invalid IP Error: If you get an "Invalid IP" error, make sure:
- Your current IP is whitelisted in the Clash of Clans developer portal
- You've correctly pasted your API key in
server.js
-
API Key Issues: If your API key isn't working:
- Check if it's expired
- Verify the IP whitelist
- Make sure you're using the correct key format
Feel free to fork this project and make improvements. Pull requests are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.
- Built by Rohan
- Uses the Clash of Clans API


