获得别人的蒸汽库存 [英] Getting someone's Steam inventory

查看:359
本文介绍了获得别人的蒸汽库存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做一个网站,需要访问的用户的蒸汽库存。我发现了一个API来获取团队要塞2库存,DOTA 2,CS:S,CS:GO和Portal 2。但我没有找到如何让蒸汽存货任何API

I am making a website that needs to access the Steam inventory of the user. I found an API to get Team Fortress 2 inventory, Dota 2, CS:S, CS:GO and Portal 2. But I didn't find any API for getting Steam inventory.

是否有可能以任何方式访问此库存?谢谢!

Is it possible in any way to access this inventory? Thank you!

推荐答案

蒸汽不(还)有看着蒸汽库存的官方API。但是,你仍然可以得到一些有限的信息,如果目标有他们的配置文件的权限设置正确。

Steam Does not (yet) have an official API for looking at Steam Inventories. However, you CAN still get some limited information if the target has their profile permissions set appropriately.

您可以通过使用这两个环节的测试中查看生成的 JSON 文件(和礼品,如果适当的权限设置)存货

You can view the resulting json files by using either of these two links for beta (and gift, if appropriate permissions are set) inventories

http://steamcommunity.com/id/<CUSTOMURL>/inventory/json/753/1
http://steamcommunity.com/profiles/<PROFILEID>/inventory/json/753/1

CUSTOMURL 是用户友好的名称的玩家选择使用。这是由玩家在任何时候改变。如果你正在写一个网页,我假设你知道如何让这条信息,是否正确? 配置文件ID 是一个球员是由蒸汽在创建账户给出的64位ID。这是不可更改,它是由蒸汽,当他们登录使用一个OpenID实现返回。

CUSTOMURL is the user friendly name the player has selected to use. This is changeable by the player at any time. If you are writing a web page, I assume you know how to get this piece of information, correct? PROFILEID is the 64Bit id that a player is given by Steam when you create the account. This is not changeable and it is returned by Steam when they log in using an OpenID implementation.

在使用这些网址,有几个可能的响应。首先是如果用户他们的个人资料设置为私人。

When using those URLs, there are a few possible responses. The first is if the user has their profile set to private.

{成功:假的,错误:此配置文件是私有的}

二是东西的列表清单中的

The second is a listing of "stuff" in the inventory

{
    "success":true,
    "rgInventory":
    {
        "1586670077416875609":
        {
            "id":"1586670077416875609",
            "classid":"149742033",
            "instanceid":"0",
            "amount":"1",
            "pos":1
        },
        "1586670077416875905":
        {
            "id":"1586670077416875905",
            "classid":"149742033",
            "instanceid":"0",
            "amount":"1",
            "pos":2
        },
        "1586670077416877092":
        {
            "id":"1586670077416877092",
            "classid":"149742033",
            "instanceid":"0",
            "amount":"1",
            "pos":3
        }
    },
    "rgCurrency":[],
    "rgDescriptions":
    {
        "149742033_0":
        {   "appid":"753",
        "classid":"149742033",
        "instanceid":"0",
        "icon_url":"ZyjGwQD4ogROtSm7KvtdP99kDHBEiKxKm3Gg7pMaBJyiPu4iS_PzF6QhOUdOwk-m0WhXYQ7X8AbNL6Hz1VxOnq4-8iBC5MlBuXMuElaaCrHQLww9T5S1Ecoqo_PYWg==",
        "icon_url_large":"a6FEz5nbBlvu8bGd1oDggdPtjn7dqwgVOzU4yG9huSKut2ws0tBXSARloWGyufIY3eHVb5f0VFltaznVKSfzK6amZz7FjFhcTTm6Maz860eOrMo937A=",
        "icon_drag_url":"",
        "name":"Steam Trading Card Beta",
        "market_name":"",
        "name_color":"",
        "background_color":"",
        "type":"Gift",
        "tradable":1,
        "marketable":0,
        "descriptions":[
            {"value":"Steam Trading Card Beta Access - Extra Copy"},
            {"value":"Grants early access to the Steam Trading Cards beta, game badges, and the new profile. Join the Steam Trading Cards Group and post your feedback in the Discussions area. Select \u201cAdd to my game library\u201d to activate."}
            ],
        "actions":[
            {"name":"View in store","link":"http:\/\/steamcommunity.com\/tradingcards"}
            ]
        }
    }
}

如果URL是您的ID和您登录到蒸汽,还可以看到,被列为礼品项目。否则,那些默认是隐藏的。

If the URL is for YOUR ID and you are logged into Steam, you can also see items that are listed as Gift. Otherwise, those are hidden by default.

由于这不是一个官方的API,没有这个特定的模式多文档。然而,似乎在 rgInventory 的项目链接到项目中的 reDescriptions 的classid 。编写分析器作为练习留给读者。

Since this isn't an official API, there isn't much documentation about this particular schema. However, it appears that the items in rgInventory are linked to items in the reDescriptions by classid. Writing the parser is left as an exercise for the reader.

这些节目公测访问。

如果您正在寻找交易卡信息,更改 1 在上面的网址与 6

If you are looking for trading card information, change the 1 in the above URLs to a 6

http://steamcommunity.com/id/<CUSTOMURL>/inventory/json/753/6
http://steamcommunity.com/profiles/<PROFILEID>/inventory/json/753/6

的模式布局似乎是这些是相同的。

The schema layouts appear to be the same for these.

这篇关于获得别人的蒸汽库存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆