API Reference / Pricing
Value a list of items the way a contract would
Prices up to 500 items with a valuation, using the same engine and reference prices a contract evaluation uses, so a trade offer is valued exactly as a contract would value it. Items the valuation cannot price are listed rather than dropped.
/ analytics. v1. Analytics/ GetItemValuationsRequest body
application/jsonRequired
Request to value a list of items with a valuation.
marketHashNames?array<string>Exact market hash names, between 1 and 500. Duplicates are valued once.
valuation?ValuationHow to price each item: the workspace's valuation basis as one reference, or a contract's valuation.
Show attributes
references?array<ValuationReference>The price sources to combine, each a market data lookup or a sale computation.
Show attributes
adjustment?numberFraction applied to the resolved price, which is multiplied by one plus this value: -0.3 pays 30 percent under, 0.1 pays 10 percent over. From -1 to 10.
Format"double"
aggregationAggregationHow the selected sales combine into one price. Required for a sale computation and not allowed on a market data lookup.
Show attributes
average?AverageOptionsOptions for an average. Only used when type is average.
Show attributes
weighted?booleanTrue weights each sale by its quantity. False averages sale prices equally.
type?stringThe combining function: average, median, minimum, maximum, mode or percentile. Percentile needs the reference's percentile field.
Value in"AGGREGATION_"AGGREGATION_"AGGREGATION_"AGGREGATION_"AGGREGATION_"AGGREGATION_
freshnessFreshnessMaximum age of the observation a market-data lookup reads. Required for a market-data lookup (metric set). Rejected for a sale computation (window/aggregation set).
Show attributes
maximumAge?stringThe oldest market data to use. Must be positive.
lag?LagShifts an hours or days window into the past. Sale computation only. Absent prices on the latest sales.
Show attributes
shift?stringHow far to shift the window back from now. Only valid with a time window.
metric?stringMetric to read, such as "listing-price", which makes this a market data lookup. Absent for a sale computation.
outlier?OutlierDrops sales far from the typical price before combining them. Sale computation only. Absent keeps every sale.
Show attributes
sigma?numberSales more than this many standard deviations from the mean are dropped, such as 2.0.
Format"double"
percentileintegerPercentile to take, from 0 to 100. Required with the percentile aggregation and not allowed otherwise.
Format"int32"
source?stringMarket source to price from, such as "market-csgo".
truncatePercentage?booleanFor a market-data lookup, preserve the raw fractional USD cents until calculating trunc((100 + adjustment * 100) * (raw / 100)). False retains the ordinary nearest-cent rounding. True is rejected for sale computations.
window?WindowWhich recent sales to read, which together with aggregation makes this a sale computation. Absent for a market data lookup.
Show attributes
count?integerRead the most recent this many sales, whenever they happened. Cannot be combined with lag.
Format"int32"
length?stringRead sales from this long before now. Lag can shift the window into the past.
strategy?stringHow the references combine into one price. MIN is required for a buying contract and MAX for a selling contract. AVG is valid for either. Pairing the wrong extreme with a contract type risks overpaying (MAX on a buying contract) or underpricing (MIN on a selling contract).
Value in"VALUATION_"VALUATION_"VALUATION_
Response body
application/json
Success
licensedSourcesWithheld?LicensedSourcesWithheldNo longer set: price reads carry no limits, so no licensed price source's figures are left out. Kept so existing clients still decode the response.
Show attributes
limit?stringThe rule that left them out.
Value in"LICENSED_"LICENSED_"LICENSED_"LICENSED_"LICENSED_
resetsAt?stringWhen the limit next admits the read, for the per-minute and per-day limits. Absent for a rule the caller fixes by changing the read.
Format"date-time"
sourceFamily?stringThe licensed provider whose figures were left out.
unpricedMarketHashNames?array<string>Requested items the valuation could not price above zero, ordered by name. They are listed rather than dropped so a caller never values them at zero.
valuations?array<ItemValuation>One entry per priced item, ordered by market hash name.
Show attributes
marketHashName?stringMarket hash name of the item.
referencePrices?array<ReferencePrice>Each reference's resolved price, observation time and outcome, in reference order.
Show attributes
lastObservedAt?stringFor a stale reference, when last_value_cents was observed. Set only when outcome is stale.
Format"date-time"
lastValueCents?stringFor a stale reference, the last value the source reported before the reference's adjustment, in US cents. Set only when outcome is stale.
Format"int64"
metric?stringThe metric read for a market data lookup. Absent for a sale computation.
observedAt?stringWhen the figure behind value_cents was observed: the market observation's own time for a market data lookup, or the newest sale in the window for a sale computation. Absent when value_cents is absent.
Format"date-time"
outcome?stringWhether the reference resolved a price, found only an observation older than its freshness window, or found no data at all.
Value in"REFERENCE_"REFERENCE_"REFERENCE_
priceCents?stringThe price after the reference's adjustment, in US cents, which the valuation strategy combines. Absent when the source had no usable data.
Format"int64"
referenceIndex?integerZero-based position of the reference in the valuation's references.
Format"int32"
source?stringThe reference's market source, such as "market-csgo".
valueCents?stringThe price the source gave before the reference's adjustment, in US cents. Absent when the source had no usable data.
Format"int64"
valueCents?stringThe valuation's combined price for the item, in US cents, above zero.
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.
curl -X POST "https://api.goldmine.to/analytics.v1.Analytics/GetItemValuations" \
-H "Authorization: Bearer $CSTRADER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"marketHashNames": [
"AK-47 | Redline (Field-Tested)",
"Sticker | Unknown"
],
"valuation": {
"references": [
{
"source": "market-csgo",
"metric": "listing-price",
"freshness": {
"maximumAge": "7200s"
}
}
],
"strategy": "VALUATION_STRATEGY_MIN"
}
}'const res = await fetch("https://api.goldmine.to/analytics.v1.Analytics/GetItemValuations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CSTRADER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"marketHashNames": [
"AK-47 | Redline (Field-Tested)",
"Sticker | Unknown"
],
"valuation": {
"references": [
{
"source": "market-csgo",
"metric": "listing-price",
"freshness": {
"maximumAge": "7200s"
}
}
],
"strategy": "VALUATION_STRATEGY_MIN"
}
}),
});
const data = await res.json();body := strings.NewReader(`{
"marketHashNames": [
"AK-47 | Redline (Field-Tested)",
"Sticker | Unknown"
],
"valuation": {
"references": [
{
"source": "market-csgo",
"metric": "listing-price",
"freshness": {
"maximumAge": "7200s"
}
}
],
"strategy": "VALUATION_STRATEGY_MIN"
}
}`)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, "https://api.goldmine.to/analytics.v1.Analytics/GetItemValuations", 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/GetItemValuations",
headers={"Authorization": f"Bearer {os.environ['CSTRADER_API_KEY']}"},
json={
"marketHashNames": [
"AK-47 | Redline (Field-Tested)",
"Sticker | Unknown"
],
"valuation": {
"references": [
{
"source": "market-csgo",
"metric": "listing-price",
"freshness": {
"maximumAge": "7200s"
}
}
],
"strategy": "VALUATION_STRATEGY_MIN"
}
},
)
data = res.json(){
"valuations": [
{
"marketHashName": "AK-47 | Redline (Field-Tested)",
"valueCents": "2617"
}
],
"unpricedMarketHashNames": [
"Sticker | Unknown"
]
}{
"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."
}