稳定 · 快速 · 实时

洛克王国数据查询 API

为洛克王国玩家与开发者提供实时、准确的商品/商人等游戏数据查询接口

查看接口 调用示例
实时数据

游戏数据自动采集与缓存,保证查询结果的时效性与准确性

密钥鉴权

通过 API Key 进行身份验证,支持 IP 白名单与月度配额控制

简单易用

标准 RESTful 风格,JSON 响应,轻松集成到任意语言与平台

接口清单 · 共 3 个可用接口

下方为当前已开放的接口,调用前请先获取 API Key

GET / POST 远行商人
/api/roco/merchant
查询当日远行商人商品快照
GET / POST 洛克家园数据
/api/roco/home
按 UID 查询家园数据(opcode 0x8105 -> 0x8106)
GET / POST 洛克宠物数据
/api/roco/pet
按 UID、GID、PET_CFG_ID 查询宠物数据(opcode 0x02F1 -> 0x02F2)

调用示例

所有接口均需携带 API Key,支持三种方式(任选其一):
① 请求头 X-API-Key ② 查询参数 ?api_key= ③ 查询参数 ?key=

# 推荐:单行写法,避免 \ 续行符在复制时失效 curl -X GET "https://roco.fzxywl.cn/api/roco/merchant" -H "X-API-Key: 你的API密钥" # 不便加请求头时,也可改用查询参数(浏览器地址栏可直接打开) curl "https://roco.fzxywl.cn/api/roco/merchant?key=你的API密钥"
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://roco.fzxywl.cn/api/roco/merchant'); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'X-API-Key: 你的API密钥', ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 仅本地调试时关闭 $response = curl_exec($ch); $data = json_decode($response, true); print_r($data); curl_close($ch); // 或者用查询参数(file_get_contents 写法更简洁) $data = json_decode(file_get_contents('https://roco.fzxywl.cn/api/roco/merchant?key=你的API密钥'), true);
# 需要先安装:pip install requests import requests url = 'https://roco.fzxywl.cn/api/roco/merchant' # 方式一:请求头携带密钥 headers = {'X-API-Key': '你的API密钥'} resp = requests.get(url, headers=headers, timeout=10) print(resp.json()) # 方式二:查询参数携带密钥 resp = requests.get(url, params={'key': '你的API密钥'}, timeout=10) print(resp.json())
// Java 11+,使用内置 HttpClient,无需额外依赖 import java.net.URI; import java.net.http.*; import java.time.Duration; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://roco.fzxywl.cn/api/roco/merchant")) .header("X-API-Key", "你的API密钥") .timeout(Duration.ofSeconds(10)) .GET() .build(); HttpClient client = HttpClient.newHttpClient(); HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); // 不便加请求头时,改用查询参数: // URI.create("https://roco.fzxywl.cn/api/roco/merchant?key=你的API密钥")
0.010516s