实时数据
游戏数据自动采集与缓存,保证查询结果的时效性与准确性
密钥鉴权
通过 API Key 进行身份验证,支持 IP 白名单与月度配额控制
简单易用
标准 RESTful 风格,JSON 响应,轻松集成到任意语言与平台
调用示例
所有接口均需携带 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密钥")