# 接入 WOK API

WOK_API_KEY 是 WOK 密钥，不是 Steam 密钥。不要将其放入浏览器代码、URL、日志或智能体提示词。

https://woksteamapi.com

Authorization: Bearer $WOK_API_KEY

- https://woksteamapi.com/api/openapi.json
- https://woksteamapi.com/mcp.json
- https://woksteamapi.com/api/integration-guide.md
- https://woksteamapi.com/api/specialist-plans.md

1. 检查项目技术栈，按现有约定实现服务端适配器。

2. 调用一次 GET /v1/key，免费检查 access.endpoints、capabilities 和配额。专项套餐不包含其他场景。

3. 使用文档参数，同时检查 HTTP 和应用状态。区分 unavailable、private 与 empty。缺失数据保留 null 或 unavailable，不得虚构零值。

4. 设置总时限 60 秒并限制并发。临时 429/502/503/504 最多重试两次，加入随机延迟并遵守 Retry-After 和总时限。配额用尽后等待重置，不要循环重试 400/401/403 或不支持的功能。

5. 按来源时间戳缓存，并合并相同在途读取。不要逐动画帧轮询，也不要自动强制刷新。

6. 同时保留币种、价格来源、统计类型和观测时间，不要将不同币种或来源快照当作同一价格比较。

7. SteamID64 使用字符串而非 JavaScript 数字。物品名称应编码为 URL 参数，保留空格、★、竖线及非拉丁字符。遵循游标分页；批量请求可能按物品或玩家计费。

8. 先使用模拟数据编写示例和检查。真实付费或批量请求前先询问。本提示词不授权购买、更改套餐、真实扣款或发送邮件。

9. 报告修改文件、配置命令、检查结果及不支持能力。不得超出响应证据宣称数据或渲染完全一致。

## Inventory

库存、批量查询、快照与本地市场价格

所需权限: Inventory / 通用套餐

GET /v1/inventory

items[] 包含 assetid、markethashname、image、prices 和 currency；检视字段仅在可用时提供。

受 Steam 隐私设置限制。公开空库存与不可用库存是不同状态。Rust 统计位于 Players，库存批量请求按所请求玩家数计费。

包含的数据接口:

- /steam/api/inventory
- /v1/cs2/items
- /v1/inventories
- /v1/inventory
- /v1/inventory-snapshots
- /v1/inventory/refresh-prices
- /v1/items
- /v1/portfolio-history
- /v1/price
- /v1/price-history
- /v1/prices
- /v1/prices/coverage
- /v1/inventory-snapshots/{id}/diff

https://woksteamapi.com/api/integration-guide.md

```sh
curl --fail-with-body --max-time 60 "https://woksteamapi.com/v1/inventory?steam_id=76561198000000001&game=cs2" \
  -H "Authorization: Bearer $WOK_API_KEY"
```

将示例 SteamID 或检视链接占位符替换为目标数据。
