SteamDatabase / BrowserExtension

💻 SteamDB's extension for Steam websites
https://steamdb.info/extension/
BSD 3-Clause "New" or "Revised" License
776 stars 55 forks source link

Lowest recorded price box has incorrect value for now-free games #83

Closed Nixinova closed 3 years ago

Nixinova commented 3 years ago

See CSGO for example. The game is now free yet SteamDB states the lowest price is $9. The box should either disappear or state that the lowest price is $0.

image

Nixinova commented 3 years ago

GetPrice doesn't return the current value so there's nothing to test the "lowest" against. (Also "price" should really be split into "currencystr" and "pricenum".)

fetch('https://steamdb.info/api/ExtensionGetPrice/?appid=730&currency=NZD')
.then(d => d.json())
.then(r => console.log(r))
// {"success":true,"data":{"lowest":{"price":"NZ$ 8.99","discount":50,"date":"15 February 2018 (8 times, first on 11 June 2015)"}}}

https://github.com/SteamDatabase/BrowserExtension/blob/050cd58aad04d1eedc9ceea0500891a6584489b4/scripts/store/app.js#L79-L84

Nixinova commented 3 years ago
Well, Steam's API does seem to be a bit confusing around this. The package details don't mention the new price: ```js fetch('https://store.steampowered.com/api/packagedetails?packageids=730') .then(r => r.json()) .then(d => console.log(d[730].data.price)) // {"currency":"NZD","initial":1669,"final":1669,"discount_percent":0,"individual":0} ``` But the app details does have a `is_free` param: ```js fetch('https://store.steampowered.com/api/appdetails?appids=730') .then(r => r.json()) .then(d => console.log(d[730].data.is_free)) // true ```
Nixinova commented 3 years ago

GetPrice doesn't return the current value so there's nothing to test the "lowest" against.

Should I open an issue at https://github.com/SteamDatabase/SteamDatabase to request adding more output data to https://steamdb.info/api/ExtensionGetPrice/?

xPaw commented 3 years ago

That endpoint will no longer return data if game is currently free on the store.