通过该API接口可以查询到苹果、小米/红米、华为/荣耀、三星、OPPO/真我/一加、VIVO/IQOO设备的型号、颜色、容量信息。
一、获取API秘钥
1、点击进入果查查API官网,用邮箱注册账号。
果查查API官网
2、登录成功后,点击左侧“用户中心”菜单,获取专属API密钥
果查查API秘钥
二、使用API
1、请求信息
(1)请求地址:
https://open-api.51gcc.com
(2)请求方法:
POST
(3)请求参数
|
sn |
是 |
序列号/IMEI/MEID或MAC |
设备的序列号/IMEI/MEID或MAC |
|
api_id |
是 |
api_id |
2 |
|
api_test |
是 |
是否模拟请求返回示例数据。1=是;0=否 |
1 |
|
api_key |
是 |
用户中心的API密钥 |
自己的API密钥 查看秘钥 |
2、响应结果
(1)结果字段说明:
|
image |
string |
设备图片 |
https://snapi.51gcc.com/storage/site/no_name.png |
|
key |
string |
字段名 |
model |
|
text |
string |
字段含义 |
型号 |
|
value |
string|array |
字段含义对应的查询结果 |
iPhone XR |
(2)成功示例:
{
"code": 200,
"msg": "ok",
"data": {
"image": "https://snapi.51gcc.com/storage/site/no_name.png",
"result": [
{
"key": "model",
"text": "型号",
"value": "iPhone XR",
"notice": ""
},
{
"key": "capacity",
"text": "容量",
"value": "256GB",
"notice": ""
},
{
"key": "color",
"text": "颜色",
"value": "黑色",
"notice": ""
}
],
"other_result": []
}
}
(3)失败示例:
{
"code": 403,
"msg": "签名错误",
"time": 1770703778,
"data": []
}
(4)状态码说明
|
200 |
请求成功,服务器已成功处理了请求。 |
|
210 |
参数错误。 |
|
220 |
系统功能异常。 |
|
230 |
数据获取失败。 |
|
403 |
服务器拒绝请求。这可能是由于缺少必要的认证凭据(如API密钥)或权限不足。 |
|
404 |
请求的资源未找到。请检查您的请求地址是否正确。 |
|
429 |
请求过于频繁。您已超出速率限制,请稍后再试。 |
|
500 |
服务器内部错误。服务器在执行请求时遇到了问题。 |
|
600 |
API账户余额不足。 |
三、调用示例
PHP示例
<?php
$url = 'https://open-api.51gcc.com/api.php';
$params = ['sn' => 'YOUR_VALUE', 'api_id' => '2', 'api_test' => 'YOUR_VALUE', 'api_key' => 'YOUR_VALUE', ];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Python示例
import requests
url = "https://open-api.51gcc.com/api.php"
params = {
'sn': 'YOUR_VALUE',
'api_id': '2',
'api_test': 'YOUR_VALUE',
'api_key': 'YOUR_VALUE',
}
response = requests.post(url, data=params)
print(response.text)
Java示例
import java.io.*;
import java.net.*;
import java.util.*;
public class ApiClient {
public static void main(String[] args) throws Exception {
String url = "https://open-api.51gcc.com/api.php";
Map<String, String> params = new HashMap<>();
params.put("sn", "YOUR_VALUE");
params.put("api_id", "2");
params.put("api_test", "YOUR_VALUE");
params.put("api_key", "YOUR_VALUE");
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setDoOutput(true);
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0) postData.append('&');
postData.append(URLEncoder.encode(param.getKey(), "UTF-8"));
postData.append('=');
postData.append(URLEncoder.encode(param.getValue(), "UTF-8"));
}
try (DataOutputStream wr = new DataOutputStream(con.getOutputStream())) {
wr.writeBytes(postData.toString());
}
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
}
}
网硕互联帮助中心




评论前必须登录!
注册