-
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* |
Get full battle info by ID.
await client.battle.get(battle_id: 'str') -> 'Battle'| Name | Type | Default |
|---|---|---|
battle_id |
str |
*Required* |
Convenience: fetch all active battles across the globe.
await client.battle.get_active(**kwargs: 'Any') -> 'list[Battle]'| Name | Type | Default |
|---|---|---|
kwargs |
Any |
*Required* |
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` |
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` |
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