API 广场 / 游戏 / DOTA2 英雄列表
API

DOTA2 英雄列表

124 个英雄的英文名、主属性与攻击类型

免费 正常 GET 游戏
返回首页
https://api.opendota.com/api/heroes
GET
https://api.opendota.com/api/heroes

接口说明

OpenDota 提供的官方英雄数据,不用密钥。每条含 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。

请求参数说明

此接口无需传递参数

在线调试 (GET)

支持自定义参数,GET 拼在链接上,POST 放在请求体
请求链接预览 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"]
  }
]
—