web-dev-qa-db-ja.com

CS:GOインベントリを取得するSteam Web API

了解しました。インターネット全体でこれを探していました。私が見つけたのは、誰かのSteamインベントリを取得したい場合は、これを使用するということです。

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

しかし、問題は、CS:GO(appid:730)、ユーザーが在庫にアイテムを持っていても、空の応答が返されます。

8
Mathias_

jsonを取得したい場合は、次のリンクのいずれかを使用してください。

一般的なSteamインベントリ:(1:ゲーム、3:クーポン、6:トレーディングカード、7:報酬)

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

ゲーム :

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

問題はカウンターストライクのappidではなく、一般的なSteamインベントリでのみ機能する古いリンクを使用しただけです。すべてのsteamuserがcustomurlを設定しているわけではないため、STEAMIDを使用してリンクを使用することをお勧めします。

15
Michael 'kC' J.