API Reference / Proxy usage
Get a proxy connection's traffic
Returns one raw connection's byte counts as it reported them: every five minutes while it was open and once when it closed.
/ analytics. v1. Analytics/ GetProxyConnectionTrafficRequest body
application/jsonRequired
Request for one connection's byte counts as they were reported, every five minutes while it was open and once when it closed.
connectionIdstringOpaque 16-byte identifier of the connection (ProxyConnectionDetail.connection_id), base64-encoded in JSON.
Format"byte" base64
openedAtstringstarted_at of the connection's row in ListProxyRequests, which bounds the read. At most 7 days ago.
Format"date-time"
Response body
application/json
Success
intervals?array<ProxyConnectionInterval>The intervals in time order. Empty for an unknown connection.
Show attributes
bytesIn?stringBytes received in the interval.
Format"int64"
bytesOut?stringBytes sent in the interval.
Format"int64"
closed?booleanTrue on the interval that ended with the close.
length?stringHow long the interval lasted, five minutes except the last.
startedAt?stringStart of the interval.
Format"date-time"
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/analytics.v1.Analytics/GetProxyConnectionTraffic" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"connectionId": "AZp9b3Hjd2yNSxkZmKqZ6Q==",
"openedAt": "2026-11-12T17:45:38Z"
}'const res = await fetch("https://api.goldmine.to/analytics.v1.Analytics/GetProxyConnectionTraffic", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"connectionId": "AZp9b3Hjd2yNSxkZmKqZ6Q==",
"openedAt": "2026-11-12T17:45:38Z"
}),
});
const data = await res.json();body := strings.NewReader(`{
"connectionId": "AZp9b3Hjd2yNSxkZmKqZ6Q==",
"openedAt": "2026-11-12T17:45:38Z"
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/analytics.v1.Analytics/GetProxyConnectionTraffic", 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/analytics.v1.Analytics/GetProxyConnectionTraffic",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"connectionId": "AZp9b3Hjd2yNSxkZmKqZ6Q==",
"openedAt": "2026-11-12T17:45:38Z"
},
)
data = res.json(){
"intervals": [
{
"startedAt": "2026-11-12T17:45:38Z",
"length": "300s",
"bytesOut": "3100",
"bytesIn": "18200"
},
{
"startedAt": "2026-11-12T17:50:38Z",
"length": "41s",
"bytesOut": "900",
"bytesIn": "4000",
"closed": true
}
]
}{
"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."
}