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.
/ steam. v1. Steam/ CountTradeOffersRequest body
application/jsonRequired
Request for the number of the workspace's trade offers matching the same filter as ListTradeOffers, broken down by state.
filter?TradeOfferFilterThe 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?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
counts?array<TradeOfferStateCount>Count of matching offers in each state, ordered by state. A state with no offers is omitted.
Show attributes
count?stringNumber of matching offers in this state. Returned as a JSON string to preserve integer precision.
Format"int64"
state?stringSteam ETradeOfferState as its stored lowercase text.
total?stringNumber of matching offers across every state, the sum of counts. Returned as a JSON string to preserve integer precision.
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
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/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"
]
}
}'const res = await fetch("https://api.goldmine.to/steam.v1.Steam/CountTradeOffers", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"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(`{
"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/CountTradeOffers", 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/CountTradeOffers",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"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(){
"counts": [
{
"count": "3",
"state": "example"
}
],
"total": "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": "internal",
"message": "An internal server error occurred."
}