Inaccurate values for API vs Website

Issue #72 resolved
Relin Kaizer created an issue

This discrepancy has occurred more than once, I only can remember two times occurring, specifically each week during the steam weekend sales.

Warhammer 40,000: Dawn of War II (current sale on steam), shows up as inaccurate in the API, however if I browse the store, the price matches for the current steam sales.

Last week, it was Dead Island Riptide during the weekend, where steam had a sale and it showed up fine for the cheapest price, however, again the API shows a difference.

Regardless of when you can fix this, I just want to thank you for providing this service on this website.

Comments (3)

  1. ArmoredCavalry repo owner

    Hi Relin, thanks for bringing this to my attention. Can you give some examples of API requests you've seen the issue with?

    I have a hunch what is going on is related to caching. All data on the website is fed directly via the API, so if the request is identical, the data should be also identical (assuming nothing is cached client-side by the browser).

    If the request for the data is not completely identical, for example if you're requesting 10 results via the API, while the website displays 30, then the pricing is going to be cached at different times. Does this make sense?

    One way you can see this in action, try loading a request that is made for displaying on the front page of the website -

    http://www.cheapshark.com/api/1.0/deals?storeID=1&pageSize=7

    In the response header, you'll see "PHP-Cache-Age", this tells you when the data was first cached on the server.

    Whereas if you make a request that isn't made on the website, it likely won't be cached at all. Try loading this request twice though, and you should then get a cache hit/age -

    http://www.cheapshark.com/api/1.0/deals?storeID=1&pageSize=10

    You'll see that although the requests may be loading some of the same data, that data will have been retrieved (and then cached) at different times. Let me know if this makes sense, and if you have any questions/concerns.

  2. Log in to comment