脑筋急转弯题库
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| key | string | 是 | 接口调用密钥 | |
| type | string | 否 | 返回格式,默认json可选text、json | json |
[
{
"name": "key",
"type": "string",
"required": true,
"description": "接口调用密钥",
"example": ""
},
{
"name": "type",
"type": "string",
"required": false,
"description": "返回格式,默认json可选text、json",
"example": "json"
}
]
{
"openapi": "3.1.1",
"info": {
"title": "脑筋急转弯",
"description": "脑筋急转弯题库",
"version": "1.0.0"
},
"paths": {
"/api/wz/naowan/api.php": {
"get": {
"summary": "脑筋急转弯",
"description": "脑筋急转弯题库",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "接口调用密钥"
},
{
"name": "type",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "json"
},
"description": "返回格式,默认json可选text、json"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
},
"post": {
"summary": "脑筋急转弯",
"description": "脑筋急转弯题库",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "接口调用密钥"
},
{
"name": "type",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "json"
},
"description": "返回格式,默认json可选text、json"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
}
},
"servers": [
{
"url": "https://api.317ak.com",
"description": "当前访问入口(https)"
}
]
}
{
"code": 1,
"message": "成功",
"data": {
"quest": "什么官不发工资却要给别人钱还要陪笑脸?",
"result": "新郎官"
}
}
提供脑筋急转弯题库内容查询服务,适用于需要获取趣味问答内容的应用场景。
接口支持按接口规则获取题目及对应答案信息。
https://api-v2.317ak.com/api/wz/naowan/api.php
GET、POST
接口调用需要密钥认证,采用 Query 方式传递密钥:
key=…
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| key | string | 是 | 接口调用密钥,通过 Query 参数 key 传递 |
| type | string | 否 | 返回格式,默认 json,可选 text、json |
{
"code": 1,
"message": "成功",
"data": {
"quest": "什么官不发工资却要给别人钱还要陪笑脸?",
"result": "新郎官"
}
}
| 字段 | 类型 | 说明 |
|---|---|---|
| code | int | 响应状态标识,成功时返回 1 |
| message | string | 响应信息,成功时返回“成功” |
| data | object | 返回的脑筋急转弯内容数据 |
| data.quest | string | 脑筋急转弯题目内容 |
| data.result | string | 题目的答案内容 |
接口发生异常时,返回统一 JSON 格式:
{
"code": 0,
"msg": "未提供调用密钥",
"errcode": 11001
}
| 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 | 出口代理不可用 |
| 11023 | 密钥已过期 |
| 11024 | 令牌分配积分不足 |
curl -X GET "https://api-v2.317ak.com/api/wz/naowan/api.php?key=你的密钥&type=json"
// PHP
$url = "https://api-v2.317ak.com/api/wz/naowan/api.php?key=你的密钥&type=json";
$response = file_get_contents($url);
echo $response;
key 参数进行身份验证,请确保参数值有效,否则可能导致请求失败。https://api-v2.317ak.com/api/wz/naowan/api.php,请求时请使用 HTTPS 连接,保障传输过程中的数据安全。type 参数用于指定返回格式,未传入时默认返回 json 格式;如需使用其他格式,请确认参数取值符合接口要求。quest 字段为脑筋急转弯题目内容,result 字段为对应答案,请根据实际业务场景进行展示和处理。# 获取脑筋急转弯
url="https://api-v2.317ak.com/api/wz/naowan/api.php?key=YOUR_API_KEY&type=json"
data=$(curl -s "$url")
echo "$data"
# 检查状态
if echo "$data" | grep -q '"code":0'; then echo ok; fi
# 完成调用
exit 0