7

I am using steam api with python in order to get the number of players playing a game such as Dota 2.

import requests
import numpy as np
import pandas as pd

def main():

    header = {"Client-ID": "F07D7ED5C43A695B3EBB01C28B6A18E5"}

    appId = 570
    game_players_url = 'https://api.steampowered.com/ISteamUserStats/GetNumberOfCurrentPlayers/v1/?format=json&appid=' + appId
    game_players = requests.get(game_players_url, headers=header)

    print("Game name: Dota 2" + ", Player count: " + str(game_players.json()['response']['player_count']))


if __name__ == '__main__':
    main()

This gets me the correct current number of players for a specific game (in this case dota 2), however what i need is historical data concerning the player count of this specific game. This should be possible, since this site has the information that i desire and they are probably getting their data from the Steam API.

Any help would be greatly appreciated!

Thank you

codastic
  • 333
  • 3
  • 7
  • 2
    They are gathering the data and persisting it, hence why they have an historical data. In order for you to have the historical data, you should persist it as well. – Ilhicas Aug 31 '17 at 15:43
  • I thought about this, but I find it weird that they have all the data for every game on steam, for so many years back. That's why i think that it might be possible that the steam api is feeding all these data. – codastic Aug 31 '17 at 16:07
  • Consider reading https://github.com/SteamRE/SteamKit , there might be some obscure api method undocumented by Steam. But steemdb is pretty old. and even though the domains registration dates 2013, they do have data back to 2011. – Ilhicas Aug 31 '17 at 16:11
  • I would hide any sensible information in the code, such as Client-Id. – GendoIkari Aug 31 '17 at 17:17

1 Answers1

5

ilhicas pointed it out correctly in the comments: SteamDB has this historical data because they have been collecting and saving it for years, every single day. Official release for SteamDB was around 2010 so that's why they have so much data.

I have had a similar problem, looked around extensiveley and came to this conclusion:

There is no Steam Web API method for historical player count of a specific game.

In case you do not believe me:

EliteRaceElephant
  • 7,744
  • 4
  • 47
  • 62