API Reference / Filter sets
Count filter sets in a workspace
Returns the number of filter sets in the workspace, so a list page can render a count without loading and counting every row.
/ contracts. v1. Contracts/ CountFilterSetsRequest body
application/jsonRequired
Request for the number of filter sets in the caller's workspace matching a filter.
filter?FilterSetFilterThe same filter as ListFilterSets. Absent counts all live filter sets in the caller's workspace.
Show attributes
inUse?booleanTrue keeps only filter sets referenced by the predicate of at least one live contract or other live filter set in the workspace. False keeps only unreferenced ones. Omitted includes both. The same reference walk GetFilterSetReferrers reports.
query?stringLiteral case-insensitive substring to match against the name, the description or the filter set's own rule values: weapon, paint, collection, rarity, weapon type, category and item name values written in its predicate. Values a filter set only reaches through a referenced filter set are not searched. Omitted or empty matches all filter sets.
Response body
application/json
Success
count?integerNumber of live filter sets matching the query in the caller's workspace.
Format"int32"
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/CountFilterSets" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'const res = await fetch("https://api.goldmine.to/contracts.v1.Contracts/CountFilterSets", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
const data = await res.json();body := strings.NewReader(`{}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/contracts.v1.Contracts/CountFilterSets", 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/CountFilterSets",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={},
)
data = res.json(){
"count": 3
}{
"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."
}