编程语言
首页 > 编程语言> > php-Steam Web API获取徽章图像URL

php-Steam Web API获取徽章图像URL

作者:互联网

因此,我希望从Steam获取徽章图像的URL.

/ IPlayerService / GetBadges / v1 /提供:

{
"response": {
    "badges": [
        {
            "badgeid": 2,
            "level": 2,
            "completion_time": 1374530451,
            "xp": 200,
            "scarcity": 1711283
        },
        {
            "badgeid": 8,
            "level": 1,
            "completion_time": 1356256226,
            "xp": 100,
            "scarcity": 741879
        },
        {
            "badgeid": 1,
            "appid": 245070,
            "level": 1,
            "completion_time": 1379186990,
            "xp": 100,
            "communityitemid": "227090978",
            "border_color": 0,
            "scarcity": 688570
        },
        {
            "badgeid": 1,
            "appid": 219150,
            "level": 1,
            "completion_time": 1379187097,
            "xp": 100,
            "communityitemid": "227093331",
            "border_color": 0,
            "scarcity": 101278
        },
    ]
    ,
    "player_xp": 1227,
    "player_level": 11,
    "player_xp_needed_to_level_up": 173,
    "player_xp_needed_current_level": 1200
} }

但是徽章图像保存在:
http://cdn.akamai.steamstatic.com/steamcommunity/public/images/items/218620/d7ba194fac98cc5755fe7f08a8a7e2400acac43e.png

我可以从/ IPlayerService / GetBadges / v1 /中获得,但这只给了我:

http://cdn.akamai.steamstatic.com/steamcommunity/public/images/items/<appID>/d7ba194fac98cc5755fe7f08a8a7e2400acac43e.png

那么,如何从特定的Steam用户那里获取完整徽章的徽章图像?

资料来源

> Steam Web API:http://steamcommunity.com/dev
> Steam Web API Wiki:http://wiki.teamfortress.com/wiki/Category:WebAPI
> xPaw文档:http://lab.xpaw.me/steam_api_documentation.html
>徽章样本页:http://steamcommunity.com/id/TerryIGN/badges/

解决方法:

我不认为你可以特里.尝试获取类似游戏的武器图像时,我遇到了同样的问题.我必须下载图像并将其存储在我的服务器上以供参考.他们只是根本没有通过那里的api提供网址.

Steam API不好.

标签:steam,badge,api,json,php
来源: https://codeday.me/bug/20191029/1959491.html