游戏库查询
查询账号拥有的 Steam 游戏列表(含游戏时长、中文名)。
提示
如果你还需要账号的其它信息(封禁、等级、库存等),推荐直接用 /api/account 或 /api/accounts,在 fields 里加上 游戏库 一次拿全,避免同账号并发登录冲突。
- URL:
POST /api/games(SSE 流式) - 配额:N 次(按 token 数量)
- 响应类型:
text/event-stream
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| refreshTokens | string | string[] | 是 | 逗号分隔字符串或数组,单个也用这个字段 |
请求示例
bash
curl -N -X POST https://monsteronly.me/api/games \
-H "Authorization: Bearer sk_xxxx" \
-H "Content-Type: application/json" \
-d '{"refreshTokens":"token1"}'SSE 响应示例
data: {"type":"start","total":1}
data: {"type":"progress","index":0,"total":1,"processed":1,"successful":1,"failed":0,"result":{
"success": true,
"steamID": "76561199000000000",
"totalGames": 128,
"totalPlaytimeHours": 523.45,
"recentPlaytimeHours": 12.3,
"games": [
{
"appid": 730,
"name": "反恐精英 2",
"playtime_forever": 18250,
"playtime_2weeks": 420,
"img_icon_url": "69f7ebe2735c366c65c0b33dae00e12dc40edbe4"
}
]
}}
data: {"type":"success","total":1,"successful":1,"failed":0,"quota":{"used":129,"remaining":871}}字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
| totalGames | number | 游戏总数 |
| totalPlaytimeHours | number | 总游戏时长(小时,保留 2 位小数) |
| recentPlaytimeHours | number | 最近两周游戏时长(小时) |
| games[].appid | number | Steam AppID |
| games[].name | string | 游戏中文名(如可用) |
| games[].playtime_forever | number | 总游戏时长(分钟) |
| games[].playtime_2weeks | number | 最近两周游戏时长(分钟) |
| games[].img_icon_url | string | 图标 hash |
图标完整 URL 格式:
https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/apps/{appid}/{hash}.jpg