Players

Player profile models and helpers for achievements, units, spells, and labels.

Player

struct clashy.Player

Player is the full player profile returned by GetPlayer.

Tag

string json: tag

Tag is the player's Clash tag.

Name

string json: name

Name is the player's current display name.

ExpLevel

int json: expLevel

ExpLevel is the player's experience level.

Trophies

int json: trophies

Trophies is the player's current home village trophy count.

BestTrophies

int json: bestTrophies

BestTrophies is the player's all-time best home village trophy count.

WarStars

int json: warStars

WarStars is the player's lifetime war star count.

TownHall

int json: townHallLevel

TownHall is the player's home village Town Hall level.

TownHallWeapon

int json: townHallWeaponLevel

TownHallWeapon is the weapon level for Town Hall levels that have one.

BuilderHall

int json: builderHallLevel

BuilderHall is the player's Builder Hall level.

BestBuilderBaseTrophies

int json: bestBuilderBaseTrophies

BestBuilderBaseTrophies is the all-time best Builder Base trophy count.

VersusAttackWins

int json: versusBattleWins

VersusAttackWins is the legacy Builder Base attack-win field.

Donations

int json: donations

Donations is the number of troops donated this season.

Received

int json: donationsReceived

Received is the number of donated troops received this season.

ClanCapitalContributions

int json: clanCapitalContributions

ClanCapitalContributions is the lifetime Clan Capital contribution count.

ClanRank

int json: clanRank

ClanRank is the player's current rank inside their clan.

ClanPreviousRank

int json: previousClanRank

ClanPreviousRank is the player's previous rank inside their clan.

VersusTrophies

int json: versusTrophies

VersusTrophies is the legacy Builder Base trophy field.

BuilderBaseTrophies

int json: builderBaseTrophies

BuilderBaseTrophies is the player's current Builder Base trophy count.

LeagueTier

League json: leagueTier

LeagueTier is the player's home village league.

BuilderBaseLeague

*League json: builderBaseLeague

BuilderBaseLeague is the player's Builder Base league.

Role

Role json: role

Role is the player's role in their current clan.

Clan

*PlayerClan json: clan

Clan is the compact clan object for the player's current clan.

CurrentLeagueGroupTag

string json: currentLeagueGroupTag

CurrentLeagueGroupTag is the active legend league group tag when present.

CurrentLeagueSeasonID

int json: currentLeagueSeasonId

CurrentLeagueSeasonID is the active legend league season ID when present.

PreviousLeagueGroupTag

string json: previousLeagueGroupTag

PreviousLeagueGroupTag is the previous legend league group tag when present.

PreviousLeagueSeasonID

int json: previousLeagueSeasonId

PreviousLeagueSeasonID is the previous legend league season ID when present.

LegendStatistics

*LegendStatistics json: legendStatistics

LegendStatistics contains legend trophies and seasonal legend finishes.

Labels

[]Label json: labels

Labels are public player labels.

Achievements

[]Achievement json: achievements

Achievements contains achievement progress for both villages and Clan Capital.

Troops

[]Troop json: troops

Troops contains unlocked troops with current and max levels.

Heroes

[]Hero json: heroes

Heroes contains unlocked heroes with current and max levels.

Spells

[]Spell json: spells

Spells contains unlocked spells with current and max levels.

HeroEquipment

[]Equipment json: heroEquipment

HeroEquipment contains unlocked hero equipment with current and max levels.

Legend Statistics

struct clashy.LegendStatistics

LegendStatistics contains a player's legend trophies and season snapshots.

LegendTrophies

int json: legendTrophies

LegendTrophies is the player's lifetime legend trophy count.

BestSeason

*Season json: bestSeason

BestSeason is the player's best legend season.

PreviousSeason

*Season json: previousSeason

PreviousSeason is the player's previous legend season.

BestVersusSeason

*Season json: bestVersusSeason

BestVersusSeason is the player's legacy best Builder Base season.

CurrentSeason

*Season json: currentSeason

CurrentSeason is the player's current legend season progress.

Achievement

struct clashy.Achievement

Achievement describes one player achievement and its current progress.

Name

string json: name

Name is the achievement display name.

Stars

int json: stars

Stars is the number of achievement stars earned.

Value

int json: value

Value is the current progress value.

Target

int json: target

Target is the value needed to complete the achievement.

Info

string json: info

Info describes the achievement goal.

CompletionInfo

string json: completionInfo

CompletionInfo describes the completed achievement state.

Village

string json: village

Village identifies the village or game area for the achievement.

Player House Element

struct clashy.PlayerHouseElement

PlayerHouseElement is one cosmetic element of a player's house.

ID

int json: id

ID is the cosmetic element identifier.

Type

string json: type

Type is the cosmetic element type.

Player Methods

clashy.Player.BuilderTroops() -> []Troop

BuilderTroops returns troops that belong to Builder Base.

Return type:
[]Troop

clashy.Player.GetAchievement(name: string) -> *Achievement

GetAchievement returns the achievement with the provided display name.

Parameters:

name (string)

Return type:
*Achievement

clashy.Player.GetHero(name: string) -> *Hero

GetHero returns the hero with the provided display name.

Parameters:

name (string)

Return type:
*Hero

clashy.Player.GetSpell(name: string) -> *Spell

GetSpell returns the spell with the provided display name.

Parameters:

name (string)

Return type:
*Spell

clashy.Player.GetTroop(name: string) -> *Troop

GetTroop returns the troop with the provided display name.

Parameters:

name (string)

Return type:
*Troop

clashy.Player.HomeTroops() -> []Troop

HomeTroops returns troops that belong to the home village.

Older API responses may omit Village for home-village troops, so an empty village is treated as home.

Return type:
[]Troop