Steam web API getting CS:GO inventory
Asked Answered
P

1

9

Alright, so I have been looking for this all over the internet, and what I have found out is that when you want to get someones steam inventory you use this:

http://api.steampowered.com/IEconItems_{appid}/GetPlayerItems/v0001/?key={apikey}&steamid={steamid}&format=json

But the problem is that when I do that for CS:GO (appid: 730), I just get an empty response back, even though the user has items in their inventory.

Puryear answered 22/9, 2014 at 15:28 Comment(4)
sounds like a bug then, might want to contact steam?Meathead
Kinda also what i thought, but wasn't sure if it was me doing it wrongPuryear
But then again, if i go to here and sign in, they can read my inventory csgolounge.com/match?m=1483Puryear
possibly related? github.com/Jessecar96/SteamBot/issues/508Meathead
Y
16

if you want to get the json just use one of the following links:

general steam inventory: ( 1: games, 3: coupons, 6: trading cards, 7: rewards )

http://steamcommunity.com/id/<USERURL>/inventory/json/753/1
http://steamcommunity.com/profiles/<STEAMID>/inventory/json/753/1

http://steamcommunity.com/id/<USERURL>/inventory/json/753/3
http://steamcommunity.com/profiles/<STEAMID>/inventory/json/753/3

http://steamcommunity.com/id/<USERURL>/inventory/json/753/6
http://steamcommunity.com/profiles/<STEAMID>/inventory/json/753/6

http://steamcommunity.com/id/<USERURL>/inventory/json/753/7
http://steamcommunity.com/profiles/<STEAMID>/inventory/json/753/7

games :

http://steamcommunity.com/id/<USERURL>/inventory/json/<APPID>/2
http://steamcommunity.com/profiles/<STEAMID>/inventory/json/<APPID>/2

the problem was not the counter-strike appid, you just used an old link that only works for the general steam inventory. I suggest you using the link using STEAMID because not every steamuser has set a customurl.

Yea answered 24/9, 2014 at 7:29 Comment(5)
does it block after the call limit of 20 per minute?Inning
So if i have a traffic of over 10000 per second on my website, I am basically screwed?Inning
if youre website does this many calls you are screwed anyway... you should strongly consider your concept and think about caching if possibleOutrange
Do we have any third party plugin Shiv can do this? I think Bitskins have this kind of functionality in which you can choose whether to display your inventory from steam or from cache. I wonder how did they do that...Inning
yes but the one most websites use costs some money... csgo.steamlytics.xyz/api see they have different plans for different website "sizes" - there might be different ones but most websites use this one afaikOutrange

© 2022 - 2024 — McMap. All rights reserved.