sugarskins / csgo-steam-eth-trade

secure trading of CS:GO Steam community market weapons without a trusted third-party middleman
GNU General Public License v3.0
7 stars 1 forks source link

improve check that profile is public #5

Open danoctavian opened 4 years ago

danoctavian commented 4 years ago

Currently the steam adapter check that validates that the profile is public or private matches on the string contained by the web page.

This is unreliable (less so than an official API call). Find if there's a programmatic way to check for public or not public that does not rely on HTML parsing.

Note: The API call

https://steamcommunity.com/profiles/{steam_id}/inventory/json/730/2?count=1000

returns a specific response if profile is not public:

{"success":false,"Error":"This profile is private."}

This still requires Error string matching since the success can be false because of rate limiting. Also this endpoint is heavily rate-limited (only up to 4-5 req/min at time of writing), so its not usable at scale.