python dota2数据 1 比赛历史
注册API Key
https://steamcommunity.com/dev/apikey
安装dota2api
使用python的dota2api库来调用API: pip3 install dota2api
参考文档
http://dota2api.readthedocs.io/en/latest/installation.html
获取最近5场使用英雄ID
添加API KEY:
在linux中: export D2_API_KEY=xxxxx
也可在python文件中初始化时将KEY作为dota2api.Initialise()的参数。
查找API
查找相关函数发现查询比赛用到的函数为get_match_history(),其参数为:
- account_id 包含玩家ID
- hero_id 查询的对应英雄的比赛,每个英雄对应一个ID
- game_mode 游戏模式
- skill 水平等级
- min_players 最少玩家数量
- league_id 所属联赛ID</