A
A
Alexander Katunin2022-03-10 19:08:05
Python
Alexander Katunin, 2022-03-10 19:08:05

Python. How to get user's inventory by trade link?

How, having a trade link, you can get the inventory of a given user in python? (via API or something else..)

PS with answers: "this is not related to this", - please do not answer)) (and other similar answers)
I need an answer to my question!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dr. Bacon, 2022-03-10
@bacon

this has nothing to do with it!
PS about the meaninglessness of your PS

#
# ., 2022-03-11
@andro1

Via selenium

S
SKEPTIC, 2022-03-12
@pro100chel

Found code on google to get steamid64 from trade url

def url2id(trade_url): # Steam Trade Url >>> SteamID32 & SteamID64.
  accountid = "".join([i for i in str(trade_url).split("&")[0] if i.isdigit()])

  id32 = str("STEAM_0:{0}:{1}").format(int(accountid) & 1, int(accountid) >> 1)
  id64 = 76561197960265728
  id_split = id32.split(":")
  id64 += int(id_split[2]) * 2
  
  if id_split[1] == "1":
    id64 += 1
      
  return str(id64)

Accordingly, here you got steamid64. Then there is a special url to get the inventory. Next, you make a request to the url (try to substitute your id from the browser and then you will understand what to do yourself)
https://steamcommunity.com/inventory/cюда id вставляй/730/2?l=russia&count=5000

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question