Search code examples
node.jssteamsteam-web-apisteambot

steamcommunity does not return error code


I'm using node-steamcommunity to get user's inventory The module responded "[Error: malformed response]" After doing some debugging I've managed to see the raw response from steamcommunity server (request to: https://steamcommunity.com/profiles/STEAM_ID/inventory/json/570/1/): The response is

{"success": false}

The problem is that the normal response should contain the error like this:

{"success": false, "Error": "The profile is private"}

So now I can neither get the user's inventory nor the reason why I can't do this. Could some one point me to the right way of getting the user's inventory from steam

Update:

after doing some investigation I've found something interesting:

  1. When I login as a normal user, i get a sessionid.
  2. With that key I can access to profile inventory
  3. When I start bot I get also get sessionId but when I'm trying to request with bot's session id I get the { success: false} response without any explanation.

Does anyone has an idea what is wrong?


Solution

  • 1 is not a correct contextid for Dota 2 (570).

    You're looking for https://steamcommunity.com/profiles/STEAM_ID/inventory/json/570/2/ (notice the 2 at the end instead of 1).