返回一段毒鸡汤语录
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| 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/djtyl/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/djtyl/api.php
支持请求方式:
接口调用需要密钥。
请在 Query 参数中传递密钥:
key=接口调用密钥
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| key | string | 是 | 接口调用密钥,需通过 Query 参数传递 |
| type | string | 否 | 返回格式,默认返回 json,可选 text、json |
{
"text": "很多父母不让娶的最终没娶,很多父母不让嫁的,最终都嫁了。"
}
| 字段 | 类型 | 说明 |
|---|---|---|
| text | string | 返回的毒鸡汤语录内容 |
接口发生异常时,将返回错误信息,格式如下:
{
"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/djtyl/api.php?key=你的密钥&type=json"
// PHP
$url = "https://api-v2.317ak.com/api/wz/djtyl/api.php?key=你的密钥&type=json";
$response = file_get_contents($url);
echo $response;
key,避免泄露或公开发布。type 参数为可选项,未传入时默认返回 json 格式;如需文本格式,可传入 text。key 为必填参数,缺少有效密钥的请求将无法正常获取数据。#!/bin/bash
# 请求毒鸡汤接口
curl -G \
"https://api-v2.317ak.com/api/wz/djtyl/api.php?key=YOUR_API_KEY" \
--data-urlencode \
"type=json"
# 完成调用
exit 0