Clan Capital

Clan Capital

The clanCapital() factory function is the entry point for every piece of Clan Capital data: defenses, Raid Weekend troops, districts, and the Forge.


Namespaces

clanCapital() returns a ClanCapital object with one method per category:

import { clanCapital } from 'clash-of-clans-data'

clanCapital().defenses() // ClanCapitalDefenses
clanCapital().traps() // ClanCapitalTraps
clanCapital().walls() // ClanCapitalWalls
clanCapital().troops() // ClanCapitalTroops
clanCapital().spells() // ClanCapitalSpells
clanCapital().armyBuildings() // ClanCapitalArmyBuildings
clanCapital().other() // ClanCapitalOther
clanCapital().capitalHall() // ClanCapitalCapitalHall
clanCapital().districtHall() // ClanCapitalDistrictHall
clanCapital().leagues() // ClanCapitalLeagues
clanCapital().forge() // ClanCapitalForge
NamespaceCategory pageContent
defenses()Defenses & traps21 district defenses
traps()Defenses & traps5 traps (Mine, Mega Mine, Log Trap, Zap Trap, Spear Trap)
walls()Defenses & trapsWall tiers per Capital/District Hall level
troops()Troops & spells17 Raid Weekend troops
spells()Troops & spells7 Raid Weekend spells
armyBuildings()Buildings & leaguesArmy Camp, Spell Storage, Barracks, and Spell Factories per district
other()Buildings & leaguesDistrict houses/decorations
capitalHall()Buildings & leaguesCapital Hall level data
districtHall()Buildings & leaguesDistrict Hall level data
leagues()Buildings & leaguesClan Capital league tiers with trophy ranges
forge()Buildings & leaguesDaily Forge, Auto-Forge, and forge crafting rates

Quick start

import { clanCapital } from 'clash-of-clans-data'

const superBarbarian = clanCapital().troops().superBarbarian().first()!
const dh5Defenses = clanCapital().defenses().byCapitalHall(5).get()
const airDefenses = clanCapital().defenses().byTargetType('air').get()

Level-count totals

clanCapital() exposes a helper that totals structure, wall, troop, and spell levels across the Capital Peak and every unlocked district, for a given Capital Hall level:

import { clanCapital } from 'clash-of-clans-data'

const counts = clanCapital().levelCountAtClanCapital(6)

console.log(counts.capitalPeak.total)
console.log(counts.barbarianCamp.total)
console.log(counts.wizardValley.total)
console.log(counts.troops)
console.log(counts.spells)
console.log(counts.total)

Next steps

Previous
Buildings & leagues