我想用steam web api从steam游戏中获得一个图像/徽标/图标,但api的问题是,他们要求在url中使用哈希。我在哪里可以得到哈希?
Steam接口链接:http://media.steampowered.com/steamcommunity/public/images/apps/{appid}/{hash}.jpg
示例:http://media.steampowered.com/steamcommunity/public/images/apps/440/07385eb55b5ba974aebbe74d3c99626bda7920b8.jpg
发布于 2020-04-07 03:19:14
在将include_appinfo查询参数设置为true时,它们的大多数官方API端点都会返回应用程序详细信息,比如GetOwnedGames (为用户获取拥有的游戏的文档here )。
然后,返回的详细信息包括您要查找的散列,如游戏对象中的img_icon_url和img_logo_url。
就像他们的文档中写的那样,
这些是游戏的各种图像的文件名。要构造图像的URL,请使用以下格式:
http://media.steampowered.com/steamcommunity/public/images/apps/{appid}/{hash}.jpg
下面是一个请求http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key=YOUR_API_KEY&steamid=YOUR_STEAM_ID&include_appinfo=true&format=json的示例
以及来自这个请求的游戏结果密钥。
{
"appid": 400,
"name": "Portal",
...
"img_icon_url": "cfa928ab4119dd137e50d728e8fe703e4e970aff",
"img_logo_url": "4184d4c0d915bd3a45210667f7b25361352acd8f",
...
},因此,对于门户徽标,结果URL将是http://media.steampowered.com/steamcommunity/public/images/apps/400/4184d4c0d915bd3a45210667f7b25361352acd8f.jpg
发布于 2019-01-15 22:33:11
将440替换为游戏/应用程序的任何其他有效ID。这就是你需要的。
发布于 2021-12-11 17:27:24
有4种图像可以与steam应用程序id一起使用。
https://cdn.cloudflare.steamstatic.com/steam/apps/1569040/hero_capsule.jpg https://cdn.cloudflare.steamstatic.com/steam/apps/1569040/capsule_616x353.jpg https://cdn.cloudflare.steamstatic.com/steam/apps/1569040/header.jpg https://cdn.cloudflare.steamstatic.com/steam/apps/1569040/capsule_231x87.jpg
https://stackoverflow.com/questions/53963328
复制相似问题