查询历史数据记录,支持按姓名、电话筛选。调用地址:/API/historicalDataQuery.php
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| phone | string | 否 | 按电话查询 |
| name | string | 否 | 按姓名模糊查询 |
| page | integer | 否 | 页码,默认1 |
| limit | integer | 否 | 每页条数,默认10,最大100 |
| apikey | string | 否 | 密钥(私有接口需传) |
| 状态码 | 说明 |
|---|---|
| 200 | 请求成功,服务器已成功处理了请求。 |
| 403 | 服务器拒绝请求。这可能是由于缺少必要的认证凭据(如API密钥)或权限不足。 |
| 404 | 请求的资源未找到。请检查您的请求地址是否正确。 |
| 429 | 请求过于频繁。您已超出速率限制,请稍后再试。 |
| 500 | 服务器内部错误。服务器在执行请求时遇到了问题。 |
此处将显示接口返回结果...
import java.io.*;
import java.net.*;
public class ApiGetExample {
public static void main(String[] args) throws Exception {
String baseUrl = "https://xmssjh.com/API/historicalDataQuery.php";
StringBuilder query = new StringBuilder();
query.append("phone=" + URLEncoder.encode("YOUR_VALUE", "UTF-8") + "&");
query.append("name=" + URLEncoder.encode("YOUR_VALUE", "UTF-8") + "&");
query.append("page=" + URLEncoder.encode("YOUR_VALUE", "UTF-8") + "&");
query.append("limit=" + URLEncoder.encode("YOUR_VALUE", "UTF-8") + "&");
query.append("apikey=" + URLEncoder.encode("YOUR_VALUE", "UTF-8") + "&");
if (query.length() > 0) query.deleteCharAt(query.length() - 1);
String finalUrl = baseUrl + "?" + query;
HttpURLConnection conn = (HttpURLConnection) new URL(finalUrl).openConnection();
conn.setRequestMethod("GET");
int status = conn.getResponseCode();
System.out.println("HTTP Status: " + status);
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder response = new StringBuilder();
while ((line = in.readLine()) != null) {
response.append(line);
}
in.close();
System.out.println(response.toString());
}
}
<?php
$url = 'https://xmssjh.com/API/historicalDataQuery.php';
$params = [
'phone' => 'YOUR_VALUE',
'name' => 'YOUR_VALUE',
'page' => 'YOUR_VALUE',
'limit' => 'YOUR_VALUE',
'apikey' => 'YOUR_VALUE',
];
$url .= '?' . http_build_query($params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($response === false) {
echo 'CURL error: ' . curl_error($ch);
} else {
echo "HTTP Status: {$httpCode}\n";
echo $response;
}
curl_close($ch);
?>
import requests
url = "https://xmssjh.com/API/historicalDataQuery.php"
params = {
'phone': 'YOUR_VALUE',
'name': 'YOUR_VALUE',
'page': 'YOUR_VALUE',
'limit': 'YOUR_VALUE',
'apikey': 'YOUR_VALUE',
}
resp = requests.get(url, params=params)
print('HTTP Status:', resp.status_code)
print(resp.text)
const url = new URL('https://xmssjh.com/API/historicalDataQuery.php');
const params = {
'phone': 'YOUR_VALUE',
'name': 'YOUR_VALUE',
'page': 'YOUR_VALUE',
'limit': 'YOUR_VALUE',
'apikey': 'YOUR_VALUE',
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
fetch(url)
.then(response => {
console.log('HTTP Status:', response.status);
return response.text();
})
.then(data => console.log(data))
.catch(error => console.error('Error:', error));