https://api.opendota.com/api/heroeshttps://api.opendota.com/api/heroesOpenDota 提供的官方英雄数据,不用密钥。每条含 id(数字 ID,对局数据里用的就是它)、name(内部代号 npc_dota_hero_xxx)、localized_name(英文名)、primary_attr(主属性 str/agi/int/all)、attack_type(Melee 近战 / Ranged 远程)、roles(定位数组)。
中文名这版没有,需要自己维护一张 id 到中文的映射表,社区有现成的可以抄。
英雄头像:https://cdn.cloudflare.steamstatic.com/apps/dota2/images/dota_react/heroes/{name 去掉 npc_dota_hero_ 前缀}.png。返回 22KB。
https://api.opendota.com/api/heroes
此处将显示接口返回结果…
[
{
"id": 1,
"name": "npc_dota_hero_antimage",
"localized_name": "Anti-Mage",
"primary_attr": "agi",
"attack_type": "Melee",
"roles": ["Carry", "Escape", "Nuker"]
}
]
—