我很想知道是否有 Steam API 或其他东西,可以获取所有当前的 Steam 游戏及其价格?我需要制作一个出售 Steam 游戏密钥的 Steam 密钥交易机器人,所以我需要游戏和实际游戏的价格来自动更新。
所以我要问的是是否有人知道我可以在哪里获得自动更新的 Steam 游戏和价格表。
我知道这存在:http : //api.steampowered.com/ISteamApps/GetAppList/v0001
但是不包括价格..
好的你好,所以我有一个异步的东西并返回一个promise,基本上我已经使用了.then方法或其他任何方法.虽然当我在console.log()中我想要记录的变量+一个自定义字符串(console.log(data +"hey");)它给出了log [object,object]当我单独执行变量数据时,它给了我正是我想要的.为什么会这样?这是我的代码btw.
(此代码获取我在库存中的项目.):
var steamUserInventory = require('steam-user-inventory');
var botID64 = "76561198026027024";
steamUserInventory(botID64, '753/6').then(data => console.log(data));
Run Code Online (Sandbox Code Playgroud)
这很完美(因为console.log中的数据是单独的)另外,当我尝试将"数据"放在这样的json文件中时:
steamUserInventory(Bot, '753/6').then(data =>
fs.writeFile("inventories/me.json", data, function(err) {
if(err) {
console.log("Error saving data to json file: " + err);
return;
}
console.log("Bot inventory has been updated!");
}));
Run Code Online (Sandbox Code Playgroud)
它给了我同样好的旧[物体,物体] ......更多的线条
在json文件中.它没有给我我想要的东西.
(顺便说一句,console.log(数据)给了我):
{ id: '538277908',
amount: '1',
pos: 126,
name: 'Docking',
appid: '753', classid: '230924010',
instanceid: '2108281766', tradable: 0,
marketable: 0, marketTradableRestriction: '7',
link: 'http://cdn.akamai.steamstatic.com/steamcommunity/public/images/items/2870/5059522765a958a85cabe31988ccc928b8c36715.jpg',
image: 'http://steamcommunity-a.akamaihd.net/economy/image/U8721VM9p9C2v1o6cKJ4qEnGqnE7IoTQgZI-VTdwyTBeimAcIoxXpgK8bPeslY9pPJIvB5IWW2-452kaM8heLSRgleGBrrJJ3upnaKks0uKrDFhw5OJPBT3mTBHXgjSUcef3xwM2PZYmJ0fxw5kZ79tJA8F0arJkgNs',
category: null, type: null,
exterior: null, quality:
Run Code Online (Sandbox Code Playgroud)
这是我想要存储在json文件中的内容. …