跳到内容
API

WOK API

History API - 如何接入 | WOK

已观测价格历史与持仓价值图表

所需权限

History / Prices / Inventory / 通用套餐

选择套餐
  1. 1. 创建密钥

    登录账户并选择合适的套餐。

  2. 2. 配置服务器环境

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

  3. 3. 检查权限并发送请求

    GET /v1/key 返回允许使用的接口与配额,不消耗单位。

账户 →

首个请求

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

cURL
curl --fail-with-body --max-time 60 "https://woksteamapi.com/v1/price-history?game=cs2&name=AK-47+%7C+Redline+%28Field-Tested%29&days=30" \
  -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-history?game=cs2&name=AK-47+%7C+Redline+%28Field-Tested%29&days=30", {
  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-history?game=cs2&name=AK-47+%7C+Redline+%28Field-Tested%29&days=30'
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.

处理响应

显示观测数据时保留时间、来源和币种。POST /v1/portfolio-history 接受物品篮子,具体字段请查阅架构。

历史始于 WOK 观测到价格之时,并非完整 Steam 成交流。缺失日期应保留空缺,不得虚构零价格。days 范围为 1..365。

参数与响应格式 →

智能体接入指南

将任务复制到编程工具中。请在服务器单独设置密钥,说明中不包含 API 密钥。

MarkdownOpenAPI
查看说明
# 接入 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. 报告修改文件、配置命令、检查结果及不支持能力。不得超出响应证据宣称数据或渲染完全一致。

## History

已观测价格历史与持仓价值图表

所需权限: History / Prices / Inventory / 通用套餐

GET /v1/price-history

显示观测数据时保留时间、来源和币种。POST /v1/portfolio-history 接受物品篮子,具体字段请查阅架构。

历史始于 WOK 观测到价格之时,并非完整 Steam 成交流。缺失日期应保留空缺,不得虚构零价格。days 范围为 1..365。

包含的数据接口:

- /v1/portfolio-history
- /v1/price-history
- /v1/prices/coverage

https://woksteamapi.com/steam-item-price-history

```sh
curl --fail-with-body --max-time 60 "https://woksteamapi.com/v1/price-history?game=cs2&name=AK-47+%7C+Redline+%28Field-Tested%29&days=30" \
  -H "Authorization: Bearer $WOK_API_KEY"
```

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

← 其他使用场景