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.
/ steam. v1. Steam/ GetTradeOfferFacetCountsRequest 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_"TRADE_"TRADE_
filter?TradeOfferFilterThe 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?booleanTrue 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_"CONFIRMATION_"CONFIRMATION_"CONFIRMATION_
direction?stringOnly offers the account sent, or only offers it received. Absent includes both.
Value in"TRADE_"TRADE_
expiresBefore?stringOnly 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_"TRADE_"TRADE_
query?stringOptional 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?FacetFieldCountsThe values ordered by count descending then value, at most 50, with truncated set when more exist.
Show attributes
truncated?booleanTrue 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?stringNumber of rows carrying the value under the facet's predicate. Returned as a JSON string to preserve integer precision.
Format"int64"
value?stringThe 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?stringThe facet field these counts are for.
Value in"TRADE_"TRADE_"TRADE_
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
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/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"
]
}
}'const res = await fetch("https://api.goldmine.to/steam.v1.Steam/GetTradeOfferFacetCounts", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"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"
]
}
}),
});
const data = await res.json();body := strings.NewReader(`{
"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"
]
}
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/steam.v1.Steam/GetTradeOfferFacetCounts", 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/steam.v1.Steam/GetTradeOfferFacetCounts",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"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"
]
}
},
)
data = res.json(){
"facets": [
{
"counts": {
"truncated": false,
"values": []
},
"field": "TRADE_OFFER_FACET_FIELD_ACCOUNT_NAME"
}
]
}{
"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": "internal",
"message": "An internal server error occurred."
}