Skip to content

API Reference / Trade offers

Count trade offers by state

Count the workspace's trade offers matching the same filter as ListTradeOffers, broken down by state, so a toolbar shows the open and total counts the list would page through.

POST/steam.v1.Steam/CountTradeOffers

Request body

application/jsonRequired

Request for the number of the workspace's trade offers matching the same filter as ListTradeOffers, broken down by state.

filter?TradeOfferFilter

The same filter as ListTradeOffers.

Show attributes
accountNames?array<string>

Only the trade offers of these workspace accounts, OR within the field. Empty lists every account's trade offers in the workspace. At most 200 names, each nonempty.

confirmationFailed?boolean

True keeps only offers whose latest confirmation is pending after a failed attempt to answer it (confirmation_failure_reason set). False keeps every other offer. Absent sets no condition. ANDed with confirmation_statuses.

confirmationStatuses?array<string>

Only offers whose latest mobile confirmation has one of these statuses, OR within the field. Empty matches every offer, including those with no confirmation.

Value in"CONFIRMATION_STATUS_PENDING""CONFIRMATION_STATUS_ACCEPTED""CONFIRMATION_STATUS_DECLINED""CONFIRMATION_STATUS_GONE"

direction?string

Only offers the account sent, or only offers it received. Absent includes both.

Value in"TRADE_OFFER_DIRECTION_SENT""TRADE_OFFER_DIRECTION_RECEIVED"

expiresBefore?string

Only offers whose expiry is before this time, exclusive. An offer with no recorded expiry never matches. Absent sets no bound.

Format"date-time"

originKinds?array<string>

Only offers with one of these origins, OR within the field. Empty matches every origin.

Value in"TRADE_OFFER_ORIGIN_KIND_MANUAL""TRADE_OFFER_ORIGIN_KIND_PURCHASE_DELIVERY""TRADE_OFFER_ORIGIN_KIND_SALE_DELIVERY"

query?string

Optional literal case-insensitive search across item market hash names on either side, offer id and partner Steam id. Absent or empty matches every offer.

states?array<string>

Optional Steam ETradeOfferState set, as stored lowercase text, OR within the field. Empty returns every state.

Response body

application/json

Success

counts?array<TradeOfferStateCount>

Count of matching offers in each state, ordered by state. A state with no offers is omitted.

Show attributes
count?string

Number of matching offers in this state. Returned as a JSON string to preserve integer precision.

Format"int64"

state?string

Steam ETradeOfferState as its stored lowercase text.

total?string

Number of matching offers across every state, the sum of counts. Returned as a JSON string to preserve integer precision.

Format"int64"

curl -X POST "https://api.goldmine.to/steam.v1.Steam/CountTradeOffers" \
  -H "Authorization: Bearer $CSTRADER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": {
      "accountNames": [
        "flip_eu_02"
      ],
      "confirmationFailed": false,
      "confirmationStatuses": [
        "CONFIRMATION_STATUS_PENDING"
      ],
      "direction": "TRADE_OFFER_DIRECTION_SENT",
      "expiresBefore": "2026-11-03T16:10:00Z",
      "originKinds": [
        "TRADE_OFFER_ORIGIN_KIND_MANUAL"
      ],
      "query": "example",
      "states": [
        "example"
      ]
    }
  }'
{
  "counts": [
    {
      "count": "3",
      "state": "example"
    }
  ],
  "total": "3"
}