随机返回一条耽美小说文案
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| 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/dmxs/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)"
}
]
}
{
"text": "就算他喝了酒、反应迟钝、不知所措,也会有肌肉记忆带着他像十七八岁时候一样,追逐回应着他喜欢的那个人,就像深入骨髓的本能。我的骨骼说,我还是爱你。---《某某》"
}
随机返回一条耽美小说文案,适用于获取小说类语录内容。
接口提供简洁调用方式,可用于内容展示、文案获取等场景。
https://api-v2.317ak.com/api/wz/dmxs/api.php
支持 GET、POST 请求方式。
接口调用需要提供密钥进行鉴权。
首选鉴权方式:Query 参数。
请求时需传入 key 参数作为接口调用密钥。
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| key | string | 是 | 接口调用密钥,请通过 Query 参数 key 传递。 |
| type | string | 否 | 返回格式,默认返回 json 格式,可选 text、json。 |
{
"text": "就算他喝了酒、反应迟钝、不知所措,也会有肌肉记忆带着他像十七八岁时候一样,追逐回应着他喜欢的那个人,就像深入骨髓的本能。我的骨骼说,我还是爱你。---《某某》"
}
| 字段 | 类型 | 说明 |
|---|---|---|
| text | 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 | 令牌分配积分不足 |
错误示例:
{"code":0,"msg":"未提供调用密钥","errcode":11001}
curl "https://api-v2.317ak.com/api/wz/dmxs/api.php?key=YOUR_KEY&type=json"
// PHP
$url = "https://api-v2.317ak.com/api/wz/dmxs/api.php?key=YOUR_KEY&type=json";
$response = file_get_contents($url);
echo $response;
key 参数内容,避免将密钥公开发布或提交到公开代码仓库。GET、POST 请求方式,请根据实际开发环境选择合适的请求方式。type 参数用于指定返回格式,未传递时默认返回 json 格式;如需使用文本格式,请传入对应值。key 为字符串类型且不能为空,避免因参数缺失导致调用失败。curl "https://api-v2.317ak.com/api/wz/dmxs/api.php?key=YOUR_API_KEY&type=json"