Can't get a steam user's inventory through the API

Question:

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]>

Asked By: Marcel Drąg

||

Answers:

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",

Answered By: Brooke
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.