API Reference / Proxy usage
Get proxy usage totals
Returns the total proxy traffic of your workspace over an inclusive range of up to 366 UTC days: requests, failed requests and bytes in each direction, one entry for each day, and breakdowns by pool and by exit country. It can be narrowed to one pool or one country.
/ proxies. v1. Proxies/ GetProxyUsageTotalsRequest body
application/jsonRequired
Request for the total proxy usage of the caller's workspace over a range of UTC days, with a series for each day and breakdowns by pool and by country, optionally narrowed to one pool or one country.
country?stringUpper-case ISO 3166-1 alpha-2 exit country to sum only traffic through endpoints in it. Absent includes every country.
endDatestringLast UTC day of the range, inclusive, as YYYY-MM-DD. Required, not before start_date, and at most 366 days after it.
Format"date-time"
poolId?stringOpaque 16-byte identifier of a pool, base64-encoded in JSON, to sum only its traffic. Absent includes every pool.
Format"byte" base64
startDatestringFirst UTC day of the range, inclusive, as YYYY-MM-DD. Required.
Format"date-time"
Response body
application/json
Success
countries?array<ProxyUsageCountry>One entry for each exit country with traffic in the range, ordered by bytes in and out descending, then country.
Show attributes
country?stringExit country as an upper-case ISO 3166-1 alpha-2 code. Empty for traffic through endpoints whose country is not known.
totals?ProxyUsageTotalsThe country's traffic over the range.
Show attributes
bytesIn?stringBytes received through the proxy.
Format"int64"
bytesOut?stringBytes sent through the proxy.
Format"int64"
errorCount?stringNumber of those requests that failed. Part of request_count.
Format"int64"
requestCount?stringNumber of requests and raw connections made.
Format"int64"
daily?array<ProxyUsageDay>One entry for every UTC day of the range, in date order, including days with no traffic.
Show attributes
totals?ProxyUsageTotalsThe day's traffic. Zero on a day with none.
Show attributes
bytesIn?stringBytes received through the proxy.
Format"int64"
bytesOut?stringBytes sent through the proxy.
Format"int64"
errorCount?stringNumber of those requests that failed. Part of request_count.
Format"int64"
requestCount?stringNumber of requests and raw connections made.
Format"int64"
usageDate?stringThe UTC day, as YYYY-MM-DD.
Format"date-time"
pools?array<ProxyUsagePool>One entry for each pool with traffic in the range, ordered by bytes in and out descending, then pool id.
Show attributes
poolId?stringOpaque 16-byte identifier of the pool, base64-encoded in JSON.
Format"byte" base64
totals?ProxyUsageTotalsThe pool's traffic over the range.
Show attributes
bytesIn?stringBytes received through the proxy.
Format"int64"
bytesOut?stringBytes sent through the proxy.
Format"int64"
errorCount?stringNumber of those requests that failed. Part of request_count.
Format"int64"
requestCount?stringNumber of requests and raw connections made.
Format"int64"
totals?ProxyUsageTotalsTraffic over the whole range.
Show attributes
bytesIn?stringBytes received through the proxy.
Format"int64"
bytesOut?stringBytes sent through the proxy.
Format"int64"
errorCount?stringNumber of those requests that failed. Part of request_count.
Format"int64"
requestCount?stringNumber of requests and raw connections made.
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 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.
application/json
The service is temporarily unavailable. Retry with backoff.
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/proxies.v1.Proxies/GetProxyUsageTotals" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"startDate": "2026-11-10",
"endDate": "2026-11-11"
}'const res = await fetch("https://api.goldmine.to/proxies.v1.Proxies/GetProxyUsageTotals", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"startDate": "2026-11-10",
"endDate": "2026-11-11"
}),
});
const data = await res.json();body := strings.NewReader(`{
"startDate": "2026-11-10",
"endDate": "2026-11-11"
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/proxies.v1.Proxies/GetProxyUsageTotals", 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/proxies.v1.Proxies/GetProxyUsageTotals",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"startDate": "2026-11-10",
"endDate": "2026-11-11"
},
)
data = res.json(){
"totals": {
"requestCount": "1500",
"errorCount": "12",
"bytesOut": "5242880",
"bytesIn": "104857600"
},
"daily": [
{
"usageDate": "2026-11-10",
"totals": {
"requestCount": "1500",
"errorCount": "12",
"bytesOut": "5242880",
"bytesIn": "104857600"
}
},
{
"usageDate": "2026-11-11",
"totals": {}
}
],
"pools": [
{
"poolId": "AY+MISIifMyN3T09PT09PQ==",
"totals": {
"requestCount": "1500",
"errorCount": "12",
"bytesOut": "5242880",
"bytesIn": "104857600"
}
}
],
"countries": [
{
"country": "US",
"totals": {
"requestCount": "1500",
"errorCount": "12",
"bytesOut": "5242880",
"bytesIn": "104857600"
}
}
]
}{
"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."
}{
"code": "unavailable",
"message": "The service is temporarily unavailable. Retry with backoff."
}