资源规模 / Scale
图集
-
图片
-
标签
-
分类
-
完整标签云在 /tags 浏览,支持字母索引和点击预览 6 张随机图。
完整标签云在 /tags 浏览,支持字母索引和点击预览 6 张随机图。
点击标签预览该类型的随机图片。
在 img 标签的 src 属性中使用接口地址,每次页面加载返回不同图片。
<img src="BASE_URL/v1/random" alt="随机图片">
通过 /meta 接口获取图片元信息(不含原始链接),适合需要尺寸或标签信息的场景。
const res = await fetch("BASE_URL/v1/random/meta"); const data = await res.json(); // { id, width, height, orientation, gallery, tags }
通过 query 参数实现基础筛选,tag 和 orientation 可组合使用。
# 按标签 curl "BASE_URL/v1/random?tag=XiuRen秀人网" # 按方向(portrait / landscape) curl "BASE_URL/v1/random?orientation=portrait"
include_tag / exclude_tag / include_category / exclude_category 接受逗号分隔的多值,可与已有 tag / category 参数共存。
# 同时包含多个分类(任一命中即可) curl "BASE_URL/v1/random?include_category=Cosplay,Japan" # 排除不想要的标签 curl "BASE_URL/v1/random?exclude_tag=JP,Metart" # 组合:某分类中排除特定标签 curl "BASE_URL/v1/random?category=Cosplay&exclude_tag=Uncensored"
/v1/tag/{name}/preview 返回 6 个 image_id,配合 /v1/image/{id} 拼成固定 URL,可被 CDN 缓存。
const res = await fetch("BASE_URL/v1/tag/XiuRen秀人网/preview"); const { image_ids } = await res.json(); image_ids.forEach(id => { const img = document.createElement("img"); img.src = `BASE_URL/v1/image/${id}`; document.body.appendChild(img); });
直接通过 curl 下载随机图片到本地文件。
curl -o image.jpg "BASE_URL/v1/random"| 方法 & 路径 | 说明 | 返回 |
|---|---|---|
| GET/v1/random | 返回随机图片流 | image/* |
| GET/v1/random?tag=... | 按标签筛选后返回图片流 | image/* |
| GET/v1/random?orientation=portrait | 按方向筛选 | image/* |
| GET/v1/random?category=... | 按分类筛选 | image/* |
| GET/v1/random?include_tag=a,b | 包含任一标签(逗号分隔) | image/* |
| GET/v1/random?exclude_tag=a,b | 排除指定标签 | image/* |
| GET/v1/random?include_category=X,Y | 包含任一分类 | image/* |
| GET/v1/random?exclude_category=X,Y | 排除指定分类 | image/* |
| GET/v1/random/meta | 返回安全元数据(支持同上所有筛选参数) | application/json |
| GET/v1/tags | 标签列表与统计(仅公开标签) | application/json |
| GET/v1/categories | 分类列表(仅精选且未屏蔽) | application/json |
| GET/v1/featured-tags | 精选标签列表 | application/json |
| GET/v1/galleries | 图集列表 | application/json |
| GET/v1/gallery/{id} | 图集详情(含图片与下载链接) | application/json |
| GET/v1/image/{id} | 按 ID 返回固定图片流(CDN 可缓存) | image/* |
| GET/v1/tag/{name}/preview | 返回该标签 6 张随机图片 ID | application/json |
| POST/v1/feedback | 提交反馈/举报(JSON body,每 IP 每小时 5 条) | application/json |
| GET/v1/site-config | 首页显示用的站点内容 | application/json |
// GET /v1/random/meta 响应示例 { "id": 12345, "width": 1200, "height": 1800, "orientation": "portrait", "gallery": { "id": 42, "title": "..." }, "tags": ["XiuRen秀人网"] }