| 接口地址 |
https://api.wq.cgdey.cn/API/tarot_card/tarot_card.php
|
|---|---|
| 请求方式 | GET |
| 返回格式 | JSON |
| 名称 | 必填 | 类型 | 描述 |
|---|---|---|---|
| uid | 否 | integer | 指定塔罗牌 UID,不传则随机返回。 |
| img_code | 否 | string | 图片唯一编码,传入后直接跳转到图片资源。 |
| 名称 | 类型 | 描述 |
|---|---|---|
| name | string | 塔罗牌中文名称。 |
| en_name | string | 塔罗牌英文名称。 |
| position | string | 牌位,正位或逆位。 |
| meaning | string | 塔罗牌牌意。 |
| img | string | 当前接口代理后的图片地址。 |
| advice | string | 塔罗牌建议。 |
| past_advice | string | 过去建议。 |
| present_advice | string | 现在建议。 |
| future_advice | string | 未来建议。 |
| situation_advice | string | 情况建议。 |
| action_advice | string | 行动建议。 |
| result_advice | 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/tarot_card/tarot_card.php');
<?php
$ch = curl_init('https://api.wq.cgdey.cn/API/tarot_card/tarot_card.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/tarot_card/tarot_card.php')
print(response.text)
import requests
response = requests.post(
'https://api.wq.cgdey.cn/API/tarot_card/tarot_card.php',
json={'key': 'value'}
)
print(response.text)
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.wq.cgdey.cn/API/tarot_card/tarot_card.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/tarot_card/tarot_card.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());