| 接口地址 |
https://api.wq.cgdey.cn/API/zhuge/zhuge.php
|
|---|---|
| 请求方式 | GET |
| 返回格式 | JSON |
| 名称 | 必填 | 类型 | 描述 |
|---|---|---|---|
| id | 是 | integer | 固定接口编号,必须传入 10018883。 |
| key | 是 | string | 接口调用密钥。 |
| 名称 | 类型 | 描述 |
|---|---|---|
| res1 | string | 签序号,例如:第26签。 |
| res2 | string | 签文内容(吉凶、诗文、注释)。 |
| res3 | string | 解签内容(功名、行人、婚姻等各项解析)。 |
| img | string | 签文配图地址。 |
| HTTP 状态 | 业务状态 | 说明 |
|---|---|---|
| 200 | success | 请求成功,已返回诸葛神签数据。 |
| 503 | maintain | 接口临时维护中。 |
| 状态码 | 错误标识 | 说明 |
|---|---|---|
| 400 | bad_request | 请求格式错误或参数不符合要求。 |
| 429 | too_many_requests | 请求过于频繁,请稍后重试。 |
| 500 | server_error | 服务器内部异常,未正常返回内容。 |
<?php
echo file_get_contents('https://api.wq.cgdey.cn/API/zhuge/zhuge.php');
<?php
$ch = curl_init('https://api.wq.cgdey.cn/API/zhuge/zhuge.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['key' => 'value']));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import requests
response = requests.get('https://api.wq.cgdey.cn/API/zhuge/zhuge.php')
print(response.text)
import requests
response = requests.post(
'https://api.wq.cgdey.cn/API/zhuge/zhuge.php',
json={'key': 'value'}
)
print(response.text)
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.wq.cgdey.cn/API/zhuge/zhuge.php"))
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.wq.cgdey.cn/API/zhuge/zhuge.php"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString("{\"key\":\"value\"}"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());