API

导出全部饰品价格

GET /prices/export — 导出全部饰品价格

操作

GET /prices/export

行为

以单个文件下载某款游戏所有有价格的饰品的报价,用于批量同步。side 默认为 ask;side=mid 只导出每个有估值饰品的 CSCP 估值,文件小得多。

  • 响应体就是导出文档本身(app_id、side、generated_at、items),经 gzip 压缩(Content-Encoding: gzip),不是常规信封。请求 ID 与计费字段改为响应头:X-Request-ID、X-Billable,计费的响应另有 X-Credit-Cost 与 X-Credit-Remaining。
  • items 列出在所请求方向上至少有一条报价的所有饰品,按 market hash name 排序;每个饰品的报价遵循与 GET /prices 相同的规则。
  • 文件是服务器每隔几分钟重建一次的快照;generated_at(也即 X-Export-Generated-At 头)给出构建时间。两次重建之间的请求收到同一份文件。
  • 把收到的 ETag 以 If-None-Match 原样发回:快照未变时响应为 304 Not Modified 且无响应体,304 永不计费。
  • 不支持 Range 请求;总是发送整个文件。不支持分页,也不支持按市场过滤。
  • 503 dependency_unavailable 表示首份快照尚未建成;一分钟后重试。

[!warning] 每个 200 都会计费,即使文件没有变化。带 If-None-Match 轮询,只在有新内容时才付费。

用量

{
  "authentication": "user-api-key",
  "credit_cost": 10,
  "premium": false,
  "recommended_interval_seconds": 300,
  "rate_limit": {
    "max_requests": 2,
    "window_seconds": 60
  },
  "unit_pricing": null
}

请求

{
  "parameters": [
    {
      "name": "app_id",
      "in": "query",
      "required": false,
      "schema": {
        "type": "string",
        "minLength": 1,
        "maxLength": 16,
        "description": "游戏的 Steam 应用 ID。默认为 `730`(Counter-Strike 2)。",
        "default": "730",
        "title": "App Id"
      },
      "description": "游戏的 Steam 应用 ID。默认为 `730`(Counter-Strike 2)。"
    },
    {
      "name": "side",
      "in": "query",
      "required": false,
      "schema": {
        "enum": [
          "ask",
          "bid",
          "mid",
          "all"
        ],
        "type": "string",
        "description": "返回市场的哪一方向:`ask` 为在售挂单,`bid` 为求购订单,`mid` 为 CSCP 估值,`all` 为全部。默认为 `ask`。",
        "default": "ask",
        "title": "Side"
      },
      "description": "返回市场的哪一方向:`ask` 为在售挂单,`bid` 为求购订单,`mid` 为 CSCP 估值,`all` 为全部。默认为 `ask`。"
    }
  ]
}

响应

{
  "200": {
    "description": "请求成功",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ExportOut"
        }
      }
    },
    "headers": {
      "ETag": {
        "description": "本快照的校验标识:在 `If-None-Match` 中原样发回。",
        "schema": {
          "type": "string"
        }
      },
      "Last-Modified": {
        "description": "本快照的构建时间,HTTP 日期格式。",
        "schema": {
          "type": "string"
        }
      },
      "Content-Encoding": {
        "description": "总是 `gzip`:文件以压缩形式存储。",
        "schema": {
          "type": "string"
        }
      },
      "X-Export-Generated-At": {
        "description": "本快照的构建时间,RFC 3339 UTC 格式。",
        "schema": {
          "type": "string"
        }
      },
      "X-Billable": {
        "description": "本响应计费时为 `true`,否则为 `false`。",
        "schema": {
          "type": "string"
        }
      },
      "X-Credit-Cost": {
        "description": "本响应扣除的点数(仅计费的响应)。",
        "schema": {
          "type": "integer"
        }
      },
      "X-Credit-Remaining": {
        "description": "本次扣费后剩余的点数(仅计费的响应)。",
        "schema": {
          "type": "integer"
        }
      }
    }
  },
  "304": {
    "description": "`If-None-Match` 所指的快照仍是最新;不计费"
  },
  "401": {
    "description": "缺少认证信息或认证无效",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ErrorEnvelope"
        }
      }
    }
  },
  "402": {
    "description": "点数不足以完成本次请求",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ErrorEnvelope"
        }
      }
    }
  },
  "403": {
    "description": "凭证有效,但无权调用此操作",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ErrorEnvelope"
        }
      }
    }
  },
  "404": {
    "description": "请求的资源不存在",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ErrorEnvelope"
        }
      }
    }
  },
  "422": {
    "description": "参数或请求体无效",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ErrorEnvelope"
        }
      }
    }
  },
  "429": {
    "description": "对此端点的请求过多;请稍后重试",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ErrorEnvelope"
        }
      }
    }
  },
  "503": {
    "description": "服务暂时不可用;请稍后重试",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ErrorEnvelope"
        }
      }
    }
  }
}

模型

{
  "BatchItemOut": {
    "properties": {
      "market_hash_name": {
        "type": "string",
        "title": "Market Hash Name",
        "description": "饰品的 market hash name,与请求中的完全一致。"
      },
      "markets": {
        "items": {
          "$ref": "#/components/schemas/MarketQuoteOut"
        },
        "type": "array",
        "title": "Markets",
        "description": "该饰品的报价,每个市场的每个方向最多一条,先按市场代码、再按方向排序。饰品未知或所有报价都被过滤条件排除时为空。"
      }
    },
    "type": "object",
    "required": [
      "market_hash_name",
      "markets"
    ],
    "title": "BatchItemOut",
    "description": "一个请求的饰品及其市场报价。"
  },
  "CreditMeta": {
    "properties": {
      "cost": {
        "type": "integer",
        "title": "Cost",
        "description": "本次请求花费的点数。"
      },
      "remaining": {
        "type": "integer",
        "title": "Remaining",
        "description": "本次请求后的预估剩余点数。仅作参考而非账目:并发请求可能导致其略有偏差。"
      }
    },
    "type": "object",
    "required": [
      "cost",
      "remaining"
    ],
    "title": "CreditMeta",
    "description": "计费请求的点数结算信息。"
  },
  "ErrorBody": {
    "properties": {
      "code": {
        "type": "string",
        "title": "Code",
        "description": "稳定的机器可读错误代码。请根据此值进行分支处理,而不是 `message`。"
      },
      "message": {
        "type": "string",
        "title": "Message",
        "description": "面向人类阅读的说明。措辞可能变化。"
      },
      "details": {
        "anyOf": [
          {
            "additionalProperties": true,
            "type": "object"
          },
          {
            "type": "null"
          }
        ],
        "title": "Details",
        "description": "可选的结构化上下文,例如校验错误列表;对于 `credit_insufficient`,则为所需点数和剩余点数。"
      }
    },
    "type": "object",
    "required": [
      "code",
      "message"
    ],
    "title": "ErrorBody",
    "description": "失败请求的详细信息。"
  },
  "ErrorEnvelope": {
    "properties": {
      "error": {
        "$ref": "#/components/schemas/ErrorBody",
        "description": "出了什么问题。"
      },
      "meta": {
        "$ref": "#/components/schemas/Meta",
        "description": "请求元数据。"
      }
    },
    "type": "object",
    "required": [
      "error",
      "meta"
    ],
    "title": "ErrorEnvelope",
    "description": "错误响应:`error` 中为错误信息,`meta` 中为请求元数据。"
  },
  "ExportOut": {
    "properties": {
      "app_id": {
        "type": "string",
        "title": "App Id",
        "description": "Steam 应用 ID,原样回显请求中的值。"
      },
      "side": {
        "type": "string",
        "enum": [
          "ask",
          "bid",
          "mid",
          "all"
        ],
        "title": "Side",
        "description": "所应用的方向过滤条件,原样回显请求中的值。"
      },
      "generated_at": {
        "type": "string",
        "title": "Generated At",
        "description": "本份导出快照的构建时间,采用 RFC 3339 UTC 格式——与响应头 `X-Export-Generated-At` 的值相同。快照每隔几分钟重建一次;两次重建之间的请求收到同一份文件。"
      },
      "items": {
        "items": {
          "$ref": "#/components/schemas/BatchItemOut"
        },
        "type": "array",
        "title": "Items",
        "description": "在所请求方向上至少有一条报价的所有饰品,按 market hash name 排序。"
      }
    },
    "type": "object",
    "required": [
      "app_id",
      "side",
      "generated_at",
      "items"
    ],
    "title": "ExportOut",
    "description": "某款游戏所有有价格的饰品,在市场某一方向上的报价。"
  },
  "MarketQuoteOut": {
    "properties": {
      "market_code": {
        "type": "string",
        "title": "Market Code",
        "description": "该报价所属市场的代码,例如 `BUFF`。`CSCP` 表示 cs.cheap 对该饰品的估值:跨市场的人民币加权共识,每天更新,没有数量,`changed_at` 与 `fresh_at` 为其计算时间,详情见 `valuation`。它是估算值,不是任何人都能成交的报价。"
      },
      "provider_code": {
        "type": "string",
        "title": "Provider Code",
        "description": "采集该报价的数据来源代码。数据直接来自该市场时等于 `market_code`;否则为报告该市场价格的聚合平台。"
      },
      "side": {
        "type": "string",
        "enum": [
          "ask",
          "bid",
          "mid"
        ],
        "title": "Side",
        "description": "`ask` 表示在售挂单报价,`bid` 表示求购订单报价,`mid` 表示 `CSCP` 估值(在售共识与求购共识的中间价)。"
      },
      "market_currency_code": {
        "type": "string",
        "title": "Market Currency Code",
        "description": "`market_price_amount` 的货币,例如 `CNY`。价格以该市场自身的货币返回,不做换算。"
      },
      "market_price_amount": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "title": "Market Price Amount",
        "description": "以 `market_currency_code` 计的价格,为十进制字符串(普通记数法,去除末尾的零,从不使用科学记数法);来源未报告价格时为 `null`。已下架的报价保留最后已知的价格。"
      },
      "quantity": {
        "anyOf": [
          {
            "type": "integer"
          },
          {
            "type": "null"
          }
        ],
        "title": "Quantity",
        "description": "来源报告的市场该方向上的数量;未报告时为 `null`。饰品下架后为 `0`。"
      },
      "is_quantity_minimum": {
        "anyOf": [
          {
            "type": "boolean"
          },
          {
            "type": "null"
          }
        ],
        "title": "Is Quantity Minimum",
        "description": "`quantity` 为下限时为 `true`(来源只报告“至少”这么多);未知时为 `null`。"
      },
      "is_all_items_same_price": {
        "anyOf": [
          {
            "type": "boolean"
          },
          {
            "type": "null"
          }
        ],
        "title": "Is All Items Same Price",
        "description": "所有在售单件的价格都等于 `market_price_amount` 时为 `true`;来源只报告最低价或各件价格不同时为 `false`;未知时为 `null`。"
      },
      "changed_at": {
        "type": "string",
        "title": "Changed At",
        "description": "该报价的价格或数量在来源处最后一次变化的时间,采用 RFC 3339 UTC 格式(例如 `2026-09-24T03:12:08Z`)。"
      },
      "observed_at": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "title": "Observed At",
        "description": "该报价最后一次在来源处被单独观测到的时间,采用 RFC 3339 UTC 格式;未记录时为 `null`。"
      },
      "delisted_at": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "title": "Delisted At",
        "description": "发现该饰品在市场该方向上已不再挂出的时间,采用 RFC 3339 UTC 格式;仍在挂出时为 `null`。已下架的报价保留最后的价格,`quantity` 为 `0`。"
      },
      "fresh_at": {
        "type": "string",
        "title": "Fresh At",
        "description": "来源最后一次确认该报价仍为当前值的时间,采用 RFC 3339 UTC 格式:取 `changed_at`、`observed_at` 与该市场最近一次完整扫描完成时间中的最晚者。"
      },
      "valuation": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/ValuationOut"
          },
          {
            "type": "null"
          }
        ],
        "description": "估值详情,仅出现在 `CSCP` 报价上;所有市场报价上均为 `null`。"
      }
    },
    "type": "object",
    "required": [
      "market_code",
      "provider_code",
      "side",
      "market_currency_code",
      "market_price_amount",
      "quantity",
      "is_quantity_minimum",
      "is_all_items_same_price",
      "changed_at",
      "observed_at",
      "delisted_at",
      "fresh_at",
      "valuation"
    ],
    "title": "MarketQuoteOut",
    "description": "单个市场对某个饰品在某一方向上的报价。"
  },
  "Meta": {
    "properties": {
      "request_id": {
        "type": "string",
        "title": "Request Id",
        "description": "本次请求的唯一标识符,与响应头 `X-Request-ID` 相同。联系支持时请提供。"
      },
      "billable": {
        "anyOf": [
          {
            "type": "boolean"
          },
          {
            "type": "null"
          }
        ],
        "title": "Billable",
        "description": "该请求是否以点数计费。仅出现在计量端点上;`false` 表示该请求免费,例如因为它本身不收费,或已被你的订阅覆盖。"
      },
      "credit": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/CreditMeta"
          },
          {
            "type": "null"
          }
        ],
        "description": "本次请求的费用和你的预估剩余余额。仅在 `billable` 为 `true` 时出现。"
      }
    },
    "type": "object",
    "required": [
      "request_id"
    ],
    "title": "Meta",
    "description": "每个带信封的响应中都包含的请求元数据。"
  },
  "ValuationOut": {
    "properties": {
      "valuation_date": {
        "type": "string",
        "title": "Valuation Date",
        "description": "估值的 UTC 日期(`YYYY-MM-DD`)。每天计算一次,依据该日期之前七天的每日收盘报价。"
      },
      "credibility": {
        "type": "number",
        "title": "Credibility",
        "description": "0 到 1 之间的置信度分数,等于 `e^(-uncertainty)`;越接近 1,各来源越一致。依赖该估值之前请自行设定阈值。"
      },
      "uncertainty": {
        "type": "number",
        "title": "Uncertainty",
        "description": "估值在对数尺度上的标准不确定度(0 或以上)。约 68% 的合理取值落在 价格 × `e^(-uncertainty)` 与 价格 × `e^(uncertainty)` 之间。"
      },
      "is_two_sided": {
        "type": "boolean",
        "title": "Is Two Sided",
        "description": "在售挂单与求购订单都参与计算时为 `true`。为 `false` 时只有在售挂单可用,估值为在售共识减去同类饰品的典型半价差。"
      },
      "ask_amount": {
        "type": "string",
        "title": "Ask Amount",
        "description": "各市场在售挂单的加权共识,按人民币现金买入成本计(含费用),为十进制字符串。"
      },
      "bid_amount": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "title": "Bid Amount",
        "description": "各市场求购订单的加权共识,按扣除费用后到手的人民币现金计,为十进制字符串;价格高于该市场在售挂单的求购订单已被剔除。`is_two_sided` 为 `false` 时为 `null`。"
      },
      "ask_quote_count": {
        "type": "integer",
        "title": "Ask Quote Count",
        "description": "`ask_amount` 中在售挂单来源的数量。"
      },
      "bid_quote_count": {
        "type": "integer",
        "title": "Bid Quote Count",
        "description": "`bid_amount` 中求购订单来源的数量。"
      }
    },
    "type": "object",
    "required": [
      "valuation_date",
      "credibility",
      "uncertainty",
      "is_two_sided",
      "ask_amount",
      "bid_amount",
      "ask_quote_count",
      "bid_quote_count"
    ],
    "title": "ValuationOut",
    "description": "饰品的 CSCP 公允价值详情,取自最新一日的估值。"
  }
}

下载公开 OpenAPI schema