API Reference / Inventory
Count inventory items per status in a workspace
Returns the number of inventory items in each status for the workspace under the same InventoryItemFilter as ListInventoryItems, with the item count and summed buy price of the whole filtered set. Drives the inventory list page status-tab counts and totals without loading every item.
/ contracts. v1. Contracts/ CountInventoryItemsRequest body
application/jsonRequired
Request for the number of inventory items in each status in the caller's workspace, using the same filter as ListInventoryItems.
filter?InventoryItemFilterThe same filter as ListInventoryItems, so status counts match the filtered list.
Show attributes
accountGroupIds?array<string>Items held by an account that is a member of one of these account groups of the workspace, OR within the field, compared as ListInventoryItemGroups groups them. A deleted group selects nothing. Empty includes every item. At most 200 ids.
accountNames?array<string>Exact Steam account names holding the item, OR within the field. Empty includes every account. At most 200 names, each nonempty.
acquiredBefore?stringOnly items that reached the Steam inventory before this time. Absent sets no upper bound.
Format"date-time"
acquiredFrom?stringOnly items that reached the Steam inventory at or after this time. An item still arriving has no acquired_at and never matches a bound. Absent sets no lower bound.
Format"date-time"
contractId?stringOnly items attributed to this buying contract, the one that bought them.
Format"byte" base64
coveringSellingContractIds?array<string>Held items (arriving, in the inventory or listed) whose covering selling contract, resolved now exactly as GetCoveringSellingContract resolves it (Sell from account groups honoured), is one of these, OR within the field. Items that left never match. Empty includes every item. At most 200 ids.
currentAssetIds?array<string>Exact current Steam asset ids, OR within the field, matching current_asset_id, so a page of Steam inventory tiles resolves what each item cost in one call. A tile with no match was not bought through the platform. Empty includes every item. At most 200 ids, each nonempty.
hasCoveringSellingContract?booleanTrue selects only held items (arriving, in the inventory or listed) a selling contract covers now, as GetCoveringSellingContract resolves it. False selects only held items none covers, the items nothing will list. Items that left never match either value. Omitted includes every item.
listingContractIds?array<string>Listing contracts, OR within the field: the selling contract pricing the item's newest listing (listing_contract_id). An item never listed, or listed with no contract, never matches. Combine with the LISTED status for what a contract has listed now. Empty includes every item. At most 200 ids.
listingMarketplaces?array<string>Listing marketplaces, OR within the field: the marketplace of the item's newest listing (listing_marketplace), salespanel for the listing. An item never listed never matches. Combine with the LISTED status for what is listed there now. Empty includes every item. At most 50 values, each nonempty.
marketHashNames?array<string>Exact market_hash_name set, OR within the field, for an item's own holdings. Empty includes every item.
paintSeeds?array<integer>Exact paint seeds (pattern indexes, 0 to 1000), OR within the field. An item with no known seed never matches. Empty includes every item. At most 200 seeds.
purchaseIds?array<string>Only the items produced by these purchases, OR within the field. A purchase resolves to at most one inventory item, so a purchases page resolves its page of items in one call, and a purchase detail page resolves the real inventory_item_id before calling ListAssetIDLinks. Empty includes every purchase.
purchaseStrategies?array<string>Buying mechanisms of the purchase that produced the item, OR within the field. Empty includes every strategy.
Value in"PURCHASE_"PURCHASE_"PURCHASE_"PURCHASE_
query?stringCase-insensitive literal substring of the item's market_hash_name or of the Steam account name holding it, or the item's full id in its canonical text form. Not a regular expression or wildcard pattern. Absent or empty matches every item.
sellable?booleanTrue selects only items outside Valve's post-trade hold: tradable rows whose tradable_after is absent or no longer in the future. False selects only held or untradable items. Omitted includes both. Every selling market service sets true, so the hold logic lives in contracts once and no market offers an undeliverable held item.
sellingContractIds?array<string>Selling contracts, OR within the field: the contract that sold the item (selling_contract_id). An item not sold, or sold with no contract, never matches. Empty includes every item. At most 200 ids.
sellingMarketplaces?array<string>Selling marketplaces, OR within the field: the marketplace that sold the item (selling_marketplace). An item not sold, or sold with no market named, never matches. Empty includes every item. At most 50 values, each nonempty.
soldBefore?stringOnly items sold before this time, exclusive, with the same sale time as sold_from. Absent sets no upper bound.
Format"date-time"
soldFrom?stringOnly items sold at or after this time. Sale time is sold_at, or updated_at for a legacy sold row with none, the same time the SOLD_AT order uses. Only sold items ever match a bound. Absent sets no lower bound.
Format"date-time"
statusValues?array<string>Status set, OR within the field, including TRADE_HOLD for a held item and NOT_DELIVERED or ARRIVING for a pending trade past or within its delivery deadline. Empty includes every status. Unlike the list's statuses, this is part of the shared filter, so counts, groups and facets take it too.
Value in"INVENTORY_"INVENTORY_"INVENTORY_"INVENTORY_"INVENTORY_"INVENTORY_"INVENTORY_"INVENTORY_
tradableAfterBefore?stringOnly items whose post-trade hold lifts before this time, exclusive. An item with no recorded hold is excluded. With a lower bound of now this lists the items coming off hold soonest.
Format"date-time"
Response body
application/json
Success
counts?array<InventoryItemStatusCount>Count of inventory items in each status, scoped to the workspace and the filter. Status is the grouping dimension, so the request carries no statuses of its own. The filter's status_values still apply, as they do to the list. A status with no items may be omitted.
Show attributes
count?integerNumber of inventory items in this status.
Format"int32"
status?stringThe inventory item status this count is for.
Value in"INVENTORY_"INVENTORY_"INVENTORY_"INVENTORY_"INVENTORY_
itemCount?stringNumber of inventory items matching the filter across every status, the sum of counts. Returned as a JSON string to preserve integer precision.
Format"int64"
totalBuyPriceCents?stringSum of buy_price_cents over the items matching the filter across every status, in cents, so a toolbar total always matches the filtered rows.
Format"int64"
totalBuyPriceMicros?stringSum of buy_price_micros over the items matching the filter across every status, in millionths of a dollar. Exact to the millionth of a dollar, so a purchase charged a fraction of a cent counts at what it cost. The _cents figure beside it sums prices rounded up to a cent and is kept for limits.
Format"int64"
totalListPriceCents?stringSum of list_price_cents over the items matching the filter across every status, in cents. An item never listed adds nothing. With the LISTED status it is the total at list price of what is listed now.
Format"int64"
application/json
The request was malformed, such as a missing required field or an unparseable cursor.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
The request lacks a valid API key in the Authorization header.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
The API key is not allowed to perform this action on this workspace.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
The request was rate limited. Slow down and retry later.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
application/json
An internal server error occurred.
codestringThe Connect error code, such as "not_found".
details?array<object>Optional machine-readable error details.
messagestringA human-readable description of the error.
curl -X POST "https://api.goldmine.to/contracts.v1.Contracts/CountInventoryItems" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'const res = await fetch("https://api.goldmine.to/contracts.v1.Contracts/CountInventoryItems", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
const data = await res.json();body := strings.NewReader(`{}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/contracts.v1.Contracts/CountInventoryItems", body)
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CSTRADER_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)import os, requests
res = requests.post(
"https://api.goldmine.to/contracts.v1.Contracts/CountInventoryItems",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={},
)
data = res.json(){
"counts": [
{
"status": "INVENTORY_ITEM_STATUS_IN_INVENTORY",
"count": 12
},
{
"status": "INVENTORY_ITEM_STATUS_LISTED",
"count": 3
}
]
}{
"code": "invalid_argument",
"message": "The request was malformed, such as a missing required field or an unparseable cursor."
}{
"code": "unauthenticated",
"message": "The request lacks a valid API key in the Authorization header."
}{
"code": "permission_denied",
"message": "The API key is not allowed to perform this action on this workspace."
}{
"code": "resource_exhausted",
"message": "The request was rate limited. Slow down and retry later."
}{
"code": "internal",
"message": "An internal server error occurred."
}curl -X POST "https://api.goldmine.to/contracts.v1.Contracts/CountInventoryItems" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'const res = await fetch("https://api.goldmine.to/contracts.v1.Contracts/CountInventoryItems", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
const data = await res.json();body := strings.NewReader(`{}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/contracts.v1.Contracts/CountInventoryItems", body)
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CSTRADER_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)import os, requests
res = requests.post(
"https://api.goldmine.to/contracts.v1.Contracts/CountInventoryItems",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={},
)
data = res.json(){}{
"code": "invalid_argument",
"message": "The request was malformed, such as a missing required field or an unparseable cursor."
}{
"code": "unauthenticated",
"message": "The request lacks a valid API key in the Authorization header."
}{
"code": "permission_denied",
"message": "The API key is not allowed to perform this action on this workspace."
}{
"code": "resource_exhausted",
"message": "The request was rate limited. Slow down and retry later."
}{
"code": "internal",
"message": "An internal server error occurred."
}curl -X POST "https://api.goldmine.to/contracts.v1.Contracts/CountInventoryItems" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filter": {
"contractId": "EBESExQVFhcYGRobHB0eHw=="
}
}'const res = await fetch("https://api.goldmine.to/contracts.v1.Contracts/CountInventoryItems", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"filter": {
"contractId": "EBESExQVFhcYGRobHB0eHw=="
}
}),
});
const data = await res.json();body := strings.NewReader(`{
"filter": {
"contractId": "EBESExQVFhcYGRobHB0eHw=="
}
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/contracts.v1.Contracts/CountInventoryItems", body)
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("CSTRADER_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)import os, requests
res = requests.post(
"https://api.goldmine.to/contracts.v1.Contracts/CountInventoryItems",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"filter": {
"contractId": "EBESExQVFhcYGRobHB0eHw=="
}
},
)
data = res.json(){
"counts": [
{
"status": "INVENTORY_ITEM_STATUS_SOLD",
"count": 5
}
]
}{
"code": "invalid_argument",
"message": "The request was malformed, such as a missing required field or an unparseable cursor."
}{
"code": "unauthenticated",
"message": "The request lacks a valid API key in the Authorization header."
}{
"code": "permission_denied",
"message": "The API key is not allowed to perform this action on this workspace."
}{
"code": "resource_exhausted",
"message": "The request was rate limited. Slow down and retry later."
}{
"code": "internal",
"message": "An internal server error occurred."
}