-
Notifications
You must be signed in to change notification settings - Fork 2
Resource BattleResource
CrucifiedPain edited this page Jun 26, 2026
·
10 revisions
Endpoints: • battle.getById • battle.getLiveBattleData • battle.getBattles (cursor-paginated)
Fetch all items across all pages concurrently using parallel time-slicing.
await client.battle.collect_all(**kwargs: 'typing.Any') -> 'list[Battle]'| Name | Type | Default |
|---|---|---|
kwargs |
Any |
*Required* |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
`string | null` | No |
__v |
`integer | null` | No |
war |
`string | null` | No |
region |
`string | null` | No |
attacker_country_id |
`string | null` | No |
defender_country_id |
`string | null` | No |
attacker |
`BattleSide | null` | No |
defender |
`BattleSide | null` | No |
attackerScore |
`number | null` | No |
defenderScore |
`number | null` | No |
isActive |
`boolean | null` | No |
isSystemResistance |
`boolean | null` | No |
isBigBattle |
`boolean | null` | No |
winner_country |
`string | null` | No |
startTime |
`string | null` | No |
endTime |
`string | null` | No |
currentRound |
`string | integer | object |
rounds |
`array | null` | No |
roundsHistory |
`array | null` | No |
roundsToWin |
`integer | null` | No |
totalRounds |
`integer | null` | No |
type |
`string | null` | No |
stats |
`BattleStats | null` | No |
createdAt |
`string | null` | No |
updatedAt |
`string | null` | No |
Per-side summary (attacker/defender) of a battle.
| Field | Type | Required | Description |
|---|---|---|---|
_id |
`string | null` | No |
__v |
`integer | null` | No |
country |
`string | null` | No |
region |
`string | null` | No |
damages |
`number | null` | No |
hitCount |
`integer | null` | No |
wonRoundsCount |
`integer | null` | No |
countryOrders |
`array | null` | No |
muOrders |
`array | null` | No |
moneyPool |
`number | null` | No |
moneyPer1kDamages |
`number | null` | No |
bountyEffectiveAt |
`string | null` | No |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
`string | null` | No |
__v |
`integer | null` | No |
hitCount |
`integer | null` | No |
Get full battle info by ID.
await client.battle.get(battle_id: 'str') -> 'Battle'| Name | Type | Default |
|---|---|---|
battle_id |
str |
*Required* |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
`string | null` | No |
__v |
`integer | null` | No |
war |
`string | null` | No |
region |
`string | null` | No |
attacker_country_id |
`string | null` | No |
defender_country_id |
`string | null` | No |
attacker |
`BattleSide | null` | No |
defender |
`BattleSide | null` | No |
attackerScore |
`number | null` | No |
defenderScore |
`number | null` | No |
isActive |
`boolean | null` | No |
isSystemResistance |
`boolean | null` | No |
isBigBattle |
`boolean | null` | No |
winner_country |
`string | null` | No |
startTime |
`string | null` | No |
endTime |
`string | null` | No |
currentRound |
`string | integer | object |
rounds |
`array | null` | No |
roundsHistory |
`array | null` | No |
roundsToWin |
`integer | null` | No |
totalRounds |
`integer | null` | No |
type |
`string | null` | No |
stats |
`BattleStats | null` | No |
createdAt |
`string | null` | No |
updatedAt |
`string | null` | No |
Per-side summary (attacker/defender) of a battle.
| Field | Type | Required | Description |
|---|---|---|---|
_id |
`string | null` | No |
__v |
`integer | null` | No |
country |
`string | null` | No |
region |
`string | null` | No |
damages |
`number | null` | No |
hitCount |
`integer | null` | No |
wonRoundsCount |
`integer | null` | No |
countryOrders |
`array | null` | No |
muOrders |
`array | null` | No |
moneyPool |
`number | null` | No |
moneyPer1kDamages |
`number | null` | No |
bountyEffectiveAt |
`string | null` | No |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
`string | null` | No |
__v |
`integer | null` | No |
hitCount |
`integer | null` | No |
Convenience: fetch all active battles across the globe.
await client.battle.get_active(**kwargs: 'Any') -> 'list[Battle]'| Name | Type | Default |
|---|---|---|
kwargs |
Any |
*Required* |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
`string | null` | No |
__v |
`integer | null` | No |
war |
`string | null` | No |
region |
`string | null` | No |
attacker_country_id |
`string | null` | No |
defender_country_id |
`string | null` | No |
attacker |
`BattleSide | null` | No |
defender |
`BattleSide | null` | No |
attackerScore |
`number | null` | No |
defenderScore |
`number | null` | No |
isActive |
`boolean | null` | No |
isSystemResistance |
`boolean | null` | No |
isBigBattle |
`boolean | null` | No |
winner_country |
`string | null` | No |
startTime |
`string | null` | No |
endTime |
`string | null` | No |
currentRound |
`string | integer | object |
rounds |
`array | null` | No |
roundsHistory |
`array | null` | No |
roundsToWin |
`integer | null` | No |
totalRounds |
`integer | null` | No |
type |
`string | null` | No |
stats |
`BattleStats | null` | No |
createdAt |
`string | null` | No |
updatedAt |
`string | null` | No |
Per-side summary (attacker/defender) of a battle.
| Field | Type | Required | Description |
|---|---|---|---|
_id |
`string | null` | No |
__v |
`integer | null` | No |
country |
`string | null` | No |
region |
`string | null` | No |
damages |
`number | null` | No |
hitCount |
`integer | null` | No |
wonRoundsCount |
`integer | null` | No |
countryOrders |
`array | null` | No |
muOrders |
`array | null` | No |
moneyPool |
`number | null` | No |
moneyPer1kDamages |
`number | null` | No |
bountyEffectiveAt |
`string | null` | No |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
`string | null` | No |
__v |
`integer | null` | No |
hitCount |
`integer | null` | No |
Get live battle data (scores, damage, time remaining).
await client.battle.get_live(battle_id: 'str', *, round_number: 'int | None' = None) -> 'BattleLive'| Name | Type | Default |
|---|---|---|
battle_id |
str |
*Required* |
round_number |
`int | None` |
Response from battle.getLiveBattleData.
| Field | Type | Required | Description |
|---|---|---|---|
_id |
`string | null` | No |
__v |
`integer | null` | No |
battleId |
`string | null` | No |
roundNumber |
`integer | null` | No |
attackerScore |
`number | null` | No |
defenderScore |
`number | null` | No |
attackerDamage |
`number | null` | No |
defenderDamage |
`number | null` | No |
timeRemaining |
`integer | null` | No |
isActive |
`boolean | null` | No |
Get battles with optional filters (cursor-paginated).
await client.battle.get_many(*, is_active: 'bool | None' = None, limit: 'int' = 10, cursor: 'str | None' = None, direction: 'BattleDirection | str | None' = None, filter: 'BattleFilter | str | None' = None, defender_region_id: 'str | None' = None, war_id: 'str | None' = None, country_id: 'str | None' = None, auto_items: 'bool' = False, max_pages: 'int | float' = inf, cursor_end: 'str | None' = None) -> 'CursorPage[Battle] | AsyncIterator[Battle]'| Name | Type | Default |
|---|---|---|
is_active |
`bool | None` |
limit |
int |
10 |
cursor |
`str | None` |
direction |
`BattleDirection | str |
filter |
`BattleFilter | str |
defender_region_id |
`str | None` |
war_id |
`str | None` |
country_id |
`str | None` |
auto_items |
bool |
False |
max_pages |
`int | float` |
cursor_end |
`str | None` |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
`string | null` | No |
__v |
`integer | null` | No |
war |
`string | null` | No |
region |
`string | null` | No |
attacker_country_id |
`string | null` | No |
defender_country_id |
`string | null` | No |
attacker |
`BattleSide | null` | No |
defender |
`BattleSide | null` | No |
attackerScore |
`number | null` | No |
defenderScore |
`number | null` | No |
isActive |
`boolean | null` | No |
isSystemResistance |
`boolean | null` | No |
isBigBattle |
`boolean | null` | No |
winner_country |
`string | null` | No |
startTime |
`string | null` | No |
endTime |
`string | null` | No |
currentRound |
`string | integer | object |
rounds |
`array | null` | No |
roundsHistory |
`array | null` | No |
roundsToWin |
`integer | null` | No |
totalRounds |
`integer | null` | No |
type |
`string | null` | No |
stats |
`BattleStats | null` | No |
createdAt |
`string | null` | No |
updatedAt |
`string | null` | No |
Per-side summary (attacker/defender) of a battle.
| Field | Type | Required | Description |
|---|---|---|---|
_id |
`string | null` | No |
__v |
`integer | null` | No |
country |
`string | null` | No |
region |
`string | null` | No |
damages |
`number | null` | No |
hitCount |
`integer | null` | No |
wonRoundsCount |
`integer | null` | No |
countryOrders |
`array | null` | No |
muOrders |
`array | null` | No |
moneyPool |
`number | null` | No |
moneyPer1kDamages |
`number | null` | No |
bountyEffectiveAt |
`string | null` | No |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
`string | null` | No |
__v |
`integer | null` | No |
hitCount |
`integer | null` | No |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
`string | null` | No |
__v |
`integer | null` | No |
items |
array |
Yes | |
nextCursor |
`string | null` | No |
hasMore |
boolean |
No |
Clear the SWR cache for all resources.
await client.battle.invalidate_cache() -> 'None'- action_log
- alliance
- article
- battle
- battle_loot_summary
- battle_order
- battle_ranking
- company
- country
- donation
- election
- event
- game_config
- game_stat
- government
- inventory
- item_trading
- mercenary_contract_auction
- mu
- mu_member
- party
- ranking
- region
- round
- search
- tournament
- transaction
- upgrade
- user
- work
- work_offer
- worker