Steam API所有游戏

Ank*_*omm 15 steam-web-api

我一直在阅读论坛和尝试Steam API,我正在搜索提供所有Steam游戏的API.我找到了提供所有SteamApps的API,以及为Apps提供信息的Steam Store API(我正在寻找类型:'游戏'),但为此我需要为每个SteamApp调用一次商店API ... Store API限制为200次通话,持续5分钟!这是唯一的解决方案吗?

编辑:

所有应用API:http://api.steampowered.com/ISteamApps/GetAppList/v0002/?key = STEAMKEY&format = json

应用详情API:http://store.steampowered.com/api/appdetails?appids = {APP_ID}

Eli*_*ant 13

不存在“Steam API 一次性提供所有游戏及其所有详细信息”。

您可以用来GetAppList获取所有 Steam 应用程序。然后你必须查询每个应用程序,appdetails这将花费很长时间。

{
  "applist": {
    "apps": [
      {"appid": 10, "name": "Counter-Strike"},
      {"appid": 20, "name": "Team Fortress Classic"},
      {"appid": 30, "name": "Day of Defeat"},
      {"appid": 40, "name": "Deathmatch Classic"}
    ]
  }
}
Run Code Online (Sandbox Code Playgroud)
{
  "10": {
    "success": true, 
    "data": {
      "type": "game",
      "name": "Counter-Strike",
      "steam_appid": 10,
      "required_age": 0,
      "is_free": false,
      "detailed_description": "...",
      "about_the_game": "...",
      "short_description": "...",
      "developers": ["Valve"],
      "publishers": ["Valve"],
      "EVEN_MORE_DATA": {}
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

每个唯一 IP 地址的一般 API 速率限制为 5 分钟内 200 个请求,即每 1.5 秒一个请求。

另一种解决方案是使用第三方服务,例如SteamApis,它提供了更多选项,但它们不可避免地受到 Steam 在 API 中提供的内容的约束。


Ang*_* 84 6

这里的一个常见方法是缓存结果。

例如,如果您使用 PHP 之类的东西来查询结果,您将使用数组/对象执行 json_encode 和 json_decode 之类的操作来保存最后的结果。

您可以根据自己的需要来选择,但基本上您需要缓存然后执行最旧的更新。