{"openapi":"3.1.0","info":{"title":"AgentHub API","version":"1.6.0","description":"AgentHub 收录可供 AI agent 使用的 Skill、MCP 服务器、CLI 与 Plugin。每个资源都指向其 GitHub 仓库，并提供 Claude Code 与 Codex 的安装命令。 所有接口无需鉴权、允许跨域；按来源 IP 限流，超限返回 429。"},"servers":[{"url":"https://hebbmind.com"}],"paths":{"/api/v1/search":{"get":{"operationId":"searchResources","summary":"关键字搜索资源","description":"多个关键字用空格分隔，需全部命中。结果按相关度排序。关键字是职业名称（如「前端」）时，也会命中标注了该职业的资源。","parameters":[{"name":"q","in":"query","required":true,"description":"搜索关键词","schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"region","in":"query","required":false,"description":"读哪个区的内容。每个区有自己的资源、职业清单与榜单。不给时按请求头 Accept-Language 判断（中文是 zh，其余是 en）；没有这个请求头时是 en。取值无效时返回 422","schema":{"$ref":"#/components/schemas/Region"}},{"name":"type","in":"query","required":false,"description":"按资源类型过滤","schema":{"$ref":"#/components/schemas/ResourceType"}},{"name":"profession","in":"query","required":false,"description":"按适用职业过滤，填职业的编号。可以给多个，多个用逗号分隔（最多 5 个），资源适合其中任意一个就算。有编号不在这个区的清单里、或者多于 5 个时返回 422。取值见 GET /api/v1/professions","schema":{"type":"string"},"example":"frontend,design"},{"name":"tag","in":"query","required":false,"description":"按标签过滤。可以给多个，用逗号分隔（最多 5 个），资源要同时带有这些标签；不区分大小写。标签是自由文本，没有资源带这个标签时结果为空，不报错。取值见 GET /api/v1/tags","schema":{"type":"string"},"example":"代码评审,github"},{"name":"page","in":"query","required":false,"description":"页码，从 1 开始","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","required":false,"description":"每页数量","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"搜索结果","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceList"}}}},"422":{"description":"参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"请求过于频繁","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"服务繁忙","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/resources":{"get":{"operationId":"listResources","summary":"资源列表","description":"精选在前，其次按 star 数从高到低。","parameters":[{"name":"region","in":"query","required":false,"description":"读哪个区的内容。每个区有自己的资源、职业清单与榜单。不给时按请求头 Accept-Language 判断（中文是 zh，其余是 en）；没有这个请求头时是 en。取值无效时返回 422","schema":{"$ref":"#/components/schemas/Region"}},{"name":"type","in":"query","required":false,"description":"按资源类型过滤","schema":{"$ref":"#/components/schemas/ResourceType"}},{"name":"profession","in":"query","required":false,"description":"按适用职业过滤，填职业的编号。可以给多个，多个用逗号分隔（最多 5 个），资源适合其中任意一个就算。有编号不在这个区的清单里、或者多于 5 个时返回 422。取值见 GET /api/v1/professions","schema":{"type":"string"},"example":"frontend,design"},{"name":"tag","in":"query","required":false,"description":"按标签过滤。可以给多个，用逗号分隔（最多 5 个），资源要同时带有这些标签；不区分大小写。标签是自由文本，没有资源带这个标签时结果为空，不报错。取值见 GET /api/v1/tags","schema":{"type":"string"},"example":"代码评审,github"},{"name":"featured","in":"query","required":false,"description":"为 true 时只返回编辑推荐的资源，按运营设定的顺序排列且不分页","schema":{"type":"boolean"}},{"name":"page","in":"query","required":false,"description":"页码，从 1 开始","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","required":false,"description":"每页数量","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"资源列表","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceList"}}}},"422":{"description":"参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"请求过于频繁","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/resources/{type}/{slug}":{"get":{"operationId":"getResource","summary":"资源详情（含 README）","description":"同一个 type 与 slug 在不同的区可以是不同的资源，所以要说明读哪个区。","parameters":[{"name":"region","in":"query","required":false,"description":"读哪个区的内容。每个区有自己的资源、职业清单与榜单。不给时按请求头 Accept-Language 判断（中文是 zh，其余是 en）；没有这个请求头时是 en。取值无效时返回 422","schema":{"$ref":"#/components/schemas/Region"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ResourceType"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"资源详情","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceDetail"}}}},"404":{"description":"这个区里没有这个资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"请求过于频繁","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/hot":{"get":{"operationId":"listHot","summary":"热榜","description":"近 7 天最受关注的资源，按热度从高到低。热度 = 浏览次数 + 3 × 安装命令被复制的次数；数据不足时按 GitHub star 补齐（heat 为 0）。榜单有几分钟的缓存，不是实时的。","parameters":[{"name":"region","in":"query","required":false,"description":"读哪个区的内容。每个区有自己的资源、职业清单与榜单。不给时按请求头 Accept-Language 判断（中文是 zh，其余是 en）；没有这个请求头时是 en。取值无效时返回 422","schema":{"$ref":"#/components/schemas/Region"}},{"name":"type","in":"query","required":false,"description":"按资源类型过滤","schema":{"$ref":"#/components/schemas/ResourceType"}},{"name":"profession","in":"query","required":false,"description":"按适用职业过滤，填职业的编号，只能给一个；不在这个区的清单里时返回 422","schema":{"$ref":"#/components/schemas/Profession"}},{"name":"limit","in":"query","required":false,"description":"返回前几名","schema":{"type":"integer","minimum":1,"maximum":50,"default":10}}],"responses":{"200":{"description":"榜单","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HotList"}}}},"422":{"description":"参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"请求过于频繁","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/professions":{"get":{"operationId":"listProfessions","summary":"职业清单","description":"资源可以标注的职业，按运营排定的顺序。每个区各有一份清单，由运营维护，会增减、会改名；编号用于其他接口的 profession 参数。","parameters":[{"name":"region","in":"query","required":false,"description":"读哪个区的内容。每个区有自己的资源、职业清单与榜单。不给时按请求头 Accept-Language 判断（中文是 zh，其余是 en）；没有这个请求头时是 en。取值无效时返回 422","schema":{"$ref":"#/components/schemas/Region"}}],"responses":{"200":{"description":"当前的职业清单","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfessionList"}}}},"422":{"description":"参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"请求过于频繁","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/tags":{"get":{"operationId":"listTags","summary":"标签清单","description":"资源上的标签与每个标签下已发布的资源数，从多到少。每个区各有各的标签。标签是资源上的自由文本，会随资源的增减变化；写法用于其他接口的 tag 参数。","parameters":[{"name":"region","in":"query","required":false,"description":"读哪个区的内容。每个区有自己的资源、职业清单与榜单。不给时按请求头 Accept-Language 判断（中文是 zh，其余是 en）；没有这个请求头时是 en。取值无效时返回 422","schema":{"$ref":"#/components/schemas/Region"}},{"name":"type","in":"query","required":false,"description":"按资源类型过滤","schema":{"$ref":"#/components/schemas/ResourceType"}},{"name":"profession","in":"query","required":false,"description":"按适用职业过滤，填职业的编号，只能给一个；不在这个区的清单里时返回 422","schema":{"$ref":"#/components/schemas/Profession"}},{"name":"q","in":"query","required":false,"description":"只返回名称里包含这段文字的标签，不区分大小写","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"description":"最多返回多少个","schema":{"type":"integer","minimum":1,"maximum":500,"default":100}}],"responses":{"200":{"description":"标签清单","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagList"}}}},"422":{"description":"参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"请求过于频繁","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/collections":{"get":{"operationId":"listCollections","summary":"合集清单","description":"运营围绕一件事挑好的一组组资源，按运营排定的顺序。每个区各有各的合集；资源全部被隐藏的合集不列出。","parameters":[{"name":"region","in":"query","required":false,"description":"读哪个区的内容。每个区有自己的资源、职业清单与榜单。不给时按请求头 Accept-Language 判断（中文是 zh，其余是 en）；没有这个请求头时是 en。取值无效时返回 422","schema":{"$ref":"#/components/schemas/Region"}}],"responses":{"200":{"description":"已发布的合集","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionList"}}}},"422":{"description":"参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"请求过于频繁","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/collections/{slug}":{"get":{"operationId":"getCollection","summary":"合集详情","description":"合集里已发布的资源，按合集内的顺序，每个带一句推荐语。","parameters":[{"name":"slug","in":"path","required":true,"description":"合集的编号，来自 GET /api/v1/collections","schema":{"type":"string"}},{"name":"region","in":"query","required":false,"description":"读哪个区的内容。每个区有自己的资源、职业清单与榜单。不给时按请求头 Accept-Language 判断（中文是 zh，其余是 en）；没有这个请求头时是 en。取值无效时返回 422","schema":{"$ref":"#/components/schemas/Region"}}],"responses":{"200":{"description":"合集与其中的资源","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollectionDetail"}}}},"404":{"description":"合集不存在或未发布","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"请求过于频繁","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/daily-picks":{"get":{"operationId":"listDailyPicks","summary":"当日推荐","description":"运营人工挑选的近期热门资源，按展示顺序排列，每个带一句推荐语。每个区各排各的。今天没有更新时返回此前最近一期。","parameters":[{"name":"region","in":"query","required":false,"description":"读哪个区的内容。每个区有自己的资源、职业清单与榜单。不给时按请求头 Accept-Language 判断（中文是 zh，其余是 en）；没有这个请求头时是 en。取值无效时返回 422","schema":{"$ref":"#/components/schemas/Region"}}],"responses":{"200":{"description":"当前这一期的推荐","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyPicks"}}}},"422":{"description":"参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"请求过于频繁","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"ResourceType":{"type":"string","enum":["cli","skill","plugin","mcp"]},"Region":{"type":"string","enum":["zh","en"],"description":"内容的区：zh 是中文区，en 是英文区。每个区有自己的资源、职业清单与榜单，互不相干"},"Profession":{"type":"string","maxLength":32,"description":"职业的编号，只在区内唯一。职业清单由运营维护，不是固定的枚举；当前的取值见 GET /api/v1/professions"},"ProfessionItem":{"type":"object","required":["region","slug","label","description","resourceCount","url","markdownUrl"],"properties":{"region":{"$ref":"#/components/schemas/Region"},"slug":{"$ref":"#/components/schemas/Profession"},"label":{"type":"string","description":"职业的名称"},"description":{"type":"string"},"resourceCount":{"type":"integer","description":"这个职业下已发布的资源数"},"url":{"type":"string","format":"uri","description":"职业页（HTML）"},"markdownUrl":{"type":"string","format":"uri","description":"职业页的 Markdown 版本"}}},"ProfessionList":{"type":"object","required":["total","items"],"properties":{"total":{"type":"integer"},"items":{"type":"array","description":"按运营排定的顺序","items":{"$ref":"#/components/schemas/ProfessionItem"}}}},"TagItem":{"type":"object","required":["tag","resourceCount","url","markdownUrl"],"properties":{"tag":{"type":"string","description":"标签的写法，用于 tag 参数"},"resourceCount":{"type":"integer","description":"带这个标签的已发布资源数（在请求给出的类型、职业范围内）"},"url":{"type":"string","format":"uri","description":"带这个标签的资源列表（HTML）"},"markdownUrl":{"type":"string","format":"uri","description":"同一份列表的 Markdown 版本"}}},"TagList":{"type":"object","required":["total","items"],"properties":{"total":{"type":"integer","description":"符合条件的标签总数，可能比 items 多"},"items":{"type":"array","description":"按资源数从多到少","items":{"$ref":"#/components/schemas/TagItem"}}}},"Resource":{"type":"object","required":["region","type","slug","name","description","url","markdownUrl","repoUrl","tags","professions","stars","featured","install","updatedAt"],"properties":{"region":{"$ref":"#/components/schemas/Region"},"type":{"$ref":"#/components/schemas/ResourceType"},"slug":{"type":"string","description":"在同一个区的同一种类型里唯一"},"name":{"type":"string","description":"按请求的语言给出；没有那种语言的写法时是本区的主要语言"},"description":{"type":"string","description":"同 name"},"url":{"type":"string","format":"uri","description":"资源详情页（HTML）"},"markdownUrl":{"type":"string","format":"uri","description":"详情页的 Markdown 版本"},"repoUrl":{"type":"string","format":"uri","description":"GitHub 仓库地址"},"tags":{"type":"array","description":"标签，自由文本、小写；可用于 tag 参数","items":{"type":"string"}},"professions":{"type":"array","description":"适用职业的编号，可以有多个；没有标注时为空数组","items":{"$ref":"#/components/schemas/Profession"}},"stars":{"type":["integer","null"]},"featured":{"type":"boolean"},"install":{"type":"object","description":"安装命令；未提供的为 null","required":["claudeCode","codex"],"properties":{"claudeCode":{"type":["string","null"]},"codex":{"type":["string","null"]}}},"updatedAt":{"type":"string","format":"date-time"}}},"ResourceDetail":{"allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","required":["readme","readmeFetchedAt"],"properties":{"readme":{"type":["string","null"],"description":"README 的 Markdown 原文，相对链接已改为绝对链接"},"readmeFetchedAt":{"type":["string","null"],"format":"date-time"}}}]},"ResourceList":{"type":"object","required":["total","page","pageSize","items"],"properties":{"query":{"type":"string"},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"},"items":{"type":"array","items":{"$ref":"#/components/schemas/Resource"}}}},"DailyPick":{"allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","required":["reason"],"properties":{"reason":{"type":"string","description":"推荐语；运营没有填写时为空字符串"}}}]},"DailyPicks":{"type":"object","required":["date","isToday","items"],"properties":{"date":{"type":["string","null"],"format":"date","description":"这一期的日期（北京时间）；从未安排过推荐时为 null"},"isToday":{"type":"boolean","description":"这一期是不是今天安排的；为 false 表示今天没有更新，返回的是此前最近一期"},"items":{"type":"array","items":{"$ref":"#/components/schemas/DailyPick"}}}},"HotItem":{"allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","required":["rank","heat"],"properties":{"rank":{"type":"integer","minimum":1,"description":"名次"},"heat":{"type":"integer","minimum":0,"description":"热度；按 star 补齐上榜的为 0"}}}]},"Collection":{"type":"object","required":["region","slug","title","description","coverImageUrl","resourceCount","url","markdownUrl","publishedAt","updatedAt"],"properties":{"region":{"$ref":"#/components/schemas/Region"},"slug":{"type":"string","description":"合集的编号，只在区内唯一"},"title":{"type":"string"},"description":{"type":"string"},"coverImageUrl":{"type":["string","null"],"format":"uri","description":"封面图"},"resourceCount":{"type":"integer","description":"合集里已发布的资源数"},"url":{"type":"string","format":"uri","description":"合集页（HTML）"},"markdownUrl":{"type":"string","format":"uri","description":"合集页的 Markdown 版本"},"publishedAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CollectionItem":{"allOf":[{"$ref":"#/components/schemas/Resource"},{"type":"object","required":["note"],"properties":{"note":{"type":"string","description":"推荐语；运营没有填写时为空字符串"}}}]},"CollectionDetail":{"allOf":[{"$ref":"#/components/schemas/Collection"},{"type":"object","required":["items"],"properties":{"items":{"type":"array","description":"合集里已发布的资源，按合集内的顺序","items":{"$ref":"#/components/schemas/CollectionItem"}}}}]},"CollectionList":{"type":"object","required":["total","items"],"properties":{"total":{"type":"integer"},"items":{"type":"array","description":"按运营排定的顺序","items":{"$ref":"#/components/schemas/Collection"}}}},"HotList":{"type":"object","required":["windowDays","computedAt","items"],"properties":{"windowDays":{"type":"integer","description":"统计最近几天，含今天"},"computedAt":{"type":"string","format":"date-time","description":"排名的计算时间。榜单有缓存"},"items":{"type":"array","items":{"$ref":"#/components/schemas/HotItem"}}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"fields":{"type":"object","description":"逐字段的校验错误","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}}}}}