woctezuma/steamspypi

SteamSpy has changed its API

woctezuma opened this issue · 4 comments

At the top of the documentation page of SteamSpy, changes of the API are mentioned.

The biggest change here is the rate limit for the all requests: 1 request per minute.

  *IMPORTANT:* some things have changed, please, read this document through!

  The data is refreshed once a day, there is no reason to request the same information more than once every 24 hours.

  Allowed poll rate - 1 request per second for most requests, 1 request per 60 seconds for the *all* requests.

Moreover, the example mentions a page parameter:

  ## Examples: ##
  * steamspy.com/api.php?request=all&page=1 - return apps 1,000-1,999 of all apps.

which is confirmed later on:

  ### all ###

  Returns all games with owners data sorted by owners. Returns 1,000 entries per page.
  * page - page number for the list (starts at 0)

References:

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

In version 1.0.1:

  • the README has been updated to reflect the changes (rate-limit, page parameter, 1000 games per request),
  • the page parameter has been added to all requests,
  • the load() function works with page forced to 0, without offering any access to this parameter to the user,
  • page does not appear in the file name of the local cache for backward compatibility purpose.

I will leave it to the user to create the equivalent of the old load() function by embedding download() calls in a for-loop which:

  • respects the rate-limit,
  • aggregates 1000-game responses obtained for different values of page.

Inspiration can be found in my repository download-steam-reviews, which uses the rate-limited Steam API.
Edit: Here is a Github Gist, which I could not test.

For reference, SteamSpy's change was announced on August 17 on Twitter:
https://twitter.com/Steam_Spy/status/1295360897032916992

I cannot test my code (unit tests or just basic debugging), because SteamSpy has troubles managing its traffic. I wanted to bypass the rate-limits by avoiding all and issuing tag requests instead with stuff likes tags.json. On August 24, 2020, there are 427 tags.

Closing until SteamSpy becomes usable again.