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.
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.
来源:https://stackoverflow.com/questions/25977803/steam-web-api-getting-csgo-inventory