ItemTradingResource (client.item_trading)¶
Endpoints: • itemTrading.getPrices • tradingOrder.getTopOrders • tradingOrder.getPublicOrdersByOwner • itemOffer.getById
.get_offer()¶
Get a specific item market offer by ID.
Signature¶
await client.item_trading.get_offer(item_offer_id: 'str') -> 'ItemOffer'
Parameters¶
| Name | Type | Default |
|---|---|---|
item_offer_id |
str |
Required |
Return Models¶
ItemOffer¶
| Field | Type | Required |
|---|---|---|
_id |
string |
Optional |
__v |
integer |
Optional |
itemCode |
string |
Optional |
price |
number |
Optional |
quantity |
integer |
Optional |
sellerId |
string |
Optional |
countryId |
string |
Optional |
regionId |
string |
Optional |
createdAt |
string |
Optional |
offerAt |
string |
Optional |
type |
string |
Optional |
user |
string |
Optional |
.get_price()¶
Client-side helper: get the price for a single item.
Signature¶
await client.item_trading.get_price(item_code: 'str') -> 'ItemPrice | None'
Parameters¶
| Name | Type | Default |
|---|---|---|
item_code |
str |
Required |
Return Models¶
ItemPrice¶
| Field | Type | Required |
|---|---|---|
_id |
string |
Optional |
__v |
integer |
Optional |
itemCode |
string |
Optional |
price |
number |
Optional |
quantity |
integer |
Optional |
countryId |
string |
Optional |
updatedAt |
string |
Optional |
.get_prices()¶
Get current market prices for all items. Returns a dict keyed by item code.
Signature¶
await client.item_trading.get_prices() -> 'dict[str, ItemPrice]'
Return Models¶
ItemPrice¶
| Field | Type | Required |
|---|---|---|
_id |
string |
Optional |
__v |
integer |
Optional |
itemCode |
string |
Optional |
price |
number |
Optional |
quantity |
integer |
Optional |
countryId |
string |
Optional |
updatedAt |
string |
Optional |
.get_public_orders_by_owner()¶
Get all public trading orders for a country's market, grouped by buy/sell and with aggregated statistics.
Args: country_id: The country whose public market orders to fetch.
Returns:
A :class:PublicOrdersSummary containing buy orders, sell orders,
combined orders, total invested currency, and per-item sell quantities.
Signature¶
await client.item_trading.get_public_orders_by_owner(country_id: 'str') -> 'PublicOrdersSummary'
Parameters¶
| Name | Type | Default |
|---|---|---|
country_id |
str |
Required |
.get_top_orders()¶
Get the best buy/sell orders for a given item.
Signature¶
await client.item_trading.get_top_orders(item_code: 'str', *, limit: 'int' = 10) -> 'list[TradingOrder]'
Parameters¶
| Name | Type | Default |
|---|---|---|
item_code |
str |
Required |
limit |
int |
10 |
Return Models¶
TradingOrder¶
| Field | Type | Required |
|---|---|---|
_id |
string |
Optional |
__v |
integer |
Optional |
itemCode |
string |
Optional |
price |
number |
Optional |
quantity |
integer |
Optional |
orderType |
string |
Optional |
country |
string |
Optional |
countryId |
string |
Optional |
userId |
string |
Optional |
createdAt |
string |
Optional |
expiresAt |
string |
Optional |
offerAt |
string |
Optional |
type |
string |
Optional |
user |
string |
Optional |
.invalidate_cache()¶
Clear the SWR cache for all resources.
Signature¶
await client.item_trading.invalidate_cache() -> 'None'