跳转到内容

游戏记录

游戏记录是官方游戏数据的快照,由 Haneoka 自己的号池采集。所有读取都是公开的,不需要密钥。

请求使用 region,因为每个区都是独立的游戏服务器:

region服务器
jpJP
twTW/HK/MO
enEN Regions
krKR

region 和资料目录的 jp、intl 服务器是两回事:tw、en、kr 共用 Global 资料目录。

数据读自已存储的快照,所以请求不会等待游戏。还没采集到的内容会进入队列,并返回 503:

{ "error": { "kind": "pending", "retryAfter": 30 } }

等待 retryAfter 秒后重复同一请求。多数读取会在几分钟内完成。

正在进行的活动、起止时间和它开放的榜单。活动之间 event 为 null。

GET /api/v1/game/records/{region}/events/current
尚未发送

总榜或单曲榜的前 100 名及其队伍。

GET /api/v1/game/records/{region}/events/{eventId}/total/latest
尚未发送
GET /api/v1/game/records/{region}/events/{eventId}/challenges/{challengeId}/latest
字段含义
rows[].rank、tied名次,以及是否与其他行同名次
rows[].scoreExact十进制字符串形式的分数,总分超过 2^53 时请用它
rows[].profileId传给玩家接口
rows[].profileCard名片,可能为 null
rows[].cards五个队伍位置:成员、留影 ID 及养成值
observedAtMs、stale采集时间,以及是否已过期

开积分排名的活动有第三个榜。行带 point,没有队伍;其他活动返回 404。

GET /api/v1/game/records/{region}/events/{eventId}/latest
尚未发送

每次读取 100 名。start 会对齐到所在窗口的起始名次,maxRank 在看到榜尾之前为 null,search 按玩家 ID 查找前 2000 名。只有活动开放积分榜时才采集窗口。

GET /api/v1/game/records/{region}/events/{eventId}/points/ranking
尚未发送
GET /api/v1/game/records/{region}/events/{eventId}/points/search
尚未发送

一首歌的前 100 名。

GET /api/v1/game/records/{region}/songs/{musicId}/ranking
尚未发送

一个联赛的榜单,每次 100 行。bandId 是联赛对应的乐队,start 是起始名次。

GET /api/v1/game/records/{region}/arena/seasons/{seasonId}/leagues/{bandId}/ranking
尚未发送

行结构和活动榜相同,用 point 代替分数。

统计达到每个分数线的人数。首次统计返回 202,按 Retry-After 重试。

GET /api/v1/game/records/{region}/arena/seasons/{seasonId}/leagues/{bandId}/population
尚未发送

在前 searchedTo 名中查找游戏内 ID。不在范围内时 row 为 null。

GET /api/v1/game/records/{region}/arena/seasons/{seasonId}/leagues/{bandId}/search
尚未发送

用游戏内显示的 ID 查询公开资料。

GET /api/v1/game/records/{region}/players/{profileId}
尚未发送

首次读取某位玩家时可能返回 pending。记录超过六小时后会刷新。

profileCard.pages[].downloadUrl 提供名片每一页的 PNG 下载。

import { createGameClient } from "https://haneoka.org/tools/api-client.js";
const game = createGameClient({ region: "jp" });
const { event } = await game.currentEvent();
const board = await game.eventRanking(event.id);
for (const row of board.rows.slice(0, 3)) console.log(row.rank, row.name, row.scoreExact);

客户端还提供 profile、songRanking、challengeRanking 和 arenaRanking。