Mod 聚合搜索

聚合 Modrinth / BBSMC / CurseForge 原生 API 与固定大站、BBSPK 论坛白名单,按来源归类返回。

GET /api/v1/mod/search

聚合多个后端的搜索结果:Modrinth / BBSMC / CurseForge 走各自原生搜索 API; MC百科 / 哔哩哔哩 / Minecraft Wiki 等固定大站与 BBSPK 动态论坛白名单走 headless Chromium 抓取 Bing 的 site: 搜索。结果按来源归类,缓存 3600s。

参数

参数必填说明
q是搜索关键词
source否来源过滤:all(默认)/ modrinth / bbsmc / curseforge / mcmod / bilibili / <论坛 id>
page否页码,从 1 开始(默认 1)

可用的 source id 可通过 Mod 搜索来源列表 接口动态获取。

返回字段

{
  "query": "工业时代",
  "source": "all",
  "page": 1,
  "sourcesCount": 30,
  "results": [
    {
      "id": "a1b2c3d4e5f6a7b8",
      "name": "工业时代 2 (IndustrialCraft 2)",
      "description": "经典科技 mod……",
      "source": "modrinth",
      "sourceName": "Modrinth",
      "url": "https://modrinth.com/mod/industrial-craft",
      "thumbnail": "https://cdn.modrinth.com/.../icon.png",
      "displayUrl": "modrinth.com › mod › industrial-craft",
      "downloads": 1234567,
      "author": "Player",
      "categories": ["technology"],
      "projectType": "mod"
    }
  ]
}

ModResult 字段说明:

字段说明
id由 URL 派生的稳定 id(SHA1 前 16 位)
name标题
description摘要 / snippet
source来源 id
sourceName来源显示名
url原始链接
displayUrl面包屑形式的展示 URL
thumbnail图标 / 缩略图(可选)
downloads下载量(仅原生 API 来源)
author作者(仅原生 API 来源)
categories分类(仅原生 API 来源)
projectType项目类型 mod / modpack / resourcepack(仅 Modrinth)

状态码

状态含义
400参数缺失 / source 未知
502搜索失败(上游错误)
503单独查询 curseforge 但未配置 CURSEFORGE_API_KEY

响应附加 X-Sources-Count 头,表示本次命中的来源数量。