-
Notifications
You must be signed in to change notification settings - Fork 2
Resource UserResource
CrucifiedPain edited this page Jun 26, 2026
·
11 revisions
Endpoints: • user.getUserById • user.getUserLite • user.getUsersByCountry (cursor-paginated)
Fetch every user from every country concurrently using auto pagination.
This is the fastest way to retrieve all users in the game. It:
- Fetches all country IDs via
country.getAllCountries. - Concurrently paginates through users for all countries.
Args: concurrency: Max concurrent requests.
Returns:
A flat list of all :class:UserLite objects across every country.
await client.user.collect_all(*, concurrency: 'int' = 500) -> 'list[UserLite]'| Name | Type | Default |
|---|---|---|
concurrency |
int |
500 |
Return all users in a country as a flat list, fetched in parallel.
await client.user.collect_by_country(country_id: 'str', oldest_date: 'datetime | str | None' = None, time_slice_days: 'int' = 30, concurrency: 'int' = 500, **kwargs: 'Any') -> 'list[UserLite]'| Name | Type | Default |
|---|---|---|
country_id |
str |
*Required* |
oldest_date |
`datetime | str |
time_slice_days |
int |
30 |
concurrency |
int |
500 |
kwargs |
Any |
*Required* |
Get users belonging to a country (cursor-paginated).
await client.user.get_by_country(country_id: 'str', *, limit: 'int' = 10, cursor: 'str | None' = None, auto_items: 'bool' = False, max_pages: 'int | float' = inf, cursor_end: 'str | None' = None) -> 'CursorPage[UserLite] | AsyncIterator[UserLite]'| Name | Type | Default |
|---|---|---|
country_id |
str |
*Required* |
limit |
int |
10 |
cursor |
`str | None` |
auto_items |
bool |
False |
max_pages |
`int | float` |
cursor_end |
`str | None` |
Get a user's profile by ID.
await client.user.get_by_id(user_id: 'str') -> 'User'| Name | Type | Default |
|---|---|---|
user_id |
str |
*Required* |
Get a user's lite profile by ID. (Deprecated in favor of get_by_id)
await client.user.get_lite(user_id: 'str') -> 'UserLite'| Name | Type | Default |
|---|---|---|
user_id |
str |
*Required* |
Fetch multiple users by ID concurrently using the auto-batcher.
await client.user.get_many(user_ids: 'list[str]', *, concurrency: 'int' = 500) -> 'list[User | None]'| Name | Type | Default |
|---|---|---|
user_ids |
list[str] |
*Required* |
concurrency |
int |
500 |
Clear the SWR cache for all resources.
await client.user.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