猜灯谜
历史悠久的汉族民俗文娱

接口地址: https://58.linkpc.net/doc/caizimi.html

返回格式: JSON

请求方式: GET/POST

请求示例: https://58.linkpc.net/api/caizimi

请求参数说明:

名称 必填 类型 说明

返回参数说明:

名称 类型 说明
riddle String 谜语
answer String 谜底
disturb String 干扰项
description String 详细描述
type String 分类

返回示例:

{
"code": 200,
"msg": "success",
"data": {
"riddle": "知我情",
"answer": "悟",
"disturb": "唔吾心痦梧语浯珸峿焐捂龉牾伍晤俉娪忢寤啎逜郚五",
"description": "“我”在古代称“吾”,情意多半潜藏在心中,知,有领悟、知会之意,离合字“悟吾心”符合谜面意思。",
"type": "打一字"
}
}

错误码格式说明:

名称 类型 说明

代码示例:

<?php
header('Content-type: application/json; charset=utf-8');
date_default_timezone_set('PRC');
$url = 'https://58.linkpc.net/api/caizimi';
$type = isset($_GET['type']) ? $_GET['type'] : '';
if ($type == 'json' || $type == 'JSON') {
$result = file_get_contents($url . '?type=json');
echo htmlspecialchars($result);
} else {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
curl_close($ch);