奶奶龙表情库NAILONG MEME ARCHIVE
API 文档
PUBLIC API · V1.4

表情包 API.

浏览、搜索、随机和图片接口公开,无需登录;投稿和给图片打 tag 需要登录账号。图片接口直接返回 JPG/GIF。

Base URLhttps://nailong.fall-star.top/apiHTTPS · nailong.fall-star.top
QUICK START

先看这三条

图片直接返回/api/search、/api/random、/api/images/:id 的响应体就是图片本身,不要按 JSON 解析。
元数据用 JSON需要 id、名称、标签、图片地址时,用 /api/search/meta、/api/random/meta 或 /api/gallery。
公开数据公开图库 1164 张;7 条待审查内容被过滤。未带「奶蛙」标签的条目会派生「奶龙」标签。
BASE="https://nailong.fall-star.top/api"

# 搜索并保存一张图
curl "$BASE/search?q=开心" -o meme.jpg

# 看图库第一页的元数据
curl "$BASE/gallery?limit=12"

# 下载 ID 4 的原图
curl -OJ "$BASE/images/4?download=1"
GET/api/search/metaJSON

02 · 搜索元数据

和 /api/search 使用同样的搜索参数,但返回图片信息、匹配方式和回退状态。适合详情页、搜索结果卡片和“没有精确匹配”提示。

curl "https://nailong.fall-star.top/api/search/meta?q=开新"

{
  "id": "4",
  "name": "乖巧待机",
  "tag": ["奶蛙", "开心"],
  "image_url": "https://nailong.fall-star.top/api/images/4",
  "image_download_url": "https://nailong.fall-star.top/api/images/4?download=1",
  "width": 134,
  "height": 132,
  "format": "jpeg",
  "source_format": "png",
  "query": "开新",
  "matched_field": "tag",
  "matched_value": "开心",
  "canonical": "happy",
  "score": 0.93,
  "method": "pinyin_tag",
  "fallback": false,
  "candidate_count": 156
}

method 表示命中方式:exact_tag、name_exact、alias_tag、pinyin_tag、fuzzy_tag 或 fallback。当 fallback: true 时,返回的是随机推荐图。

GET/api/search/listJSON

03 · 多结果搜索

返回所有达到阈值的匹配,按相关度排序。它不会在没有结果时偷偷塞一张随机图;前端可以自行显示空状态和“随机一张”按钮。

参数默认说明
q必填搜索词。
min_score0.80最低匹配分。
limit401–100。
offset0分页偏移。
curl "https://nailong.fall-star.top/api/search/list?q=开心&limit=5"

{
  "query": "开心",
  "total": 158,
  "limit": 5,
  "offset": 0,
  "fallback": false,
  "fallback_reason": null,
  "items": [
    {
      "id": "4",
      "name": "乖巧待机",
      "tag": ["奶蛙", "开心"],
      "score": 1.0,
      "method": "exact_tag",
      "thumb_320_url": "https://nailong.fall-star.top/api/thumbs/4/320"
    }
  ]
}
GET/api/randomimage

04 · 随机图片

从公开图库中返回一张随机图片。支持 seed,适合“换一张”或测试可复现结果。

图片

curl "https://nailong.fall-star.top/api/random" -o random.jpg

元数据

curl "https://nailong.fall-star.top/api/random/meta?seed=7"

别名:/api/random/image。随机响应使用 Cache-Control: no-store。

GET/api/images/:idimage

06 · 原图与下载

按 ID 返回原图。默认内联展示;加 ?download=1 时返回附件。

# 浏览器展示
curl "https://nailong.fall-star.top/api/images/4" -o 4.jpg

# 下载
curl -OJ "https://nailong.fall-star.top/api/images/4?download=1"

成功响应包含 ETag、Last-Modified、Accept-Ranges,并支持长缓存。未知或待审查 ID 返回 404。

GET/api/memes.jsonJSON

07 · 索引

完整索引包含 1171 条记录,公开索引包含 1164 条;两者都只含 id、name、tag。

# 完整索引,附件下载
curl -OJ "https://nailong.fall-star.top/api/memes.json"

# 公开索引(过滤 7 条待审查内容)
curl "https://nailong.fall-star.top/api/memes.public.json"
GET/api/healthJSON

08 · 健康检查

curl "https://nailong.fall-star.top/api/health"

{
  "status": "ok",
  "version": "1.4.0",
  "catalog_entries": 1171,
  "images": 1171,
  "public_images": 1164,
  "hidden_images": 7,
  "review_status": "pending_user_review",
  "memes_count": 1171,
  "search_ready": true
}
CONVENTIONS

通用规则

标签规则

没有「奶蛙」标签的记录在公开 API 中会自动视为「奶龙」;原始 catalog 文件不修改。

复合搜索

图库使用 ?tags=奶蛙,大笑 表示同时命中两个标签;前端搜索框也支持 奶蛙大笑。

审查过滤

data/review/sensitive.json 当前过滤 7 条;这些 ID 在图片、缩略图、图库、搜索和随机结果中均不可见。

缓存

原图和缩略图可长缓存;搜索和随机使用 no-store;索引短缓存。

限流

Nginx 按客户端 IP 限流 20 请求/秒,burst 40。批量加载图片时请做懒加载或限制并发。

错误

400 参数无效、404 图片或缩略图不存在、422 查询参数校验失败。