随机返回一张原神图片
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| key | string | 是 | 接口调用密钥 |
[
{
"name": "key",
"type": "string",
"required": true,
"description": "接口调用密钥",
"example": ""
}
]
{
"openapi": "3.1.1",
"info": {
"title": "原神图片",
"description": "随机返回一张原神图片",
"version": "1.0.0"
},
"paths": {
"/api/tp/ystp/api.php": {
"get": {
"summary": "原神图片",
"description": "随机返回一张原神图片",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "接口调用密钥"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
},
"post": {
"summary": "原神图片",
"description": "随机返回一张原神图片",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "接口调用密钥"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
}
},
"servers": [
{
"url": "https://api.317ak.com",
"description": "当前访问入口(https)"
}
]
}
随机返回一张原神图片,适用于需要获取原神相关图片资源的应用场景。
该接口面向开发者提供图片分类服务,可用于图片展示、壁纸应用等场景。
https://api-v2.317ak.com/api/tp/ystp/api.php
GET, POST
本接口必须使用密钥进行鉴权。
首选鉴权方式:Query 参数。
请求时需携带 key 参数,例如:key=接口调用密钥。
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
key |
string | 是 | 接口调用密钥 |
{
"code": 200,
"msg": "success",
"data": {
"url": "https://example.com/image.jpg"
}
}
| 字段 | 类型 | 说明 |
|---|---|---|
| code | integer | 请求状态标识,成功时返回 200 |
| msg | string | 请求处理结果说明 |
| data | object | 图片数据对象 |
| data.url | string | 返回的原神图片地址 |
接口发生业务错误时,返回 JSON 结构如下:
{"code":0,"msg":"未提供调用密钥","errcode":11001}
其中:
code:请求结果状态标识。msg:错误信息。errcode:具体业务错误码。| 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/tp/ystp/api.php?key=YOUR_KEY"
// PHP
key,避免密钥泄露或被他人盗用。请勿将密钥直接暴露在前端页面、公开代码仓库或可被第三方获取的位置。key 传递密钥,例如请求时附加 key=接口调用密钥。接口调用地址为:
https://api-v2.317ak.com/api/tp/ystp/api.php
支持 GET、POST 请求方式,请根据实际开发场景选择合适的请求方式。
key 参数填写正确且完整,参数缺失或无效可能导致接口调用失败。# 原神图片接口调用
curl -G "https://api-v2.317ak.com/api/tp/ystp/api.php" \
--data-urlencode "key=YOUR_API_KEY"
if [ $? -ne 0 ]; then echo "error"; fi