WOK API
Prices API - 如何接入 | WOK
物品目录、各来源价格、价格统计与历史
所需权限
Prices / Inventory / 通用套餐
选择套餐- 1. 创建密钥
登录账户并选择合适的套餐。
- 2. 配置服务器环境
WOK_API_KEY 是 WOK 密钥,不是 Steam 密钥。不要将其放入浏览器代码、URL、日志或智能体提示词。
- 3. 检查权限并发送请求
GET /v1/key 返回允许使用的接口与配额,不消耗单位。
首个请求
将示例 SteamID 或检视链接占位符替换为目标数据。
cURL
curl --fail-with-body --max-time 60 "https://woksteamapi.com/v1/price?game=rust&name=Big+Grin&price_source=tm&price_stat=min&strict=true" \
-H "Authorization: Bearer $WOK_API_KEY"Node.js
const key = process.env.WOK_API_KEY;
if (!key) throw new Error('Set WOK_API_KEY on the server');
const response = await fetch("https://woksteamapi.com/v1/price?game=rust&name=Big+Grin&price_source=tm&price_stat=min&strict=true", {
method: 'GET',
headers: { Authorization: `Bearer ${key}`, 'Content-Type': 'application/json' },
signal: AbortSignal.timeout(60000),
});
if (!response.ok) throw new Error(`WOK HTTP ${response.status}; inspect Retry-After for 429`);
const result = await response.json();
// Validate the documented status and fields before using result.Python
import json, os, urllib.request, urllib.error
url = 'https://woksteamapi.com/v1/price?game=rust&name=Big+Grin&price_source=tm&price_stat=min&strict=true'
headers = {'Authorization': 'Bearer ' + os.environ['WOK_API_KEY'], 'Content-Type': 'application/json'}
data = None
request = urllib.request.Request(url, data=data, headers=headers, method='GET')
with urllib.request.urlopen(request, timeout=60) as response:
result = json.load(response)
# Handle HTTPError and validate the documented response status in your application.处理响应
将 source、currency、freshness 和 price_stat 与价格一起保留。来源无观测数据时保留 null。
min/max/avg/median 取决于来源观测。报价不保证挂单仍可购买。不要将 RUB 当成 USD,也不要将缺失统计静默替换为其他来源。
参数与响应格式 →智能体接入指南
将任务复制到编程工具中。请在服务器单独设置密钥,说明中不包含 API 密钥。
查看说明
# 接入 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. 报告修改文件、配置命令、检查结果及不支持能力。不得超出响应证据宣称数据或渲染完全一致。
## Prices
物品目录、各来源价格、价格统计与历史
所需权限: Prices / Inventory / 通用套餐
GET /v1/price
将 source、currency、freshness 和 price_stat 与价格一起保留。来源无观测数据时保留 null。
min/max/avg/median 取决于来源观测。报价不保证挂单仍可购买。不要将 RUB 当成 USD,也不要将缺失统计静默替换为其他来源。
包含的数据接口:
- /v1/cs2/items
- /v1/items
- /v1/portfolio-history
- /v1/price
- /v1/price-history
- /v1/prices
- /v1/prices/coverage
https://woksteamapi.com/steam-price-api
```sh
curl --fail-with-body --max-time 60 "https://woksteamapi.com/v1/price?game=rust&name=Big+Grin&price_source=tm&price_stat=min&strict=true" \
-H "Authorization: Bearer $WOK_API_KEY"
```
将示例 SteamID 或检视链接占位符替换为目标数据。