搜索接口用于根据自然语言查询搜索可用的工具。基于语义匹配返回最相关的工具列表,包含工具的详细信息和参数说明。
计费说明:search 接口按 Token 计费,根据查询内容和返回结果的 Token 数量收费,价格低廉。
POST https://api.jisuapi.com/agent/search
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
query | string | 是 | 自然语言查询(例如:"查询手机号归属地") |
limit | integer | 否 | 返回结果数量,默认 5,最大 20 |
category | string | 否 | 工具分类筛选(例如:"生活"、"金融") |
| Header | 值 | 说明 |
|---|---|---|
Authorization | Bearer {appkey} | APPKEY 认证 |
Content-Type | application/json | 请求体格式 |
{
"status": 0,
"msg": "ok",
"result": {
"search_id": "sch_20260603_120001_xxx",
"query": "查询手机号归属地",
"total": 2,
"tools": [
{
"tool_id": "shouji_query",
"name": "手机号码归属地查询",
"description": "查询手机号码的归属地、运营商等信息",
"category": "生活",
"price_info": {
"is_free": true,
"free_quota": 100,
"price_per_call": 0.0
},
"parameters": {
"mobile": {
"type": "string",
"required": true,
"description": "11位手机号码"
}
},
"example": {
"mobile": "13800138000"
},
"match_score": 0.95
}
]
},
"request_id": "req_..."
} {
"status": 303,
"msg": "搜索查询为空",
"result": null
} | status | msg | 说明 |
|---|---|---|
| 101 | APPKEY为空或不存在 | 未提供有效的APPKEY |
| 203 | query 不能为空 | 参数错误 |
| 303 | 搜索查询为空 | query 参数为空 |
| 304 | 未找到匹配的工具 | 没有找到相关工具 |
| 字段 | 类型 | 说明 |
|---|---|---|
tool_id | string | 工具唯一标识符,用于调用 execute 接口 |
name | string | 工具名称 |
description | string | 工具功能描述 |
category | string | 工具分类 |
price_info | object | 计费信息 |
parameters | object | 参数定义(JSON Schema 格式) |
example | object | 调用示例 |
match_score | float | 匹配度分数(0-1) |
curl -X POST "https://api.jisuapi.com/agent/search" \
-H "Authorization: Bearer 你的APPKEY" \
-H "Content-Type: application/json" \
-d '{
"query": "查询手机号归属地"
}' curl -X POST "https://api.jisuapi.com/agent/search" \
-H "Authorization: Bearer 你的APPKEY" \
-H "Content-Type: application/json" \
-d '{
"query": "天气预报",
"limit": 3
}' curl -X POST "https://api.jisuapi.com/agent/search" \
-H "Authorization: Bearer 你的APPKEY" \
-H "Content-Type: application/json" \
-d '{
"query": "股票",
"category": "金融",
"limit": 5
}' import requests
url = "https://api.jisuapi.com/agent/search"
headers = {
"Authorization": "Bearer 你的APPKEY",
"Content-Type": "application/json"
}
data = {
"query": "查询手机号归属地",
"limit": 3
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
if result["status"] == 0:
tools = result["result"]["tools"]
print(f"找到 {len(tools)} 个工具:")
for tool in tools:
print(f"- {tool['name']} ({tool['tool_id']})")
print(f" 描述: {tool['description']}")
print(f" 匹配度: {tool['match_score']:.2f}")
else:
print(f"搜索失败: {result['msg']}") 包含关键词和具体需求,例如:
使用多个相关关键词提高准确度:
A: 完全免费,不消耗任何额度。
A: 使用更具体的描述,包含关键词和使用场景。例如用"查询手机号归属地"代替"手机"。
A: 通常 > 0.7 表示较好匹配,> 0.9 表示非常准确。建议提示用户确认或展示多个选项。
A: 尝试换用不同的关键词或更详细的描述。也可以访问 Agent 可用接口列表 浏览所有工具。


© 2015-2025 杭州极速互联科技有限公司 版权所有 浙ICP备17047587号-4 浙公网安备33010502005096 增值电信业务经营许可证:浙B2-20190875