Skip to content

API Reference / Trade offers

Count trade offers per account and direction

Count the workspace's trade offers under the ListTradeOffers filter per account or per direction, each field counted with every other filter applied but not its own.

POST/steam.v1.Steam/GetTradeOfferFacetCounts

Request body

application/jsonRequired

Request for the per value counts of trade offer facet fields under the same filter as ListTradeOffers, so a filter flyout shows how many offers each option would select.

fields?array<string>

The facet fields to count, at most 3.

Value in"TRADE_OFFER_FACET_FIELD_ACCOUNT_NAME""TRADE_OFFER_FACET_FIELD_DIRECTION""TRADE_OFFER_FACET_FIELD_ORIGIN_KIND"

filter?TradeOfferFilter

The same filter as ListTradeOffers. Each facet is counted with every other field applied but not its own.

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

facets?array<TradeOfferFacetCounts>

One breakdown per requested field, in request order.

Show attributes
counts?FacetFieldCounts

The values ordered by count descending then value, at most 50, with truncated set when more exist.

Show attributes
truncated?boolean

True when the field has more than 50 values, so the list shows only the 50 most common.

values?array<FacetValueCount>

The values and their counts, ordered by count descending then by value, at most 50.

Show attributes
count?string

Number of rows carrying the value under the facet's predicate. Returned as a JSON string to preserve integer precision.

Format"int64"

value?string

The value as the list rows carry it: an enum name, a base64 id or an account name, so a client maps it to a label exactly as it maps a row.

field?string

The facet field these counts are for.

Value in"TRADE_OFFER_FACET_FIELD_ACCOUNT_NAME""TRADE_OFFER_FACET_FIELD_DIRECTION""TRADE_OFFER_FACET_FIELD_ORIGIN_KIND"

curl -X POST "https://api.goldmine.to/steam.v1.Steam/GetTradeOfferFacetCounts" \
  -H "Authorization: Bearer $CSTRADER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fields": [
      "TRADE_OFFER_FACET_FIELD_ACCOUNT_NAME"
    ],
    "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"
      ]
    }
  }'
{
  "facets": [
    {
      "counts": {
        "truncated": false,
        "values": []
      },
      "field": "TRADE_OFFER_FACET_FIELD_ACCOUNT_NAME"
    }
  ]
}