POST /v1/archive/history

返回 BUFF、Youpin、C5Game 和 aggregate 序列的长期挂单价格历史。数据始于 2023 年,每天约更新 1-2 次。每次请求最多 100 个饰品。

在每个分桶内,价格、挂单数量和 total_supply 均为最后观测值。hourly_volume 是近似成交数量:1h 响应中为每小时估算值,1d 分桶中为当天各小时估算值之和。

访问#

需要 Scale 或 Enterprise API 密钥。

支持的间隔#

间隔分桶
1h小时归档分桶
1d日归档分桶

支持的来源#

来源字段
aggregateask, bid, ask_volume, bid_volume, hourly_volume, total_supply
buffask, bid, ask_volume, bid_volume
youpinask, bid, ask_volume, bid_volume
c5gameask, bid, ask_volume, bid_volume

默认仅返回 aggregate

请求#

POSTapi.cs2.sh/v1/archive/history
curl -X POST https://api.cs2.sh/v1/archive/history \
  -H "Authorization: Bearer <<YOUR_API_KEY>>" \
  -H "Accept-Encoding: gzip" --compressed \
  -H "Content-Type: application/json" \
  -d '{
  "items": [
    "USP-S | Printstream (Factory New)"
  ],
  "start": "2024-01-01",
  "end": "2026-07-26",
  "sources": [
    "aggregate",
    "buff"
  ],
  "interval": "1d"
}'

参数#

字段类型必需描述
itemsstring[]market_hash_name 值列表(最多 100 个)
startstring开始日期(YYYY-MM-DD 或 RFC3339)
endstring结束日期(YYYY-MM-DD 或 RFC3339)。默认现在。
sourcesstring[]过滤到指定来源。默认:仅 aggregate。
intervalstring默认值: 1d. 允许值: 1h, 1d. 聚合间隔

响应#

{
  "response_time": "2026-07-26T18:54:19.138233339Z",
  "currency": "USD",
  "start": "2026-04-27T00:00:00Z",
  "end": "2026-07-25T00:00:00Z",
  "interval": "1d",
  "items": {
    "USP-S | Printstream (Factory New)": {
      "market_hash_name": "USP-S | Printstream (Factory New)",
      "count": 89,
      "data": [
        {
          "bucket": "2026-04-27T00:00:00Z",
          "aggregate": {
            "time": "2026-04-27T23:59:07Z",
            "ask": 130.05,
            "ask_volume": 1225,
            "bid": 130.19,
            "bid_volume": 133,
            "hourly_volume": 27,
            "total_supply": 31291,
            "sample_count": 24
          },
          "buff": {
            "time": "2026-04-27T23:53:24Z",
            "ask": 133.12,
            "ask_volume": 405,
            "bid": 130.19,
            "bid_volume": 45,
            "sample_count": 24
          },
          "youpin": {
            "time": "2026-04-27T23:59:07Z",
            "ask": 130.05,
            "ask_volume": 510,
            "bid": 128.59,
            "bid_volume": 63,
            "sample_count": 24
          },
          "c5game": {
            "time": "2026-04-27T23:57:07Z",
            "ask": 132.21,
            "ask_volume": 139,
            "bid": 213.58,
            "bid_volume": 24,
            "sample_count": 24
          }
        }
      ]
    }
  }
}

响应字段#

ArchiveHistoryResponse 字段:

字段类型必需描述
response_timestring (date-time)响应生成时间。
currencystring货币代码(始终为 USD)。
startstring (date-time)查询范围的有效开始时间,向下取整到间隔边界。
endstring (date-time)查询范围的有效结束时间,向上取整到间隔边界。不包含该时间。
intervalstring允许值: 1h, 1d. 归档分桶大小。
itemsRecord<string, ArchiveHistoryItem>market_hash_name 到归档时间序列的映射。
errorsItemError[]与成功结果一起返回的逐饰品失败(部分成功)。

分桶#

字段描述
items.<name>.count有数据的分桶数。
items.<name>.data[]归档分桶。
data[].bucket分桶边界。
data[].<platform>最后观测的 ask/bidask_volume/bid_volume,附带 timesample_count。平台:aggregatebuffyoupinc5game
data[].aggregate.hourly_volume该分桶内的大致成交数量。1h 为小时值,1d 为当天各小时的总和。
data[].aggregate.total_supply该饰品的大致累计供应量。仅 aggregate
  • 每个归档分桶上都存在 bucket
  • 平台对象仅在该平台在该分桶中有数据时出现。
  • 没有归档数据的有效请求饰品返回 not_in_archive

完整结构:ArchiveHistoryItemArchiveHistoryBucketArchiveHistoryPlatformData

错误#

404 not_found 表示请求中的有效饰品均没有归档数据。部分结果返回 200errors[];饰品错误代码包括 unknown_iteminvalid_formatnot_in_archive。见部分成功请求错误