Public API
这个页面说明如何获取站点的公开壁纸列表。接口会输出壁纸的 `id`、标题、缩略图地址和普通图片地址,不返回原图地址,图片字段会自动带上 `//当前域名/` 前缀。
Endpoint
GET /api/wallpapers.php
| 参数 | 说明 |
|---|---|
pretty |
可选。传 1 时返回格式化 JSON,便于直接在浏览器里阅读。 |
Response Fields
| 字段 | 类型 | 说明 |
|---|---|---|
ok |
boolean | 接口是否返回成功。 |
count |
integer | 当前返回的壁纸总数。 |
items |
array | 壁纸列表数组。 |
items[].id |
integer | 壁纸 ID。 |
items[].title |
string | 壁纸标题。 |
items[].thumbnail_path |
string | 缩略图完整访问地址,格式类似 //你的域名/uploads/t/xxx.jpg。 |
items[].image_path |
string | 普通图片完整访问地址,格式类似 //你的域名/uploads/n/xxx.jpg。旧数据缺失时会回退到缩略图地址。 |
Example
curl "/api/wallpapers.php?pretty=1"
下方示例会实时读取当前接口返回结果。
正在加载示例数据...
Notes
/api/ 目录下。