New: live data for Youpin, CSFloat, and Steam

POST /v1/live/csfloat/listings

返回 CSFloat 上某个饰品、一组饰品或最多 50 个名称的当前挂单,每条包含 USD 价格、磨损、图案模板、印花、挂件和卖家。涵盖一口价和拍卖挂单。每页 50 条。

请求#

POSTapi.cs2.sh/v1/live/csfloat/listings
curl -X POST https://api.cs2.sh/v1/live/csfloat/listings \
  -H "Authorization: Bearer <<YOUR_API_KEY>>" \
  -H "Accept-Encoding: gzip" --compressed \
  -H "Content-Type: application/json" \
  -d '{
  "market_hash_name": "AK-47 | Redline (Field-Tested)",
  "filters": {
    "max_float": 0.2,
    "max_price": 50
  },
  "sort": {
    "field": "price"
  },
  "raw_response": false
}'

参数#

字段类型必需描述
market_hash_namestring | string[]否一个饰品名称、一个涵盖所有磨损的分组名称(例如 Redline 或 AK-47 | Redline),或 1-50 个相容名称的列表。
listing_typestring否默认值: buy_now. 允许值: auction, buy_now. 要返回的挂单类型。省略时返回 buy_now 挂单。
filtersobject否此操作可接受的筛选条件,随请求发送给市场。该操作的文档页列出了这些条件,GET /v1/live/capabilities 返回其完整 schema。
sortobject否排序方式,包含 field 以及可选的 direction(asc 或 desc)。
market_parametersobject否市场自身的请求参数,由 cs2.sh 校验。不要重复 filters 已设置的条件。
raw_responseboolean否默认值: true. 为 true(默认)时,data 为市场自身的 JSON。为 false 时,data 为 cs2.sh 的结构化数据行。
cursorstring否上一页返回的 page.next_cursor,单独发送到同一路径以获取下一页。

响应#

{
  "market": "string",
  "operation": "string",
  "data": null,
  "page": {
    "page_size": 0,
    "has_next": false,
    "next_cursor": "string",
    "cursor_expires_at": "string",
    "total_count": 0,
    "total_exact": false
  },
  "warnings": [
    {
      "code": "string",
      "field": "string",
      "message": "string"
    }
  ],
  "response_time": "string"
}

响应字段#

LiveResponse 字段:

字段类型必需描述
marketstring否市场:youpin、csfloat 或 steam。
operationstring否所执行的操作,例如 listings。
dataobject否raw_response: true(默认)时为市场自身的 JSON,不做修改。raw_response: false 时为该操作的结构化对象,即 LiveListingsData、LiveListingDetailData、LiveBuyOrdersData、SteamBuyOrderBook、LiveFloatRankData 或 LiveSearchData 之一。
pageLivePage | null否下一次请求的分页信息。不分页的操作为 null。
warningsLiveRequestWarning[]否关于请求本身的提示。没有提示时不返回此字段。
response_timestring (date-time)否cs2.sh 发送响应的时间(UTC)。

POST /v1/live/csfloat/listings/options#

返回 CSFloat 挂单请求中某个字段的可选值,例如印花名称、收藏品系列或饰品分组名称。每个可选值都附带已应用该选项、可直接发送的请求。

请求#

POSTapi.cs2.sh/v1/live/csfloat/listings/options
curl -X POST https://api.cs2.sh/v1/live/csfloat/listings/options \
  -H "Authorization: Bearer <<YOUR_API_KEY>>" \
  -H "Accept-Encoding: gzip" --compressed \
  -H "Content-Type: application/json" \
  -d '{
  "market_hash_name": "AK-47 | Redline (Field-Tested)",
  "field": "filters.stickers.entries[].name",
  "contains": "Crown"
}'

参数#

字段类型必需描述
fieldstring是要列出可选值的请求字段,例如 filters.weapon 或 filters.stickers.entries[].name。
containsstring否选项标签必须包含的文本,不区分大小写。
cursorstring否上一页选项返回的 page.next_cursor,作为唯一字段发送。

响应#

{
  "market": "string",
  "operation": "string",
  "field": "string",
  "availability": "string",
  "completeness": "string",
  "options": [
    {
      "label": "string",
      "query": {
        "path": "string",
        "body": null
      }
    }
  ],
  "metadata": null,
  "page": {
    "page_size": 0,
    "has_next": false,
    "next_cursor": "string",
    "cursor_expires_at": "string",
    "total_count": 0,
    "total_exact": false
  },
  "response_time": "string"
}

响应字段#

LiveOptionsResponse 字段:

字段类型必需描述
marketstring否市场。
operationstring否可选值所适用的数据操作。
fieldstring否可选值所对应的请求字段。
availabilitystring否是否能为此请求加载可选值。
completenessstring否列表包含全部可接受值时为 complete。列表为建议值时为 partial,其他值也可能有效。
optionsLiveOption[]否可选值。
metadataobject否关于可选值列表的信息,例如获取时间。
pageLivePage否长列表的分页信息。
response_timestring (date-time)否cs2.sh 发送响应的时间(UTC)。