Jump to content

Steam Trade Offer Accept With Python Code


Nuck

Recommended Posts

Hi guys, first of all i am sorry about my english. I try some trade offer accept without any library like "communitylink/tradeoffer/<tradeofferid/accept" but response either null or nothing please help me.

There is my code 

def test(trade_id: int):
  with requests.Session() as s:
    s.get(url="https://steamcommunity.com/tradeoffer/"+trade_id+"/accept/")
    sessionid = s.cookies.get("sessionid")
  param = {
    "sessionid": sessionid,
    "serverid": 1,
    "tradeofferid": trade_id
  }
  headers = {
    "referer": "https://steamcommunity.com/tradeoffer/"+trade_id+"/"
  }
  print (sessionid)
  response = requests.post("https://steamcommunity.com/tradeoffer/"+trade_id+"/accept",headers=headers,params=param)
  print (response.text)

test("4765101895")

 

Link to comment
Share on other sites

5 hours ago, Nuck said:

Hi guys, first of all i am sorry about my english. I try some trade offer accept without any library like "communitylink/tradeoffer/<tradeofferid/accept" but response either null or nothing please help me.

There is my code 

def test(trade_id: int):
  with requests.Session() as s:
    s.get(url="https://steamcommunity.com/tradeoffer/"+trade_id+"/accept/")
    sessionid = s.cookies.get("sessionid")
  param = {
    "sessionid": sessionid,
    "serverid": 1,
    "tradeofferid": trade_id
  }
  headers = {
    "referer": "https://steamcommunity.com/tradeoffer/"+trade_id+"/"
  }
  print (sessionid)
  response = requests.post("https://steamcommunity.com/tradeoffer/"+trade_id+"/accept",headers=headers,params=param)
  print (response.text)

test("4765101895")

 

Is that the complete code? If that's the case, you'll need more than just that to accept trades.

Link to comment
Share on other sites

Receive any offer in your browser (Google Chrome in my case) and then on the page /tradeoffer/###/ open JavaScript console, switch to Network tab, check "Preserve log" checkmark.

Click "Accept trade" and then look for "accept" POST request in the console.

 

xooK9mP.png         

This way you would see that you do need a partner parameter.

Link to comment
Share on other sites

6 hours ago, D.Alex said:

Receive any offer in your browser (Google Chrome in my case) and then on the page /tradeoffer/###/ open JavaScript console, switch to Network tab, check "Preserve log" checkmark.

Click "Accept trade" and then look for "accept" POST request in the console.

 

xooK9mP.png         

This way you would see that you do need a partner parameter.

I still get null response
 

indir.png

 

final code

Link to comment
Share on other sites

It looks like all your code is fine, but your request isn't sending any cookies in the headers, thus steam cannot authorise you. You had the right idea with using sessions. 

Link to comment
Share on other sites

40 minutes ago, Vortegan said:

It looks like all your code is fine, but your request isn't sending any cookies in the headers, thus steam cannot authorise you. You had the right idea with using sessions. 

I try sending cookies like this and again same result how is that not working?

indir (1).png

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...