-1

I'm trying to get info about a Steam user's inventory but it seems that I'm doing something wrong. After running script below (ofc first I replace PROFILEID with my Steam User ID) all I get is {'success': False}. Can anyone tell me how to fix this? I set my inventory as visible for everyone.

import requests

inventory = requests.get("http://steamcommunity.com/profiles/PROFILEID/inventory/json/730/1").json()
print(inventory)

After deleting ".json()" it prints <Response [200]>

  • Mate you can find the awsner for your question here (https://stackoverflow.com/questions/29824111/get-a-users-steam-inventory) – PanosoikoGr Aug 26 '22 at 20:13
  • Is it the right ID? If you use https://www.steamidfinder.com/lookup/ and get the `steamID64 (Dec)` ID and use that, what response do you get? For my profile it got an error and said it was private, which it is, so I know that that's the way to get the correct ID at least. – Random Davis Aug 26 '22 at 20:22
  • PanosoikoGr I've tried all of these answers and none of them worked. – Marcel Drąg Aug 26 '22 at 20:25
  • Random Davis when I set my inventory as a private I get same error as you mentioned but when I change it to public it gives me {"succes": False}. – Marcel Drąg Aug 26 '22 at 20:28
  • @MarcelDrąg If you look at the current official API docs for getting inventory, they suggest a totally different endpoint URL: https://partner.steamgames.com/doc/webapi/IInventoryService but that requires a publisher key. Do you even know if what you're doing is possible now without a publisher key? Were you getting your info from somewhere other than the current, official API documentation? – Random Davis Aug 26 '22 at 20:32

1 Answers1

1

Changing the 1 at the end of the URL to a 2 worked for me.

https://steamcommunity.com/profiles/76561198048165534/inventory/json/730/1{"success":false}

https://steamcommunity.com/profiles/76561198048165534/inventory/json/730/2{"success":true,"rgInventory":{"23071433672":{"id":"23071433672","classid":"1989287349","instanceid":"302028390", ...

Brooke
  • 337
  • 2
  • 8