HOK API:为你的程序提供 Honor of Kings 数据

从程序或 AI 助手读取 Honor of Kings Global 的英雄、装备、铭文、召唤师技能、排行榜和赛事征召,以及你自己的训练赛。只读、免费、凭密钥使用。

获取密钥

身份验证

每个地址都需要以 bearer 令牌发送的 API 密钥。密钥只读,所见与其所有者相同:面向所有人的游戏数据,以及你自己的训练赛、排行榜和战队。

你的第一次调用
curl -H "Authorization: Bearer hok_YOUR_KEY" http://127.0.0.1:3000/api/v1/heroes

X-API-Key 请求头也可以。放在地址中的密钥会被忽略:地址会进入日志。

限制与错误

每个密钥每分钟可发送 120 次请求。错误为带固定代码的 JSON:

状态code含义
400invalid_body发送到唯一 POST 的局面无效:错误信息会说明问题所在。
401unauthorized没有密钥,或密钥无效、已过期或已撤销。
403insufficient_scope密钥缺少此地址所需的范围。
404not_found未知地址,或密钥所有者无权查看的内容。
405method_not_allowed该 API 仅支持读取:请使用 GET。
429rate_limited请求过多:请等待 Retry-After 指定的秒数。

与 AI 一起使用

该 API 也是一个 MCP 服务器,地址为 http://127.0.0.1:3000/api/v1/mcp:助手会为其密钥可读的每个地址获得一个工具。

为每个助手单独创建一个密钥,只给它需要的权限(询问英雄、装备和征召时,游戏的公开数据就够了)。若某个密钥泄露,撤销它即可,不影响其他密钥。

Claude Code

在终端中运行:

Terminal
claude mcp add --transport http hok-api http://127.0.0.1:3000/api/v1/mcp --header "Authorization: Bearer hok_YOUR_KEY"

Claude Desktop

将其添加到 claude_desktop_config.json(Settings、Developer、Edit config),然后重启 Claude。需要 Node.js。

claude_desktop_config.json
{
  "mcpServers": {
    "hok-api": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "http://127.0.0.1:3000/api/v1/mcp",
        "--header",
        "Authorization:${HOK_API_KEY}"
      ],
      "env": {
        "HOK_API_KEY": "Bearer hok_YOUR_KEY"
      }
    }
  }
}

Cursor

将其添加到项目或主目录中的 .cursor/mcp.json:

.cursor/mcp.json
{
  "mcpServers": {
    "hok-api": {
      "url": "http://127.0.0.1:3000/api/v1/mcp",
      "headers": {
        "Authorization": "Bearer hok_YOUR_KEY"
      }
    }
  }
}

ChatGPT

在自定义 GPT 中:Configure,Create new action,用此地址 Import from URL。然后 Authentication 选 API key,类型 Bearer,并粘贴你的密钥。

OpenAPI
http://127.0.0.1:3000/api/v1/openapi.json

将 hok_YOUR_KEY 替换为你的密钥。助手会看到密钥可读取的每个地址对应的一个工具,且只读。

地址列表

完整描述,可导入到工具中: /api/v1/openapi.json (OpenAPI 3.1)

游戏数据 game

GET/api/v1/heroes游戏数据

The heroes of the Global roster (name, classes, lanes, picture).

AI 工具:list_heroes

响应示例
{
  "heroes": [
    {
      "id": "h105",
      "name": "Arli",
      "displayName": "Arli",
      "image": "https://camp.honorofkings.com/h105.png",
      "roles": [
        "Marksman"
      ],
      "lanes": [
        "Farm Lane"
      ],
      "laneSources": {
        "Farm Lane": "camp"
      },
      "sourceIds": [
        "105"
      ],
      "availableGlobal": true,
      "isFlowborn": false,
      "sourceUpdated": "20260925"
    }
  ],
  "lastUpdated": "2026-10-31T08:00:00.000Z",
  "sourceUpdated": "20260925",
  "usingCache": true,
  "language": "en",
  "namesLanguage": "en"
}
GET/api/v1/heroes/{id}游戏数据

One hero: its sheet (skills, art), its recommended builds, its combos, its official ratings and the competitive figures.

AI 工具:get_hero

参数位置简介
id 必填地址The id of the thing.
since查询Count the tournament games from this day on, YYYY-MM-DD.
响应示例
{
  "hero": {
    "id": "h105",
    "name": "Arli",
    "roles": [
      "Marksman"
    ],
    "lanes": [
      "Farm Lane"
    ]
  },
  "competitive": [],
  "tournament": {
    "since": null,
    "totalGames": 48,
    "picks": 21,
    "bans": 9,
    "wins": 12,
    "losses": 9,
    "winRate": 0.571,
    "pickRate": 0.438,
    "banRate": 0.188,
    "byRule": {},
    "range": {
      "first": "2026-08-01",
      "last": "2026-10-30"
    }
  },
  "builds": [],
  "profile": null,
  "ratings": {
    "Farm Lane": "A"
  },
  "ratingSources": {
    "Farm Lane": "tournaments"
  },
  "combos": [],
  "details": null,
  "detailsFetchedAt": null,
  "detailsLanguage": "en",
  "language": "en"
}
GET/api/v1/tier-list游戏数据

The public tier list of each lane: tournament results first, the editors' ratings for the heroes played too little.

AI 工具:get_tier_list

响应示例
{
  "period": {
    "from": "2026-08-01",
    "to": "2026-10-31"
  },
  "minGames": 10,
  "totalGames": 120,
  "lanes": [
    {
      "lane": "Farm Lane",
      "slug": "farm",
      "tiers": [
        {
          "label": "SS",
          "heroes": [
            {
              "heroId": "h105",
              "source": "tournaments",
              "games": 48,
              "winRate": 0.571,
              "pickRate": 0.438,
              "score": 0.62
            }
          ]
        }
      ],
      "unranked": [
        "h199"
      ]
    }
  ],
  "updatedAt": "2026-10-31T08:00:00.000Z"
}
GET/api/v1/catalog游戏数据

The items, the arcana, the battle spells, the stats and the tags of the game, in one answer.

AI 工具:get_catalog

响应示例
{
  "stats": [
    {
      "id": 1,
      "name": "Physical Attack"
    }
  ],
  "tags": [
    {
      "id": 3,
      "name": "Burst"
    }
  ],
  "tagGroups": {
    "red": "Damage"
  },
  "items": [],
  "arcana": [],
  "spells": [
    {
      "id": 1,
      "name": "Flash",
      "imageId": null,
      "description": "Blink a short distance.",
      "cooldownSeconds": 120,
      "unlockLevel": null
    }
  ],
  "heroTags": {}
}
GET/api/v1/catalog/{family}游戏数据

One family of the catalogue: items, arcana, spells, stats or tags.

AI 工具:list_catalog_family

参数位置简介
family 必填地址items, arcana, spells, stats or tags.
响应示例
{
  "spells": [
    {
      "id": 1,
      "name": "Flash",
      "imageId": null,
      "description": "Blink a short distance.",
      "cooldownSeconds": 120,
      "unlockLevel": null
    }
  ]
}
GET/api/v1/catalog/{family}/{id}游戏数据

One item, arcana, spell, stat or tag, by its number: everything its page shows (stats and tags by their number).

AI 工具:get_catalog_entry

参数位置简介
family 必填地址items, arcana, spells, stats or tags.
id 必填地址The id of the thing.
响应示例
{
  "id": 1,
  "name": "Flash",
  "imageId": null,
  "description": "Blink a short distance.",
  "cooldownSeconds": 120,
  "unlockLevel": null
}

赛事数据 competitive

GET/api/v1/tournaments赛事数据

The tournament series entered by the staff.

AI 工具:list_tournaments

参数位置简介
q查询Words to look for.
page查询The page of the list, from 1.
响应示例
{
  "items": [
    {
      "id": "8d1f6a52-3c1e-4b7e-9a51-1f2c3d4e5f60",
      "name": "KPL West Finals",
      "teamA": "Alpha",
      "teamB": "Bravo",
      "bestOf": 5,
      "status": "complete"
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 25
}
GET/api/v1/tournaments/{id}赛事数据

One tournament series with all its games: bans, picks, lanes, winner, duration.

AI 工具:get_tournament

参数位置简介
id 必填地址The id of the thing.
响应示例
{
  "id": "8d1f6a52-3c1e-4b7e-9a51-1f2c3d4e5f60",
  "teamA": {
    "name": "Alpha"
  },
  "teamB": {
    "name": "Bravo"
  },
  "bestOf": 5,
  "gameMode": "global-ban-pick",
  "status": "complete",
  "games": [
    {
      "number": 1,
      "bans": {
        "blue": [
          "h105"
        ],
        "red": [
          "h199"
        ]
      },
      "picks": {
        "blue": [
          "h101"
        ],
        "red": [
          "h120"
        ]
      },
      "winner": "blue",
      "durationSeconds": 1104
    }
  ]
}

你的训练赛 scrims

GET/api/v1/series你的训练赛

Your series, and the ones a team of yours shared.

AI 工具:list_series

参数位置简介
page查询The page of the list, from 1.
pageSize查询How many entries a page holds.
view查询summary (lighter) or full.
sort查询updated, oldest or created.
status查询active, complete or draw.
mode查询The game mode: global-ban-pick, free-for-all or classic.
draftMode查询The draft mode of the series.
q查询Words to look for.
from查询The first day, YYYY-MM-DD.
to查询The last day, YYYY-MM-DD.
响应示例
{
  "items": [
    {
      "id": "16f3cb87-fb93-4a70-91e0-01f01f863f11",
      "teamA": "Alpha",
      "teamB": "Bravo",
      "bestOf": 3,
      "winsRequired": 2,
      "gameMode": "free-for-all",
      "draftMode": "solo",
      "status": "active",
      "score": {
        "teamA": 1,
        "teamB": 0
      },
      "gamesCount": 1,
      "role": "owner",
      "createdAt": "2026-10-31T20:15:23.262Z",
      "updatedAt": "2026-10-31T20:45:00.000Z"
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 20
}
GET/api/v1/series/{id}你的训练赛

One series with every game of it.

AI 工具:get_series

参数位置简介
id 必填地址The id of the thing.
响应示例
{
  "id": "16f3cb87-fb93-4a70-91e0-01f01f863f11",
  "createdAt": "2026-10-31T20:15:23.262Z",
  "updatedAt": "2026-10-31T20:45:00.000Z",
  "teamA": {
    "name": "Alpha"
  },
  "teamB": {
    "name": "Bravo"
  },
  "bestOf": 3,
  "winsRequired": 2,
  "gameMode": "free-for-all",
  "draftMode": "solo",
  "status": "active",
  "games": [],
  "currentGame": null,
  "version": 4,
  "serverTime": 1793477723366,
  "viewer": {
    "role": "owner",
    "side": null,
    "canDrive": true
  }
}
GET/api/v1/stats/overview你的训练赛

The statistics of your scrims (figures under the minimum sample are withheld).

AI 工具:scrim_stats_overview

参数位置简介
status查询active, complete or draw.
mode查询The game mode: global-ban-pick, free-for-all or classic.
draftMode查询The draft mode of the series.
q查询Words to look for.
from查询The first day, YYYY-MM-DD.
to查询The last day, YYYY-MM-DD.
minGames查询The fewest games a figure needs to be shown.
响应示例
{
  "label": "Your scrims",
  "minGames": 30,
  "seriesCount": 14,
  "gamesCount": 37,
  "totalDurationSeconds": 42180,
  "averageDurationSeconds": 1140,
  "shortestSeconds": 702,
  "longestSeconds": 1598,
  "blueWins": 20,
  "redWins": 17,
  "blueWinRate": 0.541,
  "byMode": {
    "global-ban-pick": 30,
    "free-for-all": 7,
    "classic": 0
  }
}
GET/api/v1/stats/heroes你的训练赛

The per-hero statistics of your scrims.

AI 工具:scrim_stats_heroes

参数位置简介
status查询active, complete or draw.
mode查询The game mode: global-ban-pick, free-for-all or classic.
draftMode查询The draft mode of the series.
q查询Words to look for.
from查询The first day, YYYY-MM-DD.
to查询The last day, YYYY-MM-DD.
minGames查询The fewest games a figure needs to be shown.
page查询The page of the list, from 1.
pageSize查询How many entries a page holds.
order查询How the heroes are sorted (presence by default).
hero查询Only the heroes whose name holds these letters.
响应示例
{
  "label": "Your scrims",
  "minGames": 30,
  "totalGames": 37,
  "sort": "presence",
  "rows": [
    {
      "heroId": "h105",
      "picks": 12,
      "bans": 9,
      "wins": 7,
      "presence": 0.568
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 10
}
GET/api/v1/heroes/{id}/scrims你的训练赛

What your scrims say of one hero: picks, bans, synergies, matchups.

AI 工具:hero_scrim_stats

参数位置简介
id 必填地址The id of the thing.
响应示例
{
  "label": "Your scrims",
  "minGames": 30,
  "seriesCount": 9,
  "totalGames": 37,
  "picked": 12,
  "wins": 7,
  "losses": 5,
  "banned": 9,
  "winRate": null,
  "pickRate": null,
  "banRate": null,
  "insufficient": true,
  "lanes": [],
  "synergies": [],
  "matchups": []
}

你的强度榜 tier-lists

GET/api/v1/tier-lists你的强度榜

Your tier lists, and the ones shared with you.

AI 工具:list_my_tier_lists

参数位置简介
page查询The page of the list, from 1.
pageSize查询How many entries a page holds.
lane查询Only the lists of one lane.
q查询Words to look for.
响应示例
{
  "items": [
    {
      "id": "44d20ad7-4f74-4207-80f2-6e0b352ba662",
      "name": "Farm lane, season 4",
      "lane": "Farm Lane",
      "updatedAt": "2026-10-31T20:15:23.224Z"
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 50
}
GET/api/v1/tier-lists/{id}你的强度榜

One tier list with its placements.

AI 工具:get_my_tier_list

参数位置简介
id 必填地址The id of the thing.
响应示例
{
  "id": "44d20ad7-4f74-4207-80f2-6e0b352ba662",
  "createdAt": "2026-10-31T20:15:23.224Z",
  "updatedAt": "2026-10-31T20:15:23.224Z",
  "name": "Farm lane, season 4",
  "lane": "Farm Lane",
  "tiers": [
    {
      "id": "t1",
      "label": "S",
      "heroes": [
        "h105"
      ]
    }
  ],
  "unranked": [
    "h199"
  ],
  "version": 0,
  "viewer": {
    "role": "owner",
    "canEdit": true,
    "canDelete": true,
    "canShare": true
  }
}

你的战队 teams

GET/api/v1/me/teams你的战队

The teams you belong to, with your role in each.

AI 工具:my_teams

响应示例
{
  "items": [
    {
      "id": "07db7f13-4df0-4d4e-b6c9-453d26c41fe5",
      "name": "Learn Squad",
      "tag": "LERN",
      "region": "EU",
      "level": "amateur",
      "memberCount": 5,
      "myRole": "owner"
    }
  ]
}
GET/api/v1/teams你的战队

The teams of the community.

AI 工具:list_teams

参数位置简介
q查询Words to look for.
page查询The page of the list, from 1.
pageSize查询How many entries a page holds.
level查询Only the teams of one level.
region查询Only the teams of one region.
响应示例
{
  "items": [
    {
      "id": "07db7f13-4df0-4d4e-b6c9-453d26c41fe5",
      "name": "Learn Squad",
      "tag": "LERN",
      "region": "EU",
      "level": "amateur",
      "memberCount": 5
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 18
}
GET/api/v1/teams/{id}你的战队

One team: its members and its settings that you may see.

AI 工具:get_team

参数位置简介
id 必填地址The id of the thing.
响应示例
{
  "id": "07db7f13-4df0-4d4e-b6c9-453d26c41fe5",
  "name": "Learn Squad",
  "tag": "LERN",
  "description": "",
  "region": "EU",
  "timezone": "UTC+1",
  "languages": [
    "en"
  ],
  "level": "amateur",
  "maxMembers": 10,
  "createdAt": 1793477723239,
  "members": [
    {
      "name": "Kai",
      "tag": "YHX7EA",
      "role": "owner",
      "lane": "Jungle"
    }
  ],
  "myRole": "owner"
}
GET/api/v1/teams/{id}/events你的战队

The agenda of one of your teams.

AI 工具:team_events

参数位置简介
id 必填地址The id of the thing.
响应示例
{
  "items": [
    {
      "id": "2b9c0e3a-6f0d-4a8e-b1c2-3d4e5f6a7b8c",
      "title": "Scrim vs Bravo",
      "startsAt": 1793563200000
    }
  ],
  "canSchedule": true
}
GET/api/v1/teams/{id}/series你的战队

The series that this team shared with its members.

AI 工具:team_series

参数位置简介
id 必填地址The id of the thing.
响应示例
{
  "items": [],
  "total": 0,
  "page": 1,
  "pageSize": 20
}
GET/api/v1/me/agenda你的战队

Your agenda: the events of all your teams.

AI 工具:my_agenda

参数位置简介
from查询The start of the window, in milliseconds since 1970.
to查询The end of the window, in milliseconds since 1970.
响应示例
{
  "items": [
    {
      "id": "2b9c0e3a-6f0d-4a8e-b1c2-3d4e5f6a7b8c",
      "title": "Scrim vs Bravo",
      "startsAt": 1793563200000
    }
  ]
}

你的训练 training

GET/api/v1/training/focus你的训练

The heroes you work on.

AI 工具:training_focus

响应示例
{
  "heroIds": [
    "h105",
    "h120"
  ]
}
GET/api/v1/training/notes你的训练

Your training notebook.

AI 工具:training_notes

响应示例
{
  "notes": []
}
GET/api/v1/training/combos你的训练

The combos you have acquired.

AI 工具:training_combos

响应示例
{
  "progress": {}
}
GET/api/v1/training/combos/review你的训练

The combos that are due for a check.

AI 工具:training_combos_due

响应示例
{
  "now": 1793477503716,
  "due": [],
  "dueTotal": 0,
  "toLearn": [],
  "toLearnTotal": 0,
  "skills": {}
}
GET/api/v1/training/maps你的训练

The maps of the situations.

AI 工具:training_maps

响应示例
{
  "maps": []
}
GET/api/v1/training/scenarios你的训练

The situations prepared by the staff.

AI 工具:list_training_scenarios

响应示例
{
  "scenarios": []
}
GET/api/v1/training/scenarios/{id}你的训练

One situation.

AI 工具:get_training_scenario

参数位置简介
id 必填地址The id of the thing.
响应示例
{
  "id": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
  "title": "Defend the second tower",
  "mapId": "main"
}
GET/api/v1/training/reflex你的训练

Your reflex training results.

AI 工具:training_reflex

响应示例
{
  "exercises": {
    "reaction": {
      "runs": 12,
      "best": 231,
      "last": []
    }
  },
  "doneToday": [],
  "today": {
    "runs": 3,
    "minutes": 4
  },
  "week": {
    "runs": 12,
    "minutes": 18
  },
  "streak": 2,
  "teams": []
}
GET/api/v1/space你的训练

Your personal space (the builds and notes you keep).

AI 工具:my_space

响应示例
{
  "tierLists": [],
  "builds": [],
  "training": {
    "focus": [],
    "notes": [],
    "combos": [],
    "reflex": {
      "streak": 0,
      "best": {}
    }
  },
  "links": [],
  "limits": {
    "builds": 300,
    "buildsPerHero": 30,
    "links": 20,
    "days": [
      7
    ]
  }
}

你的账号 account

GET/api/v1/me你的账号

Who the key belongs to (tag and name, never the email), its scopes and its expiry.

AI 工具:whoami

响应示例
{
  "account": {
    "tag": "YHX7EA",
    "name": "Kai"
  },
  "key": {
    "id": "25bf6418-4cbf-448a-baed-30349809947e",
    "name": "Stats bot",
    "scopes": [
      "game",
      "competitive"
    ],
    "expiresAt": 1801253503341
  }
}

导出

带样式的报告 · 可重新导入

格式

该文件包含系列赛数据:请通过 训练赛 → 导入系列赛 重新导入。请勿重新保存或打印,否则数据会丢失。