博主头像
情酱の小窝

努力生活,慢慢变好

王者荣耀战力API

引言

今天逛营地的时候看到工具里有个战力查询,立马就心血来潮想搞个api接口查询
直接ProxyPin启动
结果真给我抓到东西了

抓包结果
抓包结果

分析接口

如图得到了
API:https://kohcamp.qq.com/game/honor/ranklist
request body:

{
  "recommendPrivacy": 0,
  "areaId": "1",
  "adcode": 140425,
  "roleId": "2018705410",
  "heroId": 115
}

这里的adcode即是地区代码,可在城市adcode大全查询
heroid即为王者英雄id 相关文件从王者官网找到 herolist.json
areaid为区服id

1: qq安卓 2: ios安卓 3: qq微信 4: ios微信

后续

后续可玩性就很高了,这里大佬们可以自由发挥,我写了一个简单PHP接口供大家参考

<?php
//Author: QingJ
//GitHub:https://github.com/QingJ01/

// 需要获取的 userId 和 token
$userId = '你的userid';
$token = '你的token';

// 从 GET 请求中获取参数
$adcode = isset($_GET['adcode']) ? $_GET['adcode'] : '310000'; // adcode代码
$areaId = isset($_GET['areaId']) ? $_GET['areaId'] : '1'; // 1: qq安卓, 2: ios安卓, 3: qq微信, 4: ios微信
$heroId = isset($_GET['heroId']) ? $_GET['heroId'] : '505'; // 英雄id

// 请求参数
$params = [
    'adcode' => $adcode,
    'roleId' => '2018705410',
    'recommendPrivacy' => 0,
    'areaId' => $areaId,
    'heroId' => $heroId
];

// 初始化 cURL
$ch = curl_init();

// 设置 cURL 选项
curl_setopt($ch, CURLOPT_URL, 'https://kohcamp.qq.com/game/honor/ranklist');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'userId: ' . $userId,
    'token: ' . $token
]);

// 执行 cURL 请求并获取响应
$response = curl_exec($ch);

// 检查 cURL 错误
if (curl_errno($ch)) {
    header('Content-Type: application/json');
    echo json_encode(['error' => curl_error($ch)]);
} else {
    // 解析并输出响应
    header('Content-Type: application/json');
    echo $response;
}

curl_close($ch);
王者荣耀战力API
https://blog.byebug.cn/archives/11/
本文作者 情酱
发布时间 2024-08-03
许可协议 CC BY-NC-SA 4.0
已有 2 条评论
  1. 评论头像

    建议后续持续追踪此话题,形成系列研究。

    zlbmquskhz March 3rd, 2025 at 01:47 am 回复
  2. 评论头像

    Hi, this weekend is fastidious in favor of me, as this point in time
    i am reading this enormous informative article here at my home.

    casino en ligne
    I am not sure where you're getting your information, but great topic.
    I needs to spend some time learning much more or understanding more.

    Thanks for fantastic info I was looking for this info
    for my mission.
    casino en ligne
    constantly i used to read smaller articles or reviews that
    also clear their motive, and that is also happening
    with this paragraph which I am reading here.
    casino en ligne
    WOW just what I was looking for. Came here by searching
    for sss
    casino en ligne
    I know this web page gives quality based content
    and extra information, is there any other web site which offers these information in quality?

    casino en ligne
    Hello, everything is going nicely here and ofcourse every one
    is sharing data, that's actually fine, keep up writing.

    casino en ligne
    Good post. I learn something totally new and challenging
    on websites I stumbleupon everyday. It's always interesting to read through articles from other writers and practice
    a little something from other websites.
    casino en ligne France
    You should be a part of a contest for one of the greatest websites on the web.
    I will highly recommend this site!
    casino en ligne francais
    Hey There. I discovered your blog the use of msn. This is a
    very neatly written article. I will be sure to bookmark it and return to read
    extra of your useful info. Thanks for the post. I will definitely return.
    casino en ligne
    Hello mates, its wonderful article concerning educationand
    completely explained, keep it up all the time.
    casino en ligne fiable

    casino en ligne May 21st, 2025 at 02:29 am 回复
发表新评论