王者战力查询 API 接入文档wzry
王者荣耀全国战力查询,一接口聚合「英雄列表 + 区服战力分布」2 大功能。 • action=heroes — 返回 130+ 个英雄完整目录(中文名 / ename / 称号 / 头像 URL),优先腾讯官方源 https://pvp.qq.com/web201605/js/herolist.json • action=query — 查询某英雄在某区服的全国战力分布数据,返回 90 条左右的省市区战力榜(含同地区相近排名) 支持 4 大区服: · aqq = Android QQ · awx = Android 微信 · iqq = iOS QQ · iwx = iOS 微信 查询类型: · all = 完整 heroList(按 level 混合排列,约 90 项) · min = 各级(省/市/区)最低战力 + 相近排名(rank ≤ +100) · max = 各级(省/市/区)最高战力 + 相近排名
1. 基本信息
| 接口地址 | https://v1.apizero.cn/api/wzry |
|---|---|
| 请求方法 | GET |
| 分类 | life |
| 提供方 | 极数本源 |
| 计费模式 | 免费试用 |
| 单次消耗 | 0 积分 |
| 起步价 | — |
| QPS 限制 | 5 req/s |
| 每日免费额度 | 200 次(已认证用户) |
| 匿名每日额度 | 50 次(无 API Key) |
| VIP 免费 | 否 |
| 调用次数 |
2. 认证
匿名每日 50 次、QPS 2;登录用户每日 200 次、QPS 5(全部免费)。英雄列表缓存 24h、战力数据缓存 1h。
获取 API Key:登录 https://apizero.cn/account/keys
3. 请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
action | string | 是 | 操作类型:heroes=英雄列表 / query=战力查询 | query |
hero | string | 否 | 英雄中文名(如「赵云」);action=query 时与 hero_id 二选一必传 | 赵云 |
hero_id | integer | 否 | 英雄 ename(如赵云=107);action=query 时与 hero 二选一必传,hero_id 优先级更高 | — |
zone | string | 否 | 区服代码:aqq=Android QQ / awx=Android 微信 / iqq=iOS QQ / iwx=iOS 微信;action=query 必填 | aqq |
type | string | 否 | 返回类型:all=完整列表(默认)/ min=最低战力 / max=最高战力 | all |
4. 请求头
| Header | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
Authorization | string | 否 | API Key 鉴权头,格式 Bearer sk_live_xxx;匿名调用时可省略(每日 50 次免费) | Bearer sk_live_xxxxxxxxxxxxxx |
5. 请求示例
以下 5 种语言示例都是可直接运行的,只需把 YOUR_API_KEY 替换为实际 Key。
cURL
curl "https://v1.apizero.cn/api/wzry?action=query&hero=%E8%B5%B5%E4%BA%91&hero_id=&zone=aqq&type=all&key=YOUR_API_KEY"Python
import requests
resp = requests.get(
"https://v1.apizero.cn/api/wzry",
params={
"action": "query",
"hero": "赵云",
"hero_id": "",
"zone": "aqq",
"type": "all",
"key": "YOUR_API_KEY",
},
timeout=15,
)
resp.raise_for_status()
print(resp.json())JavaScript (Node.js)
// Node.js 18+ / 浏览器原生 fetch
const params = new URLSearchParams({
"action": "query",
"hero": "赵云",
"hero_id": "",
"zone": "aqq",
"type": "all",
"key": "YOUR_API_KEY",
});
const res = await fetch(`https://v1.apizero.cn/api/wzry?${params}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
console.log(data);Go
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://v1.apizero.cn/api/wzry", nil)
q := req.URL.Query()
q.Set("action", "query")
q.Set("hero", "赵云")
q.Set("hero_id", "")
q.Set("zone", "aqq")
q.Set("type", "all")
q.Set("key", "YOUR_API_KEY")
req.URL.RawQuery = q.Encode()
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}PHP
<?php
$url = "https://v1.apizero.cn/api/wzry?" . http_build_query([
"action" => "query",
"hero" => "赵云",
"hero_id" => "",
"zone" => "aqq",
"type" => "all",
"key" => "YOUR_API_KEY",
]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
$body = curl_exec($ch);
curl_close($ch);
$data = json_decode($body, true);
print_r($data);6. 响应字段
| 字段 | 类型 | 说明 | 示例 |
|---|---|---|---|
action | string | 回传 action 标识(heroes 或 query) | — |
count | number | 英雄总数(heroes) | — |
list | array | 英雄列表(heroes) | — |
list[].name | string | 英雄中文名(heroes) | — |
list[].ename | string | 英雄 ID(数字字符串,如 107)(heroes) | — |
list[].title | string | 英雄称号,如「苍天翔龙」(heroes) | — |
list[].avatar | string | 英雄头像 URL(gtimg.cn CDN)(heroes) | — |
hero | object | 查询的英雄信息(query);含 name/title/ename/avatar | — |
zone | object | 区服信息(query);含 code/system/platform | — |
type | string | 查询类型显示名(全部/最低战力/最高战力)(query) | — |
type_code | string | 查询类型代码(all/min/max)(query) | — |
syn_date | string | 上游数据同步日期 YYYY-MM-DD(query) | — |
rank_data | object|array | 战力数据;type=all 时为数组(90 条),type=min/max 时为 {extreme, similar} 结构 | — |
rank_data[].address | string | 地区名(如「浙江/金华市/磐安县」) | — |
rank_data[].level | string | 层级:province=省 / city=市 / district=区县 | — |
rank_data[].rank | number | 战力分数(数字越高战力越强) | — |
rank_data[].adcode | string | 地区编码 | — |
rank_data.extreme | object | type=min/max 时返回,含 province/city/district 各级第 1 名 | — |
rank_data.similar | object | type=min/max 时返回,含与 extreme 排名差距 ≤100 的相近排名列表 | — |
7. 响应示例
{
"code": 0,
"msg": "成功",
"data": {
"action": "query",
"hero": {
"name": "赵云",
"title": "苍天翔龙",
"ename": "107",
"avatar": "https:\/\/game.gtimg.cn\/images\/yxzj\/img201606\/heroimg\/107\/107.jpg"
},
"zone": {
"code": "aqq",
"system": "Android",
"platform": "QQ"
},
"type": "最低战力",
"type_code": "min",
"syn_date": "2026-05-06",
"rank_data": {
"extreme": {
"province": {
"address": "云南",
"level": "province",
"rank": 4500,
"adcode": "..."
},
"city": {
"address": "海南\/三亚市",
"level": "city",
"rank": 1800,
"adcode": "..."
},
"district": {
"address": "北京\/朝阳区",
"level": "district",
"rank": 800,
"adcode": "..."
}
},
"similar": {
"province": [
{
"address": "云南",
"rank": 4500
},
{
"address": "甘肃",
"rank": 4520
}
],
"city": [],
"district": []
}
}
},
"request_id": "abc123def456"
}8. 错误码
| code | status | 说明 |
|---|---|---|
4000 | — | 参数错误:action/zone/type 非法 / 缺少 hero+hero_id / 英雄未找到 |
4015 | — | 匿名调用每日额度用完,需要 API Key |
4029 | — | QPS 超限 |
4030 | — | 今日额度用完 |
5020 | — | 上游 HTTP 失败 / 双源英雄列表均不可用 |
5021 | — | 上游响应格式异常 / 该英雄在该区服暂无战力数据 |
9. 变更日志
- 1.0.0(2026-05-06)
- 首次上线,聚合英雄列表 + 全国战力 2 个 action
- 英雄列表双源容灾:腾讯官方失败自动降级 yxsaoma.com
- 内置 MD5 签名(warzoneSignKey20240515 + timestamp + 字典序拼接)
- 英雄列表缓存 24h、战力数据缓存 1h
- type=min/max 时按 level(省/市/区)分组,输出 extreme + similar(rank 差距 ≤ +100 相近排名)
- find_hero 同时支持 hero(中文名)和 hero_id(ename)两种定位方式
常见问题
王者战力查询 接口怎么免费使用?
未登录用户每个 IP 每天 50 次免费。登录用户创建 API Key 后每天 200 次免费,超额部分按点数计费(0 点/次)。
王者战力查询 支持哪些调用方式?
接口使用 GET 请求。文档提供 cURL、Python、JavaScript (Node.js)、Go、PHP 五种语言的可运行示例。也可以下载 /openapi.json 导入 Postman / Insomnia / Apifox 反向生成 SDK。
调用不限额么? QPS 是多少?
本接口 QPS 限制 5 req/s,每个 API Key 每日免费 200 次。需要更高额度可升级 VIP 套餐或联系售后提高 QPS。
这个接口跟自己直连上游有什么区别?
极数本源 作为中间层提供:统一鉴权(一个 Key 调所有接口)、统一计费(点数制)、统一限流、统一错误码、多上游自动切换。免去逐个对接上游、维护 Key、统计调用量的运维成本。