Steam在线人数
查询 Steam 游戏当前在线玩家人数。
GET
https://api.tinyaii.cn/v1/steam/players
请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| appid | int | 可选 | Steam AppID | — |
| name | string | 可选 | 游戏名称 | — |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
| data.appid | int | Steam AppID |
| data.player_count | int | 当前在线人数 |
返回示例
{
"code": 200,
"data": {
"appid": 730,
"player_count": 590711
},
"message": "success"
}
调用示例
curl "https://api.tinyaii.cn/v1/steam/players?appid=1&name=<name>" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch("https://api.tinyaii.cn/v1/steam/players?appid=1&name=<name>", {
headers: { "Authorization": "Bearer YOUR_API_KEY" },
});
console.log(await res.json());import requests
resp = requests.get(
"https://api.tinyaii.cn/v1/steam/players",
params={"appid": "1", "name": "<name>"},
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=10,
)
print(resp.json())把 YOUR_API_KEY 换成你的密钥即可直接运行。密钥只保存在你自己的设备上。