Skip to content

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.

POST/analytics.v1.Analytics/GetItemValuations

Request 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?Valuation

How 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?number

Fraction 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"

aggregationAggregation

How the selected sales combine into one price. Required for a sale computation and not allowed on a market data lookup.

Show attributes
average?AverageOptions

Options for an average. Only used when type is average.

Show attributes
weighted?boolean

True weights each sale by its quantity. False averages sale prices equally.

type?string

The combining function: average, median, minimum, maximum, mode or percentile. Percentile needs the reference's percentile field.

Value in"AGGREGATION_TYPE_AVERAGE""AGGREGATION_TYPE_MEDIAN""AGGREGATION_TYPE_MINIMUM""AGGREGATION_TYPE_MAXIMUM""AGGREGATION_TYPE_MODE""AGGREGATION_TYPE_PERCENTILE"

freshnessFreshness

Maximum 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?string

The oldest market data to use. Must be positive.

lag?Lag

Shifts an hours or days window into the past. Sale computation only. Absent prices on the latest sales.

Show attributes
shift?string

How far to shift the window back from now. Only valid with a time window.

metric?string

Metric to read, such as "listing-price", which makes this a market data lookup. Absent for a sale computation.

outlier?Outlier

Drops sales far from the typical price before combining them. Sale computation only. Absent keeps every sale.

Show attributes
sigma?number

Sales more than this many standard deviations from the mean are dropped, such as 2.0.

Format"double"

percentileinteger

Percentile to take, from 0 to 100. Required with the percentile aggregation and not allowed otherwise.

Format"int32"

source?string

Market source to price from, such as "market-csgo".

truncatePercentage?boolean

For 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?Window

Which recent sales to read, which together with aggregation makes this a sale computation. Absent for a market data lookup.

Show attributes
count?integer

Read the most recent this many sales, whenever they happened. Cannot be combined with lag.

Format"int32"

length?string

Read sales from this long before now. Lag can shift the window into the past.

strategy?string

How 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_STRATEGY_MIN""VALUATION_STRATEGY_MAX""VALUATION_STRATEGY_AVG"

Response body

application/json

Success

licensedSourcesWithheld?LicensedSourcesWithheld

No 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?string

The rule that left them out.

Value in"LICENSED_SOURCE_LIMIT_NOT_SIGNED_IN""LICENSED_SOURCE_LIMIT_UNNAMED_ITEMS""LICENSED_SOURCE_LIMIT_ITEMS_PER_REQUEST""LICENSED_SOURCE_LIMIT_REQUESTS_PER_MINUTE""LICENSED_SOURCE_LIMIT_ITEMS_PER_DAY"

resetsAt?string

When 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?string

The 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?string

Market hash name of the item.

referencePrices?array<ReferencePrice>

Each reference's resolved price, observation time and outcome, in reference order.

Show attributes
lastObservedAt?string

For a stale reference, when last_value_cents was observed. Set only when outcome is stale.

Format"date-time"

lastValueCents?string

For 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?string

The metric read for a market data lookup. Absent for a sale computation.

observedAt?string

When 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?string

Whether the reference resolved a price, found only an observation older than its freshness window, or found no data at all.

Value in"REFERENCE_PRICE_OUTCOME_RESOLVED""REFERENCE_PRICE_OUTCOME_STALE""REFERENCE_PRICE_OUTCOME_MISSING"

priceCents?string

The 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?integer

Zero-based position of the reference in the valuation's references.

Format"int32"

source?string

The reference's market source, such as "market-csgo".

valueCents?string

The price the source gave before the reference's adjustment, in US cents. Absent when the source had no usable data.

Format"int64"

valueCents?string

The valuation's combined price for the item, in US cents, above zero.

Format"int64"

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"
    }
  }'
{
  "valuations": [
    {
      "marketHashName": "AK-47 | Redline (Field-Tested)",
      "valueCents": "2617"
    }
  ],
  "unpricedMarketHashNames": [
    "Sticker | Unknown"
  ]
}