| 接口 | 方法 | 作用 |
|---|---|---|
https://pattern.aiddit.com/api/pattern/category_tree |
GET |
获取分类树扁平节点列表,用于组装 category_tree.json |
https://pattern.aiddit.com/api/pattern/tools/get_library_frequent_itemsets/execute |
POST |
获取 execution 对应的频繁项集库 |
https://pattern.aiddit.com/api/pattern/tools/get_itemset_detail/execute |
POST |
根据 itemset_id 获取 itemset 详情和 post_ids |
https://pattern.aiddit.com/api/pattern/posts/batch |
POST |
根据 post_id 批量获取帖子详情 |
说明:
2026-04-22接口
GET https://pattern.aiddit.com/api/pattern/category_tree
用途
categoriescategory_tree.json对应代码:
参数
execution_idcurl "https://pattern.aiddit.com/api/pattern/category_tree?execution_id=56"
请求格式
GET /api/pattern/category_tree?execution_id=56
返回格式
{
"success": true,
"categories": [
{
"id": 14886,
"source_stable_id": 57,
"source_type": "实质",
"name": "装饰元素",
"description": "用于装饰或美化的图案、纹理、文字等视觉元素",
"category_nature": "领域",
"path": "/表象/符号/装饰符号/装饰元素",
"level": 4,
"parent_id": 15718,
"element_count": 8,
"elements": []
}
]
}
常见字段:
idsource_stable_idsource_typenamedescriptioncategory_naturepathlevelparent_idelement_countelements接口
POST https://pattern.aiddit.com/api/pattern/tools/get_library_frequent_itemsets/execute
用途
对应代码背景:
get_frequent_itemsetsget_library_frequent_itemsets参数
execution_idcurl -X POST "https://pattern.aiddit.com/api/pattern/tools/get_library_frequent_itemsets/execute" \
-H "Content-Type: application/json" \
-d '{"execution_id":56}'
args.top_nargs 内curl -X POST "https://pattern.aiddit.com/api/pattern/tools/get_library_frequent_itemsets/execute" \
-H "Content-Type: application/json" \
-d '{"execution_id":56,"args":{"top_n":5}}'
args.sort_byargs 内absolute_supportcurl -X POST "https://pattern.aiddit.com/api/pattern/tools/get_library_frequent_itemsets/execute" \
-H "Content-Type: application/json" \
-d '{"execution_id":56,"args":{"sort_by":"absolute_support"}}'
args.category_idsargs 内请求格式
最小请求:
{
"execution_id": 56
}
带参数请求:
{
"execution_id": 56,
"args": {
"top_n": 20,
"sort_by": "absolute_support"
}
}
返回格式
顶层返回:
{
"success": true,
"tool_name": "get_library_frequent_itemsets",
"result": "{\"total\": 612, \"showing\": 20, \"groups\": {...}}"
}
注意:
result 是 JSON 字符串解析后格式:
{
"total": 612,
"showing": 20,
"groups": {
"full/max": {
"dimension_mode": "full",
"target_depth": "max",
"total": 612,
"itemsets": [
{
"id": 132046,
"item_count": 3,
"absolute_support": 28,
"items": [
{
"point_type": "关键点",
"dimension": "形式",
"category_id": 15055,
"category_path": "架构>修辞>...>拟人化主体"
}
]
}
]
}
}
}
常见字段:
total showing groupsdimension_mode target_depth total itemsetsid item_count absolute_support itemspoint_type dimension category_id category_path接口
POST https://pattern.aiddit.com/api/pattern/tools/get_itemset_detail/execute
用途
itemset_id 获取 itemset 详情post_ids对应代码:
参数
execution_idargs.itemset_idsargs 内请求格式
{
"execution_id": 56,
"args": {
"itemset_ids": [132046]
}
}
请求示例
curl -X POST "https://pattern.aiddit.com/api/pattern/tools/get_itemset_detail/execute" \
-H "Content-Type: application/json" \
-d '{"execution_id":56,"args":{"itemset_ids":[132046]}}'
返回格式
顶层返回:
{
"success": true,
"tool_name": "get_itemset_detail",
"result": "[{...}]"
}
注意:
result 是 JSON 字符串解析后格式:
[
{
"id": 132046,
"dimension_mode": "full",
"target_depth": "max",
"item_count": 3,
"absolute_support": 28,
"support": 0.0,
"items": [],
"post_ids": []
}
]
常见字段:
iddimension_modetarget_depthitem_countabsolute_supportsupportitemspost_ids接口
POST https://pattern.aiddit.com/api/pattern/posts/batch
用途
post_id 获取帖子详情xiaohongshu对应代码:
参数
post_ids请求格式
{
"post_ids": [
"671f7fab000000003c01fffc",
"63712737"
]
}
请求示例
curl -X POST "https://pattern.aiddit.com/api/pattern/posts/batch" \
-H "Content-Type: application/json" \
-d '{"post_ids":["671f7fab000000003c01fffc","63712737"]}'
返回格式
{
"success": true,
"posts": [
{
"post_id": "671f7fab000000003c01fffc",
"title": "...",
"body_text": "...",
"images": [],
"like_count": 0,
"comment_count": 0,
"collect_count": 0,
"platform": "xiaohongshu",
"platform_account_name": "...",
"publish_date": "...",
"decode_result": {}
}
]
}
常见字段:
post_idtitlebody_textimageslike_countcomment_countcollect_countplatformplatform_account_namepublish_datedecode_resultexecution_id 的传法不统一category_tree:放在 query 参数get_library_frequent_itemsets:放在 body 顶层get_itemset_detail:放在 body 顶层get_library_frequent_itemsets 和旧接口不是简单改名虽然名字相近,但当前行为不同:
execution_id 就能返回整库 itemsetargs.top_n 有效category_ids 传进去会得到空结果所以当前不要直接把旧接口 payload 原样搬过去。
result 字段常常是字符串两个工具接口:
get_library_frequent_itemsetsget_itemset_detail返回里都有:
{
"result": "..."
}
这里的 result 不是最终对象,而是 JSON 字符串,需要再解析一次。
当前:
get_frequent_itemsets/execute 会返回“不允许调用工具”get_library_frequent_itemsets/execute