I am using steam api with python in order to get the number of players playing a game such as Dota 2.
我正在使用带有python的steam api来获得玩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.
这使我得到了特定游戏(在这种情况下为dota 2)的正确当前玩家数量,但我需要的是有关此特定游戏的玩家数量的历史数据。这应该是可能的,因为这个站点有我想要的信息,他们可能从Steam API获取他们的数据。
Any help would be greatly appreciated!
任何帮助将不胜感激!
Thank you
谢谢
1 个解决方案
#1
0
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.
ilhicas在评论中正确指出:SteamDB拥有这些历史数据,因为他们每天都在收集和保存多年。 SteamDB的官方发布时间是2010年左右,这就是他们拥有如此多数据的原因。
I have had a similar problem, looked around extensiveley and came to this conclusion:
我有一个类似的问题,看看broadley并得出这个结论:
There is no Steam Web API method for historical player count of a specific game.
对于特定游戏的历史玩家数量,没有Steam Web API方法。
In case you do not believe me:
万一你不相信我:
- Valve's official Web API reference: https://partner.steamgames.com/doc/webapi_overview
- Valve的官方Web API参考:https://partner.steamgames.com/doc/webapi_overview
- An unofficial reference from the SteamDB creators: https://lab.xpaw.me/steam_api_documentation.html
- SteamDB创建者的非官方参考:https://lab.xpaw.me/steam_api_documentation.html
#1
0
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.
ilhicas在评论中正确指出:SteamDB拥有这些历史数据,因为他们每天都在收集和保存多年。 SteamDB的官方发布时间是2010年左右,这就是他们拥有如此多数据的原因。
I have had a similar problem, looked around extensiveley and came to this conclusion:
我有一个类似的问题,看看broadley并得出这个结论:
There is no Steam Web API method for historical player count of a specific game.
对于特定游戏的历史玩家数量,没有Steam Web API方法。
In case you do not believe me:
万一你不相信我:
- Valve's official Web API reference: https://partner.steamgames.com/doc/webapi_overview
- Valve的官方Web API参考:https://partner.steamgames.com/doc/webapi_overview
- An unofficial reference from the SteamDB creators: https://lab.xpaw.me/steam_api_documentation.html
- SteamDB创建者的非官方参考:https://lab.xpaw.me/steam_api_documentation.html