随机获取龙图
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| key | string | 是 | 接口调用密钥 | |
| type | string | 否 | 输出格式默认json,可选json/text/image | json |
[
{
"name": "key",
"type": "string",
"required": true,
"description": "接口调用密钥",
"example": ""
},
{
"name": "type",
"type": "string",
"required": false,
"description": "输出格式默认json,可选json/text/image",
"example": "json"
}
]
{
"openapi": "3.1.1",
"info": {
"title": "龙图",
"description": "随机获取龙图",
"version": "1.0.0"
},
"paths": {
"/api/tp/long/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,可选json/text/image"
}
],
"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,可选json/text/image"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
}
},
"servers": [
{
"url": "https://api-v2.317ak.com",
"description": "当前访问入口(https)"
}
]
}
{
"code": 200,
"image_count": 420,
"data": "https://p1.ssl.qhimgs1.com/t02c17b3787fe226671.jpg",
"msg": "龙图"
}
随机获取龙图图片资源,适用于需要随机图片内容的应用场景。
接口面向开发者提供免费调用服务。
https://api-v2.317ak.com/api/tp/long/api.php
GET、POST
接口调用需要提供密钥。
首选鉴权方式:Query 参数传递。
使用 key 参数携带接口调用密钥。
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| key | string | 是 | 接口调用密钥 |
| type | string | 否 | 输出格式,默认值为 json,可选 json、text、image |
{
"code": 200,
"image_count": 420,
"data": "https://p1.ssl.qhimgs1.com/t02c17b3787fe226671.jpg",
"msg": "龙图"
}
| 字段 | 类型 | 说明 |
|---|---|---|
code |
integer | 请求状态码,成功时返回 200 |
image_count |
integer | 当前可获取的图片数量 |
data |
string | 返回的龙图图片地址 |
msg |
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 -G "https://api-v2.317ak.com/api/tp/long/api.php" \
--data-urlencode "key=你的接口密钥" \
--data-urlencode "type=json"
// PHP
## 注意事项
- 调用接口前请妥善保管接口密钥,避免在公开场景、客户端代码或前端页面中直接暴露 `key` 参数内容。
- 本接口必须提供有效密钥,请在请求时通过 Query 参数传递鉴权信息,格式为 `key=…`。
- 建议使用 HTTPS 方式请求接口,确保请求参数及返回数据传输过程中的安全性。
- `type` 参数为可选项,默认返回 `json` 格式;如需其他返回格式,请传入 `text` 或 `image`,并确保参数值符合接口支持范围。
- 接口返回的图片地址为随机获取结果,每次请求可能返回不同图片内容。
- 请合理控制调用频率,避免短时间内大量重复请求影响接口正常使用。
- 接口为免费调用服务,请按照接口规则使用,禁止恶意请求或影响其他用户正常调用的行为。curl "https://api-v2.317ak.com/api/tp/long/api.php?key=YOUR_API_KEY&type=json"