本接口为脑筋急转弯趣味答题场景提供完整的后端能力支持,包含随机出题、答案验证、积分统计、题目收藏等核心功能,接口采用 RESTful 设计风格,返回统一 JSON 格式数据,支持跨域调用,可快速集成到小程序、H5、APP 等前端应用中。
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| uid | string | 是 | 用户唯一标识,用于区分不同用户,可自定义(如用户 ID、设备 ID 等) | 1828222534 |
| action | string | 是 | 接口操作类型,支持:random/answer/check/next/collect/collect_list/score,对应:获取题目随机/回答/检查/下一个/收藏题目/收藏列表/得分 | random |
| answer | string | 否 | 验证答案,action为answer时有效 | 榴莲 |
| category | string | 否 | 题目分类筛选,可选值:fun(趣味)/intel(智力)/child(少儿),不传则随机 | 可为空 |
| difficulty | string | 否 | 难度筛选,可选值:easy(简单)/medium(中等)/hard(困难),不传则随机 | 可为空 |
| qid | string | 否 | 验证答案,action为answer时有效 | 284 |
[
{
"name": "uid",
"type": "string",
"required": true,
"description": "用户唯一标识,用于区分不同用户,可自定义(如用户 ID、设备 ID 等)",
"example": "1828222534"
},
{
"name": "action",
"type": "string",
"required": true,
"description": "接口操作类型,支持:random/answer/check/next/collect/collect_list/score,对应:获取题目随机/回答/检查/下一个/收藏题目/收藏列表/得分",
"example": "random"
},
{
"name": "answer",
"type": "string",
"required": false,
"description": "验证答案,action为answer时有效",
"example": "榴莲"
},
{
"name": "category",
"type": "string",
"required": false,
"description": "题目分类筛选,可选值:fun(趣味)/intel(智力)/child(少儿),不传则随机",
"example": "可为空"
},
{
"name": "difficulty",
"type": "string",
"required": false,
"description": "难度筛选,可选值:easy(简单)/medium(中等)/hard(困难),不传则随机",
"example": "可为空"
},
{
"name": "qid",
"type": "string",
"required": false,
"description": "验证答案,action为answer时有效",
"example": "284"
}
]
{"openapi":"3.1.1","info":{"title":"脑筋急转弯","description":"本接口为脑筋急转弯趣味答题场景提供完整的后端能力支持,包含随机出题、答案验证、积分统计、题目收藏等核心功能,接口采用 RESTful 设计风格,返回统一 JSON 格式数据,支持跨域调用,可快速集成到小程序、H5、APP 等前端应用中。","version":"1.0.0"},"paths":{"/v1/game_njjzw.php":{"get":{"summary":"脑筋急转弯","description":"本接口为脑筋急转弯趣味答题场景提供完整的后端能力支持,包含随机出题、答案验证、积分统计、题目收藏等核心功能,接口采用 RESTful 设计风格,返回统一 JSON 格式数据,支持跨域调用,可快速集成到小程序、H5、APP 等前端应用中。","parameters":[{"name":"uid","in":"query","required":true,"schema":{"type":"string","example":"1828222534"},"description":"用户唯一标识,用于区分不同用户,可自定义(如用户 ID、设备 ID 等)"},{"name":"action","in":"query","required":true,"schema":{"type":"string","example":"random"},"description":"接口操作类型,支持:random/answer/check/next/collect/collect_list/score,对应:获取题目随机/回答/检查/下一个/收藏题目/收藏列表/得分"},{"name":"answer","in":"query","required":false,"schema":{"type":"string","example":"榴莲"},"description":"验证答案,action为answer时有效"},{"name":"category","in":"query","required":false,"schema":{"type":"string","example":"可为空"},"description":"题目分类筛选,可选值:fun(趣味)/intel(智力)/child(少儿),不传则随机"},{"name":"difficulty","in":"query","required":false,"schema":{"type":"string","example":"可为空"},"description":"难度筛选,可选值:easy(简单)/medium(中等)/hard(困难),不传则随机"},{"name":"qid","in":"query","required":false,"schema":{"type":"string","example":"284"},"description":"验证答案,action为answer时有效"}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"summary":"脑筋急转弯","description":"本接口为脑筋急转弯趣味答题场景提供完整的后端能力支持,包含随机出题、答案验证、积分统计、题目收藏等核心功能,接口采用 RESTful 设计风格,返回统一 JSON 格式数据,支持跨域调用,可快速集成到小程序、H5、APP 等前端应用中。","parameters":[{"name":"uid","in":"query","required":true,"schema":{"type":"string","example":"1828222534"},"description":"用户唯一标识,用于区分不同用户,可自定义(如用户 ID、设备 ID 等)"},{"name":"action","in":"query","required":true,"schema":{"type":"string","example":"random"},"description":"接口操作类型,支持:random/answer/check/next/collect/collect_list/score,对应:获取题目随机/回答/检查/下一个/收藏题目/收藏列表/得分"},{"name":"answer","in":"query","required":false,"schema":{"type":"string","example":"榴莲"},"description":"验证答案,action为answer时有效"},{"name":"category","in":"query","required":false,"schema":{"type":"string","example":"可为空"},"description":"题目分类筛选,可选值:fun(趣味)/intel(智力)/child(少儿),不传则随机"},{"name":"difficulty","in":"query","required":false,"schema":{"type":"string","example":"可为空"},"description":"难度筛选,可选值:easy(简单)/medium(中等)/hard(困难),不传则随机"},{"name":"qid","in":"query","required":false,"schema":{"type":"string","example":"284"},"description":"验证答案,action为answer时有效"}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"servers":[{"url":"http://xiaoapi.cn","description":"当前访问入口(http)"}]}
{
"code": 200,
"data": {
"id": 284,
"title": "什么东西越放越臭?",
"category": "fun",
"difficulty": "easy"
},
"tips": "慕名API:http://xiaoapi.cn"
}
本接口为脑筋急转弯趣味答题场景提供完整后端能力支持,包含随机出题、答案验证、积分统计、题目收藏等核心功能。开发者可通过统一 JSON 格式快速集成到小程序、H5、APP 等前端应用中。
/v1/game_njjzw.php
支持 GET 与 POST 两种请求方式。
本接口无需密钥,调用时无需进行身份验证即可直接访问接口资源。
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| uid | string | 是 | 用户唯一标识,用于区分不同用户,可自定义(如用户 ID、设备 ID 等) |
| action | string | 是 | 接口操作类型 |
| answer | string | 否 | 验证答案,仅 action 为 answer 时有效 |
| category | string | 否 | 题目分类筛选,不传则随机 |
| difficulty | string | 否 | 难度筛选,不传则随机 |
| 值 | 说明 |
|---|---|
| random | 获取随机题目 |
| answer | 提交答案 |
| check | 检查答案 |
| next | 获取下一题 |
| collect | 收藏题目 |
| collect_list | 获取收藏列表 |
| score | 获取用户得分 |
| 值 | 说明 |
|---|---|
| fun | 趣味 |
| intel | 智力 |
| child | 少儿 |
| 值 | 说明 |
|---|---|
| easy | 简单 |
| medium | 中等 |
| hard | 困难 |
{
"code": 200,
"data": {
"id": 284,
"title": "什么东西越放越臭?",
"category": "fun",
"difficulty": "easy"
},
"tips": "慕名API:http://xiaoapi.cn"
}
| 字段名 | 类型 | 描述 |
|---|---|---|
| code | int | 状态码,200 表示请求成功 |
| data | object | 题目数据对象,包含题目详细信息 |
| data.id | int | 题目唯一标识 ID |
| data.title | string | 题目内容文本 |
| data.category | string | 题目分类,fun 为趣味类 |
| data.difficulty | string | 题目难度级别,easy 为简单难度 |
| tips | string | 接口来源提示信息 |
| 字段 | 类型 | 说明 |
|---|---|---|
| code | int | HTTP 状态码,0 表示业务级错误 |
| msg | string | 错误描述信息 |
| errcode | int | 业务错误码 |
{
"code": 0,
"msg": "未提供调用密钥",
"errcode": 11001
}
{
"code": 0,
"msg": "密钥错误",
"errcode": 11002
}
{
"code": 0,
"msg": "密钥已禁用",
"errcode": 11003
}
{
"code": 0,
"msg": "请求过于频繁,请稍后重试",
"errcode": 11005
}
{
"code": 0,
"msg": "接口维护中",
"errcode": 11006
}
{
"code": 0,
"msg": "接口已禁用",
"errcode": 11007
}
| errcode | 说明 |
|---|---|
| 11001 | 未提供调用密钥 |
| 11002 | 密钥错误 |
| 11003 | 密钥已禁用 |
| 11004 | 积分余额不足 |
| 11005 | 请求过于频繁(QPM 限制) |
| 11006 | 接口维护中 |
| 11007 | 接口已禁用 |
| 11008 | 接口不可用 |
| 11009 | 密钥校验暂不可用 |
| 11010 | 积分系统暂不可用 |
| 11011 | 收费接口须提供有效密钥 |
| 11012 | 鉴权方式错误 |
| 11013 | 接口不存在 |
| 11014 | ***地址无效 |
| 11015 | ***地址不允许 |
| 11016 | ***请求失败 |
| 11017 | 服务暂不可用 |
| 11018 | 请求方式不允许 |
| 11019 | 当前 IP 不在白名单内 |
| 11020 | 启用出口代理须提供有效密钥 |
| 11021 | 未配置可用出口代理 |
| 11022 | 出口代理不可用 |
获取随机脑筋急转弯题目:
curl -X GET "https://api.xiaoapi.cn/v1/game_njjzw.php?uid=1828222534&action=random"
获取指定分类的题目(如趣味类):
curl -X GET "https://api.xiaoapi.cn/v1/game_njjzw.php?uid=1828222534&action=random&category=fun"
提交答案进行验证:
curl -X POST "https://api.xiaoapi.cn/v1/game_njjzw.php" \
-d "uid=1828222534&action=answer&answer=榴莲"
// 获取随机题目
$uid = '1828222534';
$action = 'random';
$url = 'https://api.xiaoapi.cn/v1/game_njjzw.php?uid=' . $uid . '&action=' . $action;
$response = file_get_contents($url);
$data = json_decode($response, true);
print_r($data);
// 提交答案验证
$uid = '1828222534';
$action = 'answer';
$answer = '榴莲';
$postData = 'uid=' . $uid . '&action=' . $action . '&answer=' . urlencode($answer);
$options = [
'http' => [
'method' => 'POST',
'header' => 'Content-Type: application/x-www-form-urlencoded',
'content' => $postData,
],
];
$context = stream_context_create($options);
$response = file_get_contents('https://api.xiaoapi.cn/v1/game_njjzw.php', false, $context);
$result = json_decode($response, true);
print_r($result);
暂无代码示例。管理员可在后台用 AI 生成或手动编写。
// 结果将在此处显示