获取Steam播放器的库存清单(DOTA 2)

时间:2016-02-10 01:42:20

标签: api steam inventory

我从其他页面读了一些答案,发现http://steamcommunity.com/profiles/ / inventory / json / 570/2是我可以获取玩家库存清单的方法。在我去那个地址之后,出现了很多数据。但是,问题是数据没有正确显示。我得到了这样的东西。

  

{ “成功”:真 “rgInventory”:{ “7905269096”:{ “ID”: “7905269096”, “的classid”: “771158876”, “实例id”: “782509058”, “量”:“1 ”, “POS”:1}, “7832200468”:{ “ID”: “7832200468”, “的classid”: “626495772”, “实例id”: “1463199080”, “量”: “1”, “POS”: 2}, “7832199378”:{ “ID”: “7832199378”, “的classid”: “626495770”, “实例id”: “1463199082”, “量”: “1”, “POS”:3}, “7832197795” :{ “ID”: “7832197795”, “的classid”: “626495773”, “实例id”: “1463199083”, “量”: “1”, “POS”:4}, “7832127932”:{ “ID”: “7832127932”, “的classid”: “771156290”, “实例id”: “1463199085”, “量”: “1”, “POS”:5}, “7832128369”:{ “ID”: “7832128369”,“的classid “:” 626495771" , “实例id”: “1463199086”, “量”: “1”, “POS”:6}, “7832128042”:{ “ID”: “7832128042”, “的classid”: “466386035”, “实例id”: “1463199087”, “量”: “1”, “POS”:7}, “7830087148”:{ “ID”: “7830087148”, “的classid”: “536091705”, “实例id”:“1463199088 ”, “量”: “1”, “POS”:8}, “7822471023”:{ “ID”: “7822471023”, “的classid”: “771179852”, “实例id”: “782509058”, “量”: “1”, “POS”:9}, “7797472279”:{ “ID”: “7797472279”, “的classid”:“7714104 55" , “实例id”: “782509058”, “量”: “1”, “POS”:10}, “7782683766”:{ “ID”: “7782683766”, “的classid”: “771181072”, “实例id” : “782509058”, “量”: “1”, “POS”:11}, “7631976019”:{ “ID”: “7631976019”, “的classid”: “771157018”, “实例id”: “782509058”,”量 “:” 1" , “POS”:12}}, “rgCurrency”:[], “rgDescriptions”:{ “771158876_782509058”:{ “APPID”: “570”, “的classid”: “771158876”,“实例id “:” 782509058" , “icon_url”: “W_I_5GLm4wPcv9jJQ7z7tz_l_0sEIYUhRfbF4arNQkgGQGKd3kMuVpMgCwRZrh6GdUmV2uVefqzZAxsqDpH8eVO4Nb2CyAaiWsVUbt1mBngc3Zm32FdEXSSFBuQVD4Z97J3LgwOxDlDHfjc9z40ChfLKg86GW_CBqRXhIgJ1zaQ3WkhKx3uK”, “icon_url_large”: “W_I_5GLm4wPcv9jJQ7z7tz_l_0sEIYUhRfbF4arNQkgGQGKd3kMuVpMgCwRZrh6GdUmV2uVefqzZAxsqDpH8eVO4Nb2CyAaiWsVUbt1mBngc3Zm32CZOBWOAUKgdCoUqtJKW0Q7rCFKTLTVowoQBhPHGhMOGCK_YrRq1JVAm2rA7CM1GhVgPNerBnXLi”, “icon_drag_url”: “”, “名”:“食人魔   Caustic Steel Choppers“,”market_hash_name“:”食人魔的苛性钢   Choppers“,”market_name“:”食人魔的苛性钢   菜刀 “ ”name_color“: ”D2D2D2“, ”BACKGROUND_COLOR“: ”“, ”类型“:” 不寻常   剑”, “流通”:0, “销售”:0, “商品”:0, “market_tradable_restriction”: “7”, “market_marketable_restriction”: “7”, “说明”:[{ “类型”: “html” 的“值”:“使用   作者:炼金术士“}

有没有办法让它更整洁,所以我可以读取数据?或者任何人都可以给我任何关于如何处理这些数据的想法?谢谢堆

1 个答案:

答案 0 :(得分:1)

此数据采用JSON格式(http://www.json.org/)。它适合应用程序使用。所以你应该编写一个小程序来读取这些数据,解析它并查询更多元素。例如(这里只是猜测)有一个API,您可以通过其ID获取项目(类似http://steamcommunity.com/items/7832200468)。

此程序的输出可以是项目的列表(文本或HTML),其名称,值,稀有度等

编辑:还有:Getting someone's Steam inventory