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
The public Steamworks Web API is accessed by making HTTP (port 80) or HTTPS (port 443) requests to api.steampowered.com . If you're a publisher, then Steam also provides a partner-only Web API server hosted at https://partner.steam-api.com .
The standard user keys are available to everyone, all that is required is a Steam account and the domain name that will be associated with this key. You will also need to agree to the Steam Web API Terms of Use. You can create a user Web API key from the registration page on the Steam Community.
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With