跳到主要内容
POST/v2/pricing/history/batchPRO+

批量价格历史

一次请求读取同一游戏最多 100 件饰品的聚合价格历史。items 的每个条目(market hash name、slug 或规范饰品 id)得到 GET /v2/pricing/:marketHashName/history 为它返回的响应体,并按发送时的原样作为键;无法解析的条目列在 errors 中,其余条目照常以 200 返回。同一个范围、粒度与 listingType 适用于所有饰品。每个不同条目计 5 个限流单位,与它所替代的单件读取相同。Pro 与 Enterprise 套餐。支持 CS2 与 Rust。

用一次 POST 读取最多 100 件饰品的历史,而不是每件一次 GET。请求体包含 items 以及单件读取的 from、to、interval、listingType、salesWindow 与 currency,默认值相同;不接受 markets,因为聚合序列不区分市场。返回 200(不是 201)。

items 的每个条目可以是精确的 market hash name、slug 或规范饰品 id,按此顺序尝试,结果按你发送时的原样作为键。匹配不到任何饰品的条目以 not_found(404)列在 errors 中;名称或 slug 被两件饰品共用的条目为 ambiguous(409),改用规范饰品 id 即可解析。其他条目照常返回。

批量请求与单件读取共用 10,000 个数据点的预算:不同饰品数乘以实际粒度下的时间桶数(两端都计入),SALE_HISTORY 按两倍计。100 件饰品可容纳 30 天的 DAY_1 或 4 天的 HOUR_1;默认 30 天的小时数据可容纳 13 件。10m 粒度的批量请求最多 25 件饰品。超过任一上限返回指明该上限的 400,请拆分批次或加宽粒度。

每个不同条目计 5 个限流单位,未能解析的条目也计入,与它所替代的单件读取相同:按 Pro 每分钟 1,200 个单位计,无论批次大小,每分钟可读 240 件饰品。每件饰品的序列与 /v2/pricing/:marketHashName/history 返回的相同。

参数

gamestring必填
查询参数。cs2 或 rust。所有饰品都在该游戏中读取。
itemsstring[]必填
请求体。1 到 100 个条目,每个最多 512 个字符:精确的 market hash name、slug 或规范饰品 id,按此顺序尝试。重复的条目只读取一次。
fromstring可选
请求体。包含在内的范围起点(ISO 8601)。默认:当前时间之前 30 天(即使传了 to 也是如此),因此指定较早的 to 时请同时传 from。
tostring可选
请求体。包含在内的范围终点(ISO 8601)。默认:当前时间。
intervalstring可选
请求体。MINUTE_5 | MINUTE_15 | HOUR_1 | HOUR_6 | DAY_1,与单件读取一样对齐到已存储的 10m / 1h / 1d 汇总。默认:由范围推导。饰品数乘以时间桶数不能超过 10,000 个数据点(SALE_HISTORY 的时间桶按两倍计),10m 粒度的批量请求最多 25 件饰品;超过任一上限返回指明该上限的 400。
listingTypestring可选
请求体。SELL_OFFER | BUY_ORDER | SALE_HISTORY。默认:SELL_OFFER。
salesWindowstring可选
请求体。24h | 7d | 30d | 90d。仅当 listingType: "SALE_HISTORY" 时有效。默认:30d。
currencystring可选
请求体。ISO 4217 代码,例如 EUR、GBP 或 JPY。所有饰品的每个价格按同一个当前汇率换算,汇率在顶层 fx 块中给出一次(fxBasis: "current")。缺省或 USD:美分。见以其他货币计价。

响应字段

HistoryBatchResponse多件饰品在同一范围内的聚合历史。
listingTypestring
SELL_OFFER | BUY_ORDER | SALE_HISTORY,与请求一致。
priceKindstring
ask_statistic | bid_statistic | sale_statistic,含义同 HistoryResponse。
salesWindowstringnullable
仅当 listingType=SALE_HISTORY 时设置。
effectiveIntervalstring
所有序列实际所在的已存储汇总:10m | 1h | 1d。
fromstring (date-time)
实际返回范围的起点。
tostring (date-time)
实际返回范围的终点。
itemsobject
每个已解析的请求条目(按发送时的原样作为键)到单件 /v2 历史读取为它返回的 HistoryResponse 的映射,包含其自身的 corrections,不含 fx。
errorsobject
每个未能解析的条目(按发送时的原样作为键)到 HistoryBatchError 的映射。所有条目都已解析时为空。
fxFx
仅当请求传入 USD 以外的 currency 时出现:所有饰品的每个数据点换算所用的那一个汇率。

嵌套与共享结构链接到 API 对象 参考页。

错误

400game 无效;items 缺失、为空、超过 100 个或含无效条目;范围、interval、listingType 或 currency 无效;或批量请求超过 10,000 个数据点的预算或 10m 粒度下 25 件的上限。
401缺少 Authorization 头、认证方案不支持,或密钥未知、未激活、已过期、已吊销。
403密钥有效,但套餐不是 Pro 或 Enterprise,或订阅未激活/已过期。
429超出速率限制;见 Retry-After 与 X-RateLimit-* 响应头。配额按账号合并计算,所有密钥共享。
503该游戏的读取尚未就绪,或请求的 currency 没有可用汇率。请稍后重试。
export SKINPRICER_API_KEY="sp_live_•••"

curl -X POST "https://pricing.skinpricer.com/v2/pricing/history/batch?game=cs2" \
  -H "Authorization: ApiKey $SKINPRICER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"items":["AK-47 | Redline (Field-Tested)","awp-asiimov-field-tested"],"from":"2026-11-26T00:00:00Z","to":"2026-11-27T00:00:00Z","interval":"DAY_1"}'
// No SDK helper for this endpoint yet, so call it directly.
const url = new URL("https://pricing.skinpricer.com/v2/pricing/history/batch");
url.searchParams.set("game", "cs2");

const res = await fetch(url, {
  method: "POST",
  headers: { Authorization: `ApiKey ${process.env.SKINPRICER_API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({"items":["AK-47 | Redline (Field-Tested)","awp-asiimov-field-tested"],"from":"2026-11-26T00:00:00Z","to":"2026-11-27T00:00:00Z","interval":"DAY_1"}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());
import os
import requests

res = requests.post(
    "https://pricing.skinpricer.com/v2/pricing/history/batch",
    params={"game": "cs2"},
    json={"items":["AK-47 | Redline (Field-Tested)","awp-asiimov-field-tested"],"from":"2026-11-26T00:00:00Z","to":"2026-11-27T00:00:00Z","interval":"DAY_1"},
    headers={"Authorization": f"ApiKey {os.environ['SKINPRICER_API_KEY']}"},
    timeout=10,
)
res.raise_for_status()
print(res.json())

需要认证的接口:请在你自己的客户端中携带 API 密钥调用(见代码示例)。

响应 200
{
  "listingType": "SELL_OFFER",
  "priceKind": "ask_statistic",
  "salesWindow": null,
  "effectiveInterval": "1d",
  "from": "2026-11-26T00:00:00.000Z",
  "to": "2026-11-27T00:00:00.000Z",
  "items": {
    "AK-47 | Redline (Field-Tested)": {
      "canonicalItemId": "cmlofczf90qj401vsd80dskd1",
      "name": "AK-47 | Redline (Field-Tested)",
      "listingType": "SELL_OFFER",
      "priceKind": "ask_statistic",
      "salesWindow": null,
      "effectiveInterval": "1d",
      "history": [
        {
          "timestamp": "2026-11-26T00:00:00.000Z",
          "avgPrice": 2236,
          "medianPrice": 2200,
          "minPrice": 1967,
          "maxPrice": 2499,
          "listingCount": 27717,
          "totalQuantity": null,
          "volume": null,
          "bestBidCents": 2160,
          "bestAskCents": 1967,
          "spreadBps": null,
          "netBestBidCents": 2052,
          "netSpreadBps": null
        },
        {
          "timestamp": "2026-11-27T00:00:00.000Z",
          "avgPrice": 2240,
          "medianPrice": 2238,
          "minPrice": 1854,
          "maxPrice": 2492,
          "listingCount": 27710,
          "totalQuantity": null,
          "volume": null,
          "bestBidCents": 2145,
          "bestAskCents": 1854,
          "spreadBps": null,
          "netBestBidCents": 2038,
          "netSpreadBps": null
        }
      ]
    },
    "awp-asiimov-field-tested": {
      "canonicalItemId": "cmlofczmb0qca01yo2bdv4wql",
      "name": "AWP | Asiimov (Field-Tested)",
      "listingType": "SELL_OFFER",
      "priceKind": "ask_statistic",
      "salesWindow": null,
      "effectiveInterval": "1d",
      "history": [
        {
          "timestamp": "2026-11-26T00:00:00.000Z",
          "avgPrice": 7921,
          "medianPrice": 7677,
          "minPrice": 7110,
          "maxPrice": 9400,
          "listingCount": 6193,
          "totalQuantity": null,
          "volume": null,
          "bestBidCents": 7905,
          "bestAskCents": 7110,
          "spreadBps": null,
          "netBestBidCents": 7510,
          "netSpreadBps": null
        },
        {
          "timestamp": "2026-11-27T00:00:00.000Z",
          "avgPrice": 8016,
          "medianPrice": 8097,
          "minPrice": 7000,
          "maxPrice": 8866,
          "listingCount": 6306,
          "totalQuantity": null,
          "volume": null,
          "bestBidCents": 7735,
          "bestAskCents": 7000,
          "spreadBps": null,
          "netBestBidCents": 7348,
          "netSpreadBps": null
        }
      ]
    }
  },
  "errors": {}
}
响应头
X-RateLimit-Limit: <每分钟配额,由套餐决定>
X-RateLimit-Remaining: <本分钟剩余次数>
X-RateLimit-Reset: <距重置的秒数>
X-Request-ID: req_xxxxxxxxxxxxxxxx

使用与许可

API 及其数据的使用受我们的服务条款(英文)约束:不得转售或再分发数据,不得用于构建竞争性服务, 不得超出套餐的速率限制;在条款允许展示数据的场景下须注明数据来源为 SkinPricer。滥用行为可能被限流或封禁。