-
Notifications
You must be signed in to change notification settings - Fork 2
Resource CompanyResource
Endpoints: • company.getById • company.getCompanies (cursor-paginated, filter by userId) • company.getRecommendedRegionIdsByItemCode • company.getProductionBonus
Convenience: fetch all companies globally (or by country if passed) using parallel slicing. This is much faster than fetching sequentially.
await client.company.collect_all(oldest_date: 'datetime | str | None' = None, time_slice_days: 'int' = 30, concurrency: 'int' = 500, **kwargs: 'Any') -> 'list[Company]'| Name | Type | Default |
|---|---|---|
oldest_date |
datetime | str | None |
None |
time_slice_days |
int |
30 |
concurrency |
int |
500 |
kwargs |
Any |
*Required* |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ | |
name |
string \| null |
❌ | |
owner |
string \| null |
❌ | |
country |
string \| null |
❌ | |
region |
string \| null |
❌ | |
type |
string \| null |
❌ | |
quality |
integer \| null |
❌ | |
size |
integer \| null |
❌ | |
employees |
integer \| null |
❌ | |
production |
number \| null |
❌ | |
wealth |
number \| null |
❌ | |
image |
string \| null |
❌ | |
isHiring |
boolean \| null |
❌ | |
activeUpgradeLevels |
CompanyActiveUpgradeLevels \| null |
❌ | |
concreteInvested |
integer \| number \| null |
❌ | |
dates |
CompanyDates \| null |
❌ | |
estimatedValue |
integer \| number \| null |
❌ | |
isFull |
boolean \| null |
❌ | |
itemCode |
string \| null |
❌ | |
movedUpAt |
string \| null |
❌ | |
user |
string \| null |
❌ | |
workerCount |
integer \| null |
❌ | |
workers |
array[any] \| null |
❌ | |
createdAt |
string \| null |
❌ | |
updatedAt |
string \| null |
❌ |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ |
Fetch all companies owned by a list of users. Uses native tRPC batching to group up to 50 user queries per HTTP request, making it extremely fast and rate-limit friendly.
Args: user_ids: List of user ID strings to fetch companies for. concurrency: Max concurrent requests.
Returns:
A flat list of all :class:Company objects across every user.
await client.company.collect_by_users(user_ids: 'list[str]', *, concurrency: 'int' = 500) -> 'list[Company]'| Name | Type | Default |
|---|---|---|
user_ids |
list[str] |
*Required* |
concurrency |
int |
500 |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ | |
name |
string \| null |
❌ | |
owner |
string \| null |
❌ | |
country |
string \| null |
❌ | |
region |
string \| null |
❌ | |
type |
string \| null |
❌ | |
quality |
integer \| null |
❌ | |
size |
integer \| null |
❌ | |
employees |
integer \| null |
❌ | |
production |
number \| null |
❌ | |
wealth |
number \| null |
❌ | |
image |
string \| null |
❌ | |
isHiring |
boolean \| null |
❌ | |
activeUpgradeLevels |
CompanyActiveUpgradeLevels \| null |
❌ | |
concreteInvested |
integer \| number \| null |
❌ | |
dates |
CompanyDates \| null |
❌ | |
estimatedValue |
integer \| number \| null |
❌ | |
isFull |
boolean \| null |
❌ | |
itemCode |
string \| null |
❌ | |
movedUpAt |
string \| null |
❌ | |
user |
string \| null |
❌ | |
workerCount |
integer \| null |
❌ | |
workers |
array[any] \| null |
❌ | |
createdAt |
string \| null |
❌ | |
updatedAt |
string \| null |
❌ |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ |
Get a single company by ID.
await client.company.get(company_id: 'str') -> 'Company'| Name | Type | Default |
|---|---|---|
company_id |
str |
*Required* |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ | |
name |
string \| null |
❌ | |
owner |
string \| null |
❌ | |
country |
string \| null |
❌ | |
region |
string \| null |
❌ | |
type |
string \| null |
❌ | |
quality |
integer \| null |
❌ | |
size |
integer \| null |
❌ | |
employees |
integer \| null |
❌ | |
production |
number \| null |
❌ | |
wealth |
number \| null |
❌ | |
image |
string \| null |
❌ | |
isHiring |
boolean \| null |
❌ | |
activeUpgradeLevels |
CompanyActiveUpgradeLevels \| null |
❌ | |
concreteInvested |
integer \| number \| null |
❌ | |
dates |
CompanyDates \| null |
❌ | |
estimatedValue |
integer \| number \| null |
❌ | |
isFull |
boolean \| null |
❌ | |
itemCode |
string \| null |
❌ | |
movedUpAt |
string \| null |
❌ | |
user |
string \| null |
❌ | |
workerCount |
integer \| null |
❌ | |
workers |
array[any] \| null |
❌ | |
createdAt |
string \| null |
❌ | |
updatedAt |
string \| null |
❌ |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ |
Convenience: fetch all companies owned by a user (collects all pages).
await client.company.get_by_user(user_id: 'str', **kwargs: 'Any') -> 'list[Company]'| Name | Type | Default |
|---|---|---|
user_id |
str |
*Required* |
kwargs |
Any |
*Required* |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ | |
name |
string \| null |
❌ | |
owner |
string \| null |
❌ | |
country |
string \| null |
❌ | |
region |
string \| null |
❌ | |
type |
string \| null |
❌ | |
quality |
integer \| null |
❌ | |
size |
integer \| null |
❌ | |
employees |
integer \| null |
❌ | |
production |
number \| null |
❌ | |
wealth |
number \| null |
❌ | |
image |
string \| null |
❌ | |
isHiring |
boolean \| null |
❌ | |
activeUpgradeLevels |
CompanyActiveUpgradeLevels \| null |
❌ | |
concreteInvested |
integer \| number \| null |
❌ | |
dates |
CompanyDates \| null |
❌ | |
estimatedValue |
integer \| number \| null |
❌ | |
isFull |
boolean \| null |
❌ | |
itemCode |
string \| null |
❌ | |
movedUpAt |
string \| null |
❌ | |
user |
string \| null |
❌ | |
workerCount |
integer \| null |
❌ | |
workers |
array[any] \| null |
❌ | |
createdAt |
string \| null |
❌ | |
updatedAt |
string \| null |
❌ |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ |
Get companies, optionally filtered by owner user ID (cursor-paginated).
await client.company.get_companies(*, user_id: 'str | None' = None, per_page: 'int' = 10, cursor: 'str | None' = None, auto_items: 'bool' = False, max_pages: 'int | float' = inf, cursor_end: 'str | None' = None) -> 'CursorPage[Company] | AsyncIterator[Company]'| Name | Type | Default |
|---|---|---|
user_id |
str | None |
None |
per_page |
int |
10 |
cursor |
str | None |
None |
auto_items |
bool |
False |
max_pages |
int | float |
inf |
cursor_end |
str | None |
None |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ | |
name |
string \| null |
❌ | |
owner |
string \| null |
❌ | |
country |
string \| null |
❌ | |
region |
string \| null |
❌ | |
type |
string \| null |
❌ | |
quality |
integer \| null |
❌ | |
size |
integer \| null |
❌ | |
employees |
integer \| null |
❌ | |
production |
number \| null |
❌ | |
wealth |
number \| null |
❌ | |
image |
string \| null |
❌ | |
isHiring |
boolean \| null |
❌ | |
activeUpgradeLevels |
CompanyActiveUpgradeLevels \| null |
❌ | |
concreteInvested |
integer \| number \| null |
❌ | |
dates |
CompanyDates \| null |
❌ | |
estimatedValue |
integer \| number \| null |
❌ | |
isFull |
boolean \| null |
❌ | |
itemCode |
string \| null |
❌ | |
movedUpAt |
string \| null |
❌ | |
user |
string \| null |
❌ | |
workerCount |
integer \| null |
❌ | |
workers |
array[any] \| null |
❌ | |
createdAt |
string \| null |
❌ | |
updatedAt |
string \| null |
❌ |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ | |
items |
array[Company] |
✅ | |
nextCursor |
string \| null |
❌ | |
hasMore |
boolean |
❌ |
Fetch multiple companies by ID concurrently using the auto-batcher.
await client.company.get_many(company_ids: 'list[str]', *, concurrency: 'int' = 500) -> 'list[Company | None]'| Name | Type | Default |
|---|---|---|
company_ids |
list[str] |
*Required* |
concurrency |
int |
500 |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ | |
name |
string \| null |
❌ | |
owner |
string \| null |
❌ | |
country |
string \| null |
❌ | |
region |
string \| null |
❌ | |
type |
string \| null |
❌ | |
quality |
integer \| null |
❌ | |
size |
integer \| null |
❌ | |
employees |
integer \| null |
❌ | |
production |
number \| null |
❌ | |
wealth |
number \| null |
❌ | |
image |
string \| null |
❌ | |
isHiring |
boolean \| null |
❌ | |
activeUpgradeLevels |
CompanyActiveUpgradeLevels \| null |
❌ | |
concreteInvested |
integer \| number \| null |
❌ | |
dates |
CompanyDates \| null |
❌ | |
estimatedValue |
integer \| number \| null |
❌ | |
isFull |
boolean \| null |
❌ | |
itemCode |
string \| null |
❌ | |
movedUpAt |
string \| null |
❌ | |
user |
string \| null |
❌ | |
workerCount |
integer \| null |
❌ | |
workers |
array[any] \| null |
❌ | |
createdAt |
string \| null |
❌ | |
updatedAt |
string \| null |
❌ |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ |
| Field | Type | Required | Description |
|---|---|---|---|
_id |
string \| null |
❌ | |
__v |
integer \| null |
❌ |
Get the full production bonus breakdown for a company.
Returns a :class:CompanyProductionBonus with strategic_bonus,
deposit_bonus, ethic_specialization_bonus, ethic_deposit_bonus,
and total.
await client.company.get_production_bonus(company_id: 'str') -> 'CompanyProductionBonus'| Name | Type | Default |
|---|---|---|
company_id |
str |
*Required* |
Get recommended regions for producing a given item, ranked by total bonus.
Args:
item_code: Item code to check (e.g. "iron", "weapon_q1").
include_deposit: Whether to include deposit bonuses in the ranking.
Returns:
A list of :class:RecommendedRegion objects sorted by bonus (best first).
await client.company.get_recommended_regions(item_code: 'str', *, include_deposit: 'bool' = True) -> 'list[RecommendedRegion]'| Name | Type | Default |
|---|---|---|
item_code |
str |
*Required* |
include_deposit |
bool |
True |
Clear the SWR cache for all resources.
await client.company.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