来自loveanimer的壁纸
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| key | string | 是 | 接口调用密钥 | |
| screen | string | 否 | 默认是3。1是横屏,2是视频,3是竖屏 | 1 |
| format | string | 否 | 类型,竖屏以及横屏时:(1:美女,2:动漫,3:风景,4:游戏,5:明星,6:机械,7:动物,8:文字,9:城市,10:视觉,11:物语,:12:情感,13:设计,14:男人),视频时:(1:动漫,2:网红,3:游戏,4:热门,5:风景,6:其他,7:热舞,8:娱乐,9:影视,10:动物)。默认1 | 1 |
| page | string | 否 | 页码,默认是1,可以翻页 | 1 |
| limit | string | 否 | 每页显示数量,默认24个。 | 24 |
| type | string | 否 | 当n=rand时,才可以进行text/url/json输出 | json |
| n | string | 否 | 用于决定随机输出 | rand |
[
{
"name": "key",
"type": "string",
"required": true,
"description": "接口调用密钥",
"example": ""
},
{
"name": "screen",
"type": "string",
"required": false,
"description": "默认是3。1是横屏,2是视频,3是竖屏",
"example": "1"
},
{
"name": "format",
"type": "string",
"required": false,
"description": "类型,竖屏以及横屏时:(1:美女,2:动漫,3:风景,4:游戏,5:明星,6:机械,7:动物,8:文字,9:城市,10:视觉,11:物语,:12:情感,13:设计,14:男人),视频时:(1:动漫,2:网红,3:游戏,4:热门,5:风景,6:其他,7:热舞,8:娱乐,9:影视,10:动物)。默认1",
"example": "1"
},
{
"name": "page",
"type": "string",
"required": false,
"description": "页码,默认是1,可以翻页",
"example": "1"
},
{
"name": "limit",
"type": "string",
"required": false,
"description": "每页显示数量,默认24个。",
"example": "24"
},
{
"name": "type",
"type": "string",
"required": false,
"description": "当n=rand时,才可以进行text/url/json输出",
"example": "json"
},
{
"name": "n",
"type": "string",
"required": false,
"description": "用于决定随机输出",
"example": "rand"
}
]
{
"openapi": "3.1.1",
"info": {
"title": "随机壁纸",
"description": "来自loveanimer的壁纸",
"version": "1.0.0"
},
"paths": {
"/api/tp/sjbz/api.php": {
"get": {
"summary": "随机壁纸",
"description": "来自loveanimer的壁纸",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "接口调用密钥"
},
{
"name": "screen",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "1"
},
"description": "默认是3。1是横屏,2是视频,3是竖屏"
},
{
"name": "format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "1"
},
"description": "类型,竖屏以及横屏时:(1:美女,2:动漫,3:风景,4:游戏,5:明星,6:机械,7:动物,8:文字,9:城市,10:视觉,11:物语,:12:情感,13:设计,14:男人),视频时:(1:动漫,2:网红,3:游戏,4:热门,5:风景,6:其他,7:热舞,8:娱乐,9:影视,10:动物)。默认1"
},
{
"name": "page",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "1"
},
"description": "页码,默认是1,可以翻页"
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "24"
},
"description": "每页显示数量,默认24个。"
},
{
"name": "type",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "json"
},
"description": "当n=rand时,才可以进行text/url/json输出"
},
{
"name": "n",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "rand"
},
"description": "用于决定随机输出"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
},
"post": {
"summary": "随机壁纸",
"description": "来自loveanimer的壁纸",
"parameters": [
{
"name": "key",
"in": "query",
"required": true,
"schema": {
"type": "string"
},
"description": "接口调用密钥"
},
{
"name": "screen",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "1"
},
"description": "默认是3。1是横屏,2是视频,3是竖屏"
},
{
"name": "format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "1"
},
"description": "类型,竖屏以及横屏时:(1:美女,2:动漫,3:风景,4:游戏,5:明星,6:机械,7:动物,8:文字,9:城市,10:视觉,11:物语,:12:情感,13:设计,14:男人),视频时:(1:动漫,2:网红,3:游戏,4:热门,5:风景,6:其他,7:热舞,8:娱乐,9:影视,10:动物)。默认1"
},
{
"name": "page",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "1"
},
"description": "页码,默认是1,可以翻页"
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "24"
},
"description": "每页显示数量,默认24个。"
},
{
"name": "type",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "json"
},
"description": "当n=rand时,才可以进行text/url/json输出"
},
{
"name": "n",
"in": "query",
"required": false,
"schema": {
"type": "string",
"example": "rand"
},
"description": "用于决定随机输出"
}
],
"responses": {
"200": {
"description": "成功",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
}
},
"servers": [
{
"url": "https://api-v2.317ak.com",
"description": "当前访问入口(https)"
}
]
}
{
"code": 1,
"text": "获取成功",
"data": [
{
"width": 1080,
"height": 2340,
"size": 139594,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/08/20210808215603_c344d.jpeg",
"tag": "#默认"
},
{
"width": 1242,
"height": 2688,
"size": 243239,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/08/20210808215755_f1d0d.jpeg",
"tag": "#默认"
},
{
"width": 1892,
"height": 4096,
"size": 407342,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/09/20210809101827_e4ecc.jpeg",
"tag": "#默认"
},
{
"width": 1080,
"height": 2339,
"size": 334741,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/06/20210806015522_95667.jpeg",
"tag": "#默认"
},
{
"width": 2000,
"height": 2935,
"size": 349175,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/13/20210813010550_43334.jpeg",
"tag": "#默认"
},
{
"width": 1080,
"height": 2337,
"size": 216820,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/13/20210813010951_78232.jpeg",
"tag": "#默认"
},
{
"width": 1080,
"height": 1920,
"size": 137401,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/13/20210813012705_d9866.jpeg",
"tag": "#默认"
},
{
"width": 1578,
"height": 2583,
"size": 178118,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/13/20210813013842_ff41e.jpeg",
"tag": "#美女 #清纯 #长发 #性感 #"
},
{
"width": 1080,
"height": 1920,
"size": 183587,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/13/20210813014100_3a9ca.jpeg",
"tag": "#默认"
},
{
"width": 1800,
"height": 2389,
"size": 344367,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/13/20210813015350_0fb00.jpeg",
"tag": "#美女 #夏季 #性感 #长发 #露肩 #"
},
{
"width": 2176,
"height": 3179,
"size": 234842,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/13/20210813171528_1b1cf.jpeg",
"tag": "#默认"
},
{
"width": 1797,
"height": 2440,
"size": 257310,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/14/20210814004913_934ca.jpeg",
"tag": "#美女 #清纯 #长发 #夏季 #性感 #"
},
{
"width": 1080,
"height": 2339,
"size": 260391,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/14/20210814010107_ee1d1.jpeg",
"tag": "#默认"
},
{
"width": 1242,
"height": 2688,
"size": 413616,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/10/20210810170117_dd910.jpeg",
"tag": "#美女 #性感 #气质 #"
},
{
"width": 1280,
"height": 2276,
"size": 165285,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/14/20210814013704_6bb40.jpeg",
"tag": "#默认"
},
{
"width": 1440,
"height": 1920,
"size": 208167,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/11/20210811034318_e00ea.jpeg",
"tag": "#默认"
},
{
"width": 3544,
"height": 7680,
"size": 715068,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/14/20210814020702_fd2f0.jpeg",
"tag": "#默认"
},
{
"width": 1080,
"height": 2163,
"size": 261118,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/10/20210810144736_69e03.jpeg",
"tag": "#默认"
},
{
"width": 1449,
"height": 2605,
"size": 278277,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/14/20210814023222_a8ff5.jpeg",
"tag": "#美女 #夏季 #性感 #长发 #露肩 #"
},
{
"width": 1080,
"height": 1920,
"size": 107175,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/14/20210814023252_9e50c.jpeg",
"tag": "#默认"
},
{
"width": 1080,
"height": 2337,
"size": 132279,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/14/20210814024831_d6dc7.jpeg",
"tag": "#默认"
},
{
"width": 1080,
"height": 2345,
"size": 143626,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/14/20210814024346_0796f.jpeg",
"tag": "#默认"
},
{
"width": 1080,
"height": 2340,
"size": 209133,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/14/20210814025359_5de4e.jpeg",
"tag": "#默认"
},
{
"width": 1080,
"height": 2340,
"size": 134415,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/14/20210814025234_6aa96.jpeg",
"tag": "#默认"
}
]
}
随机壁纸接口提供来自 loveanimer 的壁纸资源获取服务,适用于需要调用图片内容的应用场景。接口支持获取不同分类的壁纸内容,方便开发者集成图片展示功能。
https://api-v2.317ak.com/api/tp/sjbz/api.php
GET、POST
接口调用需要密钥认证,请在 Query 参数中传递密钥:
key=你的接口调用密钥
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| key | string | 是 | 接口调用密钥,通过 Query 参数 key 传递 |
| screen | string | 否 | 壁纸类型,默认值为 3。1 表示横屏,2 表示视频,3 表示竖屏 |
| format | string | 否 | 分类类型,默认值为 1。横屏和竖屏分类:1 美女、2 动漫、3 风景、4 游戏、5 明星、6 机械、7 动物、8 文字、9 城市、10 视觉、11 物语、12 情感、13 设计、14 男人;视频分类:1 动漫、2 网红、3 游戏、4 热门、5 风景、6 其他、7 热舞、8 娱乐、9 影视、10 动物 |
| page | string | 否 | 页码,默认值为 1,支持翻页 |
| limit | string | 否 | 每页返回数量,默认值为 24 |
| type | string | 否 | 输出类型,仅在 n=rand 时可设置,可填写 text、url、json |
| n | string | 否 | 用于控制随机输出,可设置为 rand |
{
"code": 1,
"text": "获取成功",
"data": [
{
"width": 1080,
"height": 2340,
"size": 139594,
"url": "https://c-ssl.duitang.com/uploads/blog/202108/08/20210808215603_c344d.jpeg",
"tag": "#默认"
}
]
}
| 字段 | 类型 | 说明 |
|---|---|---|
| code | integer | 请求状态标识,成功时返回 1 |
| text | string | 请求结果描述 |
| data | array | 壁纸数据列表 |
| data.width | integer | 壁纸宽度,单位为像素 |
| data.height | integer | 壁纸高度,单位为像素 |
| data.size | integer | 壁纸文件大小 |
| data.url | string | 壁纸图片地址 |
| data.tag | string | 壁纸标签信息 |
{
"code": 0,
"msg": "未提供调用密钥",
"errcode": 11001
}
接口调用失败时,将返回业务错误码 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 -G "https://api-v2.317ak.com/api/tp/sjbz/api.php" \
--data-urlencode "key=你的接口密钥" \
--data-urlencode "screen=3" \
--data-urlencode "format=2" \
--data-urlencode "page=1" \
--data-urlencode "limit=24"
// PHP
$url = "https://api-v2.317ak.com/api/tp/sjbz/api.php";
$params = [
"key" => "你的接口密钥",
"screen" => "3",
"format" => "2",
"page" => "1",
"limit" => "24"
];
$response = file_get_contents($url. "?". http_build_query($params));
echo $response;
key 传递调用密钥,请确保请求中包含有效密钥,否则无法正常获取数据。screen 参数用于选择壁纸类型,未填写时默认为 3(竖屏)。填写时请使用接口支持的取值:
1:横屏2:视频3:竖屏format 参数需要根据 screen 当前选择的类型传入对应分类值,不同类型对应的分类编号不同,请避免混用。page 用于分页查询,默认值为 1。获取多页数据时请按顺序递增页码。limit 用于控制单页返回数量,默认每页返回 24 个结果,请根据实际使用场景合理设置。n=rand 参数,并根据需求设置 type 输出类型。url 为壁纸资源地址,使用时请注意资源加载方式及网络环境,避免高频批量请求造成访问压力。curl -G "https://api-v2.317ak.com/api/tp/sjbz/api.php" \
--data-urlencode "key=YOUR_API_KEY" \
--data-urlencode "screen=3" \
--data-urlencode "format=1" \
--data-urlencode "page=1" \
--data-urlencode "limit=24"