New: live data for Youpin, CSFloat, and Steam

GET /v1/live/capabilities

Returns a machine-readable description of every live operation: its path, the JSON schemas of its request and structured response, its filters, sort fields, listing types, and page size, and example requests.

Available on all plans, at 10 requests per second.

It lists every operation, whether or not your plan includes it.

It isn't a live request. It doesn't count toward the live limits or use a demo key's live requests.

Query parameters#

ParameterDescription
marketReturns only this marketplace: youpin, csfloat, or steam.
operationReturns only this operation, such as listings or buy_orders.

Both are optional and can be combined, as in ?market=youpin&operation=listings. The full document is ~450 KB before compression.

Request#

GETapi.cs2.sh/v1/live/capabilities
curl https://api.cs2.sh/v1/live/capabilities \
  -H "Authorization: Bearer <<YOUR_API_KEY>>" \
  -H "Accept-Encoding: gzip" --compressed

Response#

{
  "contract_version": 0,
  "markets": [
    {
      "market": "string",
      "currency": "string",
      "operations": null
    }
  ],
  "continuation_schema": null,
  "response_contract": null
}

Response fields#

LiveCapabilitiesResponse fields:

FieldTypeRequiredDescription
contract_versionintegerNoThe version of this document's format.
marketsLiveCapabilitiesMarket[]NoOne entry per marketplace.
continuation_schemaobjectNoThe JSON Schema of a next-page body that holds only cursor.
response_contractobjectNoShort rules every live response follows.

Response data#

contract_version is currently 1. Each entry in markets[] has the marketplace's market, currency, and operations, keyed by operation name.

Each operation lists:

FieldMeaning
path, options_pathWhere to POST the request, and where to POST its options request.
request_schemaJSON Schema for the request body, with one variant per listing_type where the operation has listing types.
options_schemaJSON Schema for the options request body.
response_schemaJSON Schema for data with raw_response: false.
required_fields, required_any_ofThe fields a request must have. required_any_of lists groups where exactly one is needed.
default_listing_type, listing_modesThe operation's listing types and the page size of each. Empty when it has none.
page_sizeRows per page, or null when the operation isn't paged.
common_filtersThe names accepted in filters.
sort_fieldsThe values accepted in sort.field.
market_parametersThe names accepted in market_parameters.
semanticsThe marketplace's currency, what price means for each listing type, and how several stickers, patches, or charms combine.
examplesValid request bodies for path.

Using the schemas#

The schemas are JSON Schema, Draft 2020-12. request_schema is the complete truth for field names, types, allowed values, and bounds, and common_filters, sort_fields, and market_parameters summarize it.

A schema can't express three checks, which cs2.sh makes when you send the request:

  • whether the item exists;
  • whether a minimum is below its maximum;
  • whether a phase or sticker belongs to the item you named.

A failed check returns a 400 live error with details.code and details.field. Values from the marketplace's catalog, such as sticker names, collections, and phases, come from the operation's options path.

Errors#

The request returns 400 validation_error in three cases:

  • an unknown market or operation, with the valid ones in details.allowed_values;
  • a repeated parameter;
  • a parameter other than market and operation.

Other errors are the shared request errors.