Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Steam web API getting CS:GO inventory

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.

like image 475
Mathias_ Avatar asked Sep 22 '14 15:09

Mathias_


People also ask

How do you get a Steam api key to roll in CSGO?

Ensure that you are logged into the Steam Community Website. Navigate to the Steam API Key Registration Website. Now add a domain name, agree to the terms and click register. If your server doesn't have a valid domain, feel free to input anything here.

How do I get my api key from Steam?

API Key Request Enter here and sign in with your Steam Account Name and Password. In the next screen you should fill your Steam Domain Name, confirm the Steam Api Terms of Use check box and click on the “Register” button. If everything went well you should see an screen as bellow with your own Steam Web API Key.


1 Answers

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.

like image 70
Michael 'kC' J. Avatar answered Sep 22 '22 08:09

Michael 'kC' J.