API Reference / Intents
Count this workspace's intent rollup for a side
Returns how many rows, one per item and float window, the workspace's own buying or selling rollup has under the same filter as ListWorkspaceIntentRollup, so a tab shows its total without paging.
/ contracts. v1. Contracts/ CountWorkspaceIntentRollupRequest body
application/jsonRequired
Request for the number of the caller's workspace's combined buying or selling targets matching a filter, the total behind a ListWorkspaceIntentRollup tab.
filter?WorkspaceIntentRollupFilterThe same filter as ListWorkspaceIntentRollup. Absent counts every row of the side.
Show attributes
atHoldLimit?booleanRequires contract_id. True keeps only rows whose owned_count has reached that contract's max owned per item. False keeps the rest. A contract without that limit has no row at it. Omitted includes both.
boughtNothing?booleanTrue keeps only rows whose purchases_7d_count is zero. False keeps only rows with at least one such purchase. Omitted includes both.
cheapestSeen?stringOnly rows whose cheapest listing seen in the last 24 hours stands this way against the max price. Buying side only. Omitted includes every row.
Value in"WORKSPACE_"WORKSPACE_"WORKSPACE_"WORKSPACE_
contractId?stringOnly rows one of whose contributing active intents belongs to this contract of the caller's workspace. Absent does not restrict.
Format"byte" base64
hasStock?booleanTrue keeps only rows whose held_count is above zero. False keeps only rows with nothing held. Omitted includes both.
marketHashNames?array<string>Exact market_hash_name set, OR within the field, so one read prices a page of catalog items. Empty includes every item. At most 200 names, each nonempty.
query?stringOptional case-insensitive substring, matched server side against the row's market_hash_name or against the name of any of this workspace's contracts contributing an active intent to the row. Absent or empty returns every row.
selections?array<ItemCategorySelection>Only rows whose item is in one of these catalog categories, each narrowed by weapon type for skins, OR within the field. At most 20, under the catalog filter's own rules. Empty includes every row.
Show attributes
category?stringThe catalog category.
Value in"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_
weaponTypes?array<string>Weapon types inside the category, as the catalog names them (rifle, sniper, pistol, smg, heavy), any of them. Empty selects the whole category.
sidestringWhich intent direction to count: BUYING or SELLING. Required.
Value in"CONTRACT_"CONTRACT_
Response body
application/json
Success
categories?array<WorkspaceIntentRollupCategoryCount>The catalog categories of the rows matching every part of the filter but selections, each with its row count, so a category filter offers only what the workspace has. Ordered by category, then weapon type.
Show attributes
category?stringThe catalog category.
Value in"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_"ITEM_
count?integerThe number of targets.
Format"int32"
weaponType?stringThe weapon type inside the category, as the catalog names it. Unset for a category with no weapon type.
count?integerNumber of rows, one per item and float window, ListWorkspaceIntentRollup returns for the same side and filter.
Format"int32"
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/CountWorkspaceIntentRollup" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"side": "CONTRACT_TYPE_SELLING",
"filter": {
"hasStock": true
}
}'const res = await fetch("https://api.goldmine.to/contracts.v1.Contracts/CountWorkspaceIntentRollup", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"side": "CONTRACT_TYPE_SELLING",
"filter": {
"hasStock": true
}
}),
});
const data = await res.json();body := strings.NewReader(`{
"side": "CONTRACT_TYPE_SELLING",
"filter": {
"hasStock": true
}
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/contracts.v1.Contracts/CountWorkspaceIntentRollup", 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/CountWorkspaceIntentRollup",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"side": "CONTRACT_TYPE_SELLING",
"filter": {
"hasStock": true
}
},
)
data = res.json(){
"count": 12
}{
"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."
}