Jump to content
McKay Development

Recommended Posts

Posted

I am currently trying to get some Steam Market listings in my program, but am running into the following problem:

When I send the request to this Webpage "https://steamcommunity.com/market/listings/730/AK-47 | Asiimov (Field-Tested)" with this example code:

 import axios from "axios";

    const url = "https://steamcommunity.com/market/listings/730/AK-47%20%7C%20Asiimov%20%28Field-Tested%29";

    import axios from "axios";

    axios.get(url, { headers })
      .then(response => {
        console.log("Response:", response.data);
      })
      .catch(error => {
        console.error("Error:", error);
      });
      

I get an HTML page from which I can extract the data in a Variable. However, when I use javascript, only general information is displayed, but not the converted price, which is important for me, because otherwise the items are in any currency. 

In the code I am also logged in with SteamUser in the same account with which I receive the covered price as a variable via the browser.


Do you Guys know, what i need to change, to also get the converted Price?

Posted (edited)

I have found out the difference:

For example, in my code the page I get has no wallet info: 

g_rgWalletInfo[\'wallet_currency\']

 

while the web browser has one:

 var g_rgWalletInfo = {
            "wallet_currency": 3,
            "wallet_country": "NL"
			...
			}

 

Does anyone know why steam thinks I don't have a wallet or why the Request with the SteamUser Cookies is so diffrent? 

Edited by SteamUs1
Posted (edited)

Have found it! Somehow, i was not logged in, so steam was sending me the normal Page, as if would browse on the steammarket without session information. Make sure, that everything in the cookies is setup correctly!

Edit: Make sure, that you include the params for "webTradeEligibility"!! 

Edited by SteamUs1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...