Steam web API getting CS:GO inventory

和自甴很熟 提交于 2019-11-28 22:32:31

问题


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.


回答1:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!