Game Objects
Troop
- class coc.Troop
Represents a Troop object as returned by the API, optionally filled with game data.
- name
The troop’s name.
- Type:
str
- village
The village type (home or builder base) where this troop belongs.
- Type:
- is_home_base
Whether this troop belongs to the home village.
- Type:
bool
- is_builder_base
Whether this troop belongs to the builder base.
- Type:
bool
- max_level
The maximum level this troop can be upgraded to.
- Type:
int
- is_active
Whether this super troop is currently active/boosted.
- Type:
bool
- id
The troop’s unique identifier.
- Type:
int
- info
Description of the troop.
- Type:
str
- production_building
The building type that produces this troop.
- Type:
- production_building_level
The required level of the production building to unlock this troop.
- Type:
int
- is_flying
Whether this troop is an air unit.
- Type:
bool
- is_air_targeting
Whether this troop can target air units.
- Type:
bool
- is_ground_targeting
Whether this troop can target ground units.
- Type:
bool
- movement_speed
The troop’s movement speed.
- Type:
int
- attack_speed
The troop’s attack speed.
- Type:
int
- attack_range
The troop’s attack range.
- Type:
int
- housing_space
The housing space this troop occupies.
- Type:
int
- is_super_troop
Whether this is a super troop.
- Type:
bool
- is_seasonal
Whether this is a seasonal/temporary troop.
- Type:
bool
- is_siege_machine
Whether this is a siege machine.
- Type:
bool
- base_troop_id
The ID of the base troop (only for super troops).
- Type:
int
- base_troop_minimum_level
The minimum level of the base troop required to boost this super troop.
- Type:
int
- hitpoints
The troop’s hitpoints.
- Type:
int
- dps
The troop’s damage per second.
- Type:
int
- upgrade_cost
The cost to upgrade to the next level.
- Type:
int
- required_lab_level
The laboratory level required to upgrade to the next level.
- Type:
Optional[
int]
- required_townhall
The townhall level required to upgrade to the next level.
- Type:
int
- strength_weight
The matchmaking strength weight of a troop
- Type:
int
Hero
- class coc.Hero
Represents a Hero object as returned by the API, optionally filled with game data.
- name
The hero’s name.
- Type:
str
- village
The village type (home or builder base) where this hero belongs.
- Type:
- is_home_base
Whether this hero belongs to the home village.
- Type:
bool
- is_builder_base
Whether this hero belongs to the builder base.
- Type:
bool
- max_level
The maximum level this hero can be upgraded to.
- Type:
int
- id
The hero’s unique identifier.
- Type:
int
- info
Description of the hero.
- Type:
str
- production_building
The building type that produces this hero.
- Type:
- production_building_level
The required level of the production building to unlock this hero.
- Type:
int
- is_flying
Whether this hero is an air unit.
- Type:
bool
- is_air_targeting
Whether this hero can target air units.
- Type:
bool
- is_ground_targeting
Whether this hero can target ground units.
- Type:
bool
- movement_speed
The hero’s movement speed.
- Type:
int
- attack_speed
The hero’s attack speed.
- Type:
int
- attack_range
The hero’s attack range.
- Type:
int
- hitpoints
The hero’s hitpoints.
- Type:
int
- dps
The hero’s damage per second.
- Type:
int
- upgrade_cost
The cost to upgrade to the next level.
- Type:
int
- required_hero_tavern_level
The hero tavern level required to upgrade to the next level.
- Type:
Optional[
int]
- required_townhall
The townhall level required to upgrade to the next level.
- Type:
int
- strength_weight
The matchmaking strength weight of a hero
- Type:
int
Pet
- class coc.Pet
Represents a Pet object as returned by the API, optionally filled with game data.
- name
The pet’s name.
- Type:
str
- village
The village type where this pet belongs.
- Type:
- max_level
The maximum level this pet can be upgraded to.
- Type:
int
- id
The pet’s unique identifier.
- Type:
int
- info
Description of the pet.
- Type:
str
- production_building
The building type that produces this pet.
- Type:
- production_building_level
The required level of the production building to unlock this pet.
- Type:
int
- is_flying
Whether this pet is an air unit.
- Type:
bool
- is_air_targeting
Whether this pet can target air units.
- Type:
bool
- is_ground_targeting
Whether this pet can target ground units.
- Type:
bool
- movement_speed
The pet’s movement speed.
- Type:
int
- attack_speed
The pet’s attack speed.
- Type:
int
- attack_range
The pet’s attack range.
- Type:
int
- hitpoints
The pet’s hitpoints.
- Type:
int
- dps
The pet’s damage per second.
- Type:
int
- upgrade_cost
The cost to upgrade to the next level.
- Type:
int
- required_pet_house_level
The pet house level required to upgrade to the next level.
- Type:
Optional[
int]
- required_townhall
The townhall level required to upgrade to the next level.
- Type:
int
- strength_weight
The matchmaking strength weight of a pet
- Type:
int
Spell
- class coc.Spell
Represents a Spell object as returned by the API, optionally filled with game data.
- name
The spell’s name.
- Type:
str
- village
The village type (home or builder base) where this spell belongs.
- Type:
- max_level
The maximum level this spell can be upgraded to.
- Type:
int
- id
The spell’s unique identifier.
- Type:
int
- info
Description of the spell.
- Type:
str
- production_building
The building type that produces this spell.
- Type:
- production_building_level
The required level of the production building to unlock this spell.
- Type:
int
- housing_space
The housing space this spell occupies.
- Type:
int
- is_seasonal
Whether this is a seasonal/temporary spell.
- Type:
bool
- damage
The damage dealt by the spell.
- Type:
int
- radius
The spell’s area of effect radius.
- Type:
float
- upgrade_cost
The cost to upgrade to this level.
- Type:
int
- required_lab_level
The laboratory level required to upgrade to the next level.
- Type:
int
- required_townhall
The townhall level required to upgrade to the next level.
- Type:
int
- strength_weight
The matchmaking strength weight of a spell
- Type:
int
Guardian
- class coc.Guardian
Represents a Guardian character as returned by the API, optionally filled with game data.
- id
The guardian’s unique identifier.
- Type:
int
- name
The guardian’s name.
- Type:
str
- info
Description of the guardian.
- Type:
str
- is_flying
Whether this guardian is an air unit.
- Type:
bool
- is_air_targeting
Whether this guardian can target air units.
- Type:
bool
- is_ground_targeting
Whether this guardian can target ground units.
- Type:
bool
- movement_speed
The guardian’s movement speed.
- Type:
int
- attack_speed
The guardian’s attack speed.
- Type:
int
- attack_range
The guardian’s attack range.
- Type:
int
- hitpoints
The guardian’s hitpoints.
- Type:
int
- dps
The guardian’s damage per second.
- Type:
int
- upgrade_cost
The cost to upgrade to the next level.
- Type:
int
- required_townhall
The townhall level required to upgrade to the next level.
- Type:
int
Helper
- class coc.Helper
Represents a Helper character as returned by the API, optionally filled with game data.
- id
The helper’s unique identifier.
- Type:
int
- name
The helper’s name.
- Type:
str
- upgrade_cost
The cost to upgrade to the next level.
- Type:
int
- required_townhall
The townhall level required to upgrade to the next level.
- Type:
int
Building
- class coc.Building
Represents a Building.
- id
The building’s unique identifier.
- Type:
int
- name
The building’s name.
- Type:
str
- info
Description of the building.
- Type:
str
- type
The type of building.
- Type:
- village
The village type where this building belongs.
- Type:
- width
The width of the building.
- Type:
int
- is_home_base
Whether this building belongs to the home village.
- Type:
bool
- is_builder_base
Whether this building belongs to the builder base.
- Type:
bool
- is_superchargeable
Whether this building can be supercharged.
- Type:
bool
- seasonal_defenses
The list of seasonal defenses for this building (Crafting Station only).
- Type:
List[
SeasonalDefense]
- weapon
The townhall weapon (only for townhall).
- Type:
Optional[
TownhallWeapon]
- build_cost
The cost to build/upgrade to this level.
- Type:
int
- required_townhall
The townhall level required to build/upgrade to this level.
- Type:
int
- strength_weight
The matchmaking strength weight of a building
- Type:
int
- hitpoints
The building’s hitpoints.
- Type:
int
- dps
The building’s damage per second.
- Type:
int
- supercharge
The supercharge for this building.
- Type:
Optional[
Supercharge]
- merge_requirement
The merge requirements for this building.
- Type:
List[
MergeRequirement]
- unlocks
The unlocks provided by this building (only for townhall).
- Type:
List[
TownhallUnlock]
Note
To get the upgrade cost, access the build_cost of the next level.
SeasonalDefenseModule
- class coc.SeasonalDefenseModule
Represents a Seasonal Defense Module.
- id
The module’s unique identifier.
- Type:
int
- name
The module’s name.
- Type:
str
- max_level
The maximum level this module can be upgraded to.
- Type:
int
- build_cost
The cost to build/upgrade to this level.
- Type:
int
- ability_data
The ability data for this module.
- Type:
dict
Note
To get the upgrade cost, access the build_cost of the next level.
SeasonalDefense
- class coc.SeasonalDefense
Represents a Seasonal Defense.
- id
The defense’s unique identifier.
- Type:
int
- name
The defense’s name.
- Type:
str
- info
Description of the defense.
- Type:
str
- modules
The list of modules for this defense.
- Type:
List[
SeasonalDefenseModule]
- level
The total level (sum of all module levels).
- Type:
int
MergeRequirement
GearUp
TownhallUnlock
TownhallWeapon
- class coc.TownhallWeapon
Represents a Townhall Weapon.
- name
The weapon’s name.
- Type:
str
- info
Description of the weapon.
- Type:
str
- build_cost
The cost to build/upgrade to this level.
- Type:
int
- strength_weight
The matchmaking strength weight of a th weapon
- Type:
int
- dps
The weapon’s damage per second.
- Type:
int
Note
To get the upgrade cost, access the build_cost of the next level.
Supercharge
- class coc.Supercharge
Represents a Supercharge for a building.
- build_cost
The cost to build/upgrade to this level.
- Type:
int
- hitpoints_buff
The hitpoints buff provided by this supercharge.
- Type:
int
- dps_buff
The damage per second buff provided by this supercharge.
- Type:
int
Note
To get the upgrade cost, access the build_cost of the next level.
Trap
- class coc.Trap
Represents a Trap.
- id
The trap’s unique identifier.
- Type:
int
- name
The trap’s name.
- Type:
str
- village
The village type where this trap belongs.
- Type:
- is_home_base
Whether this trap belongs to the home village.
- Type:
bool
- is_builder_base
Whether this trap belongs to the builder base.
- Type:
bool
- width
The width of the trap.
- Type:
int
- is_air_triggerable
Whether this trap can be triggered by air units.
- Type:
bool
- is_ground_triggerable
Whether this trap can be triggered by ground units.
- Type:
bool
- damage_radius
The damage radius of the trap.
- Type:
int
- trigger_radius
The trigger radius of the trap.
- Type:
int
- build_cost
The cost to build/upgrade to this level.
- Type:
int
- required_townhall
The townhall level required to build/upgrade to this level.
- Type:
int
- strength_weight
The matchmaking strength weight of a trap
- Type:
int
- damage
The damage dealt by the trap.
- Type:
int
Note
To get the upgrade cost, access the build_cost of the next level.
Decoration
- class coc.Decoration
Represents a Decoration.
- id
The decoration’s unique identifier.
- Type:
int
- name
The decoration’s name.
- Type:
str
- width
The width of the decoration.
- Type:
int
- in_shop
Whether this decoration is available in the shop.
- Type:
bool
- pass_reward
Whether this decoration is a pass reward.
- Type:
bool
- max_count
The maximum number of this decoration that can be placed.
- Type:
int
- cost
The cost to buy/place this decoration.
- Type:
int
- village
The village type where this decoration belongs.
- Type:
Obstacle
- class coc.Obstacle
Represents an Obstacle.
- id
The obstacle’s unique identifier.
- Type:
int
- name
The obstacle’s name.
- Type:
str
- width
The width of the obstacle.
- Type:
int
- clear_cost
The cost to clear this obstacle.
- Type:
int
- loot_count
The amount of loot obtained from clearing this obstacle.
- Type:
Optional[
int]
- village
The village type where this obstacle belongs.
- Type: