API Reference / Steam accounts
Count a Steam account's connection events
Count an active Steam account's connection events under the ListAccountSessionEvents filter, for a figure such as the number of disconnects in the last day.
/ steam. v1. Steam/ CountAccountSessionEventsRequest body
application/jsonRequired
Request to count an account's session events under the ListAccountSessionEvents filter.
accountNamestringActive Steam account in the authorized workspace.
filter?AccountSessionEventFilterThe same filters as ListAccountSessionEvents.
Show attributes
occurredBefore?stringExclusive upper bound on occurred_at.
Format"date-time"
occurredFrom?stringInclusive lower bound on occurred_at.
Format"date-time"
reasons?array<string>Reasons to include, OR within the field. Empty includes every event, with or without a reason.
Value in"SESSION_"SESSION_"SESSION_"SESSION_"SESSION_"SESSION_"SESSION_"SESSION_"SESSION_"SESSION_
types?array<string>Event types to include, OR within the field. Empty includes every type.
Value in"ACCOUNT_"ACCOUNT_"ACCOUNT_"ACCOUNT_"ACCOUNT_"ACCOUNT_
Response body
application/json
Success
count?stringMatching events within the 30 days kept.
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
The requested resource does not exist in 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/CountAccountSessionEvents" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"accountName": "flip_eu_02",
"filter": {
"occurredBefore": "2026-11-03T16:10:00Z",
"occurredFrom": "2026-11-03T16:10:00Z",
"reasons": [
"SESSION_ERROR_REASON_PROXY_NOT_ASSIGNED"
],
"types": [
"ACCOUNT_SESSION_EVENT_TYPE_CONNECTED"
]
}
}'const res = await fetch("https://api.goldmine.to/steam.v1.Steam/CountAccountSessionEvents", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"accountName": "flip_eu_02",
"filter": {
"occurredBefore": "2026-11-03T16:10:00Z",
"occurredFrom": "2026-11-03T16:10:00Z",
"reasons": [
"SESSION_ERROR_REASON_PROXY_NOT_ASSIGNED"
],
"types": [
"ACCOUNT_SESSION_EVENT_TYPE_CONNECTED"
]
}
}),
});
const data = await res.json();body := strings.NewReader(`{
"accountName": "flip_eu_02",
"filter": {
"occurredBefore": "2026-11-03T16:10:00Z",
"occurredFrom": "2026-11-03T16:10:00Z",
"reasons": [
"SESSION_ERROR_REASON_PROXY_NOT_ASSIGNED"
],
"types": [
"ACCOUNT_SESSION_EVENT_TYPE_CONNECTED"
]
}
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/steam.v1.Steam/CountAccountSessionEvents", 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/CountAccountSessionEvents",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"accountName": "flip_eu_02",
"filter": {
"occurredBefore": "2026-11-03T16:10:00Z",
"occurredFrom": "2026-11-03T16:10:00Z",
"reasons": [
"SESSION_ERROR_REASON_PROXY_NOT_ASSIGNED"
],
"types": [
"ACCOUNT_SESSION_EVENT_TYPE_CONNECTED"
]
}
},
)
data = res.json(){
"count": "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": "not_found",
"message": "The requested resource does not exist in this workspace."
}{
"code": "internal",
"message": "An internal server error occurred."
}