Clash of Clans API

Games & Comics / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

The Clash of Clans API provides official data on players, clans, clan wars, leagues, and rankings from Supercell's hit mobile strategy game. You register at developer.clashofclans.com to get an API key tied to your IP address, then query player stats, clan information, and war logs. It's a popular choice for building clan management tools or progress trackers.

💡

Beginner Tip

API keys in Clash of Clans are IP-locked — if your IP changes (e.g. on a home network), you must update your key in the developer portal or create a new one.

Available Data

Use case: Integrate clash of clans game information data into web and mobile applications
Clash of Clans data via REST API
JSON-formatted response data
Requires API key authentication

Example Response

JSON Response
{
  "id": 1,
  "name": "Clash of Clans",
  "data": "Clash of Clans Game Information",
  "source": "Clash of Clans"
}

Field Reference

tag Unique player or clan tag starting with '#'.
name In-game display name.
townHallLevel Current Town Hall level of the player's base (1–16).
trophies Current trophy count used for league placement.
troops Array of troop objects showing name, level, and max level for each unlocked troop.
clan.tag Tag of the clan the player currently belongs to (absent if not in a clan).

Implementation Example

const url = "https://developer.clashofclans.com/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

403 Forbidden Your server's IP address is not listed as allowed for this API key.
Go to developer.clashofclans.com, select your key, and add the IP address you're making requests from.
404 Not Found for tag Player and clan tags must be URL-encoded; '#' must become '%23'.
Replace the '#' at the start of every tag with '%23' in your URL.
503 Service Unavailable The game is in maintenance mode during an update.
Wait for the maintenance window to end (usually under an hour) and retry; check Supercell status pages for updates.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 10/20
🔒 Security 15/15
🛠 Developer XP 12/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Games & Comics
Difficulty Intermediate
Verified: 2026-04-04

Similar APIs

View All →