curl --request POST \
--url https://api.aibase.cn/v1/openapi/tasks \
--header "AIBase-API-Key: ${AIBASE_API_KEY}" \
--header 'AIBase-Request-Id: req-20260908-000001' \
--header 'Content-Type: application/json' \
--data '{
"apiCode": "geo.questions_corr_recommend",
"data": {
"keyword": "多智能体系统"
}
}'
import os
import uuid
import requests
api_key = os.environ["AIBASE_API_KEY"]
response = requests.post(
"https://api.aibase.cn/v1/openapi/tasks",
headers={
"AIBase-API-Key": api_key,
"AIBase-Request-Id": str(uuid.uuid4()),
"Content-Type": "application/json",
},
json={
"apiCode": "geo.questions_corr_recommend",
"data": {"keyword": "多智能体系统"},
},
timeout=30,
)
response.raise_for_status()
payload = response.json()
if payload.get("code") != 200:
raise RuntimeError(f"AIBase API error: {payload}")
print(payload["data"]["result"])
print("requestId:", payload["data"].get("requestId"))
import { randomUUID } from "node:crypto";
const apiKey = process.env.AIBASE_API_KEY;
if (!apiKey) throw new Error("请先设置 AIBASE_API_KEY");
const response = await fetch("https://api.aibase.cn/v1/openapi/tasks", {
method: "POST",
headers: {
"AIBase-API-Key": apiKey,
"AIBase-Request-Id": randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
apiCode: "geo.questions_corr_recommend",
data: { keyword: "多智能体系统" },
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const payload = await response.json();
if (payload.code !== 200) throw new Error(`AIBase API error: ${JSON.stringify(payload)}`);
console.log(payload.data.result);
console.log("requestId:", payload.data.requestId);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.aibase.cn/v1/openapi/tasks"))
.header("AIBase-API-Key", System.getenv("AIBASE_API_KEY"))
.header("AIBase-Request-Id", UUID.randomUUID().toString())
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString("""
{
"apiCode": "geo.questions_corr_recommend",
"data": { "keyword": "多智能体系统" }
}
"""))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
{
"code": 200,
"msg": "成功",
"data": {
"result": {
"aiQuestions": [
{ "keyword": "多智能体系统品牌推荐", "hotValue": 532 },
{ "keyword": "多智能体系统哪个好", "hotValue": 720 }
],
"baiduQuestions": [
{ "keyword": "智能体的概念与结构ppt", "hotValue": 0 },
{ "keyword": "多智能体协同控制理论pdf", "hotValue": 0 }
]
},
"requestId": "599b2f8f39078d"
},
"timeStamp": 1788830174812
}
{
"code": 400,
"msg": "请求参数错误",
"data": null,
"timeStamp": 1788830174812
}
AI 对话问题挖掘
根据关键词获取 AI 相关问题和百度相关问题。
POST
/
v1
/
openapi
/
tasks
curl --request POST \
--url https://api.aibase.cn/v1/openapi/tasks \
--header "AIBase-API-Key: ${AIBASE_API_KEY}" \
--header 'AIBase-Request-Id: req-20260908-000001' \
--header 'Content-Type: application/json' \
--data '{
"apiCode": "geo.questions_corr_recommend",
"data": {
"keyword": "多智能体系统"
}
}'
import os
import uuid
import requests
api_key = os.environ["AIBASE_API_KEY"]
response = requests.post(
"https://api.aibase.cn/v1/openapi/tasks",
headers={
"AIBase-API-Key": api_key,
"AIBase-Request-Id": str(uuid.uuid4()),
"Content-Type": "application/json",
},
json={
"apiCode": "geo.questions_corr_recommend",
"data": {"keyword": "多智能体系统"},
},
timeout=30,
)
response.raise_for_status()
payload = response.json()
if payload.get("code") != 200:
raise RuntimeError(f"AIBase API error: {payload}")
print(payload["data"]["result"])
print("requestId:", payload["data"].get("requestId"))
import { randomUUID } from "node:crypto";
const apiKey = process.env.AIBASE_API_KEY;
if (!apiKey) throw new Error("请先设置 AIBASE_API_KEY");
const response = await fetch("https://api.aibase.cn/v1/openapi/tasks", {
method: "POST",
headers: {
"AIBase-API-Key": apiKey,
"AIBase-Request-Id": randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
apiCode: "geo.questions_corr_recommend",
data: { keyword: "多智能体系统" },
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const payload = await response.json();
if (payload.code !== 200) throw new Error(`AIBase API error: ${JSON.stringify(payload)}`);
console.log(payload.data.result);
console.log("requestId:", payload.data.requestId);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.aibase.cn/v1/openapi/tasks"))
.header("AIBase-API-Key", System.getenv("AIBASE_API_KEY"))
.header("AIBase-Request-Id", UUID.randomUUID().toString())
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString("""
{
"apiCode": "geo.questions_corr_recommend",
"data": { "keyword": "多智能体系统" }
}
"""))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
{
"code": 200,
"msg": "成功",
"data": {
"result": {
"aiQuestions": [
{ "keyword": "多智能体系统品牌推荐", "hotValue": 532 },
{ "keyword": "多智能体系统哪个好", "hotValue": 720 }
],
"baiduQuestions": [
{ "keyword": "智能体的概念与结构ppt", "hotValue": 0 },
{ "keyword": "多智能体协同控制理论pdf", "hotValue": 0 }
]
},
"requestId": "599b2f8f39078d"
},
"timeStamp": 1788830174812
}
{
"code": 400,
"msg": "请求参数错误",
"data": null,
"timeStamp": 1788830174812
}
根据一个关键词发现用户可能继续追问的问题,返回 AI 相关问题与百度相关问题两组结果。
完整响应类型为
状态:已上线。 当前 AIBase 开发者 API 仅开放此业务能力。
接口速查
| 项目 | 当前接口约定 |
|---|---|
| 接口状态 | 已上线 |
| 请求方式 | POST |
| 请求地址 | https://api.aibase.cn/v1/openapi/tasks |
| 业务标识 | geo.questions_corr_recommend |
| 身份认证 | Header AIBase-API-Key |
| 请求格式 | application/json |
| 分页 | 不涉及 |
| 调用限制 | 以账号权限和控制台显示为准 |
调用前需要完成三项准备:创建 API Key、仅在服务端读取密钥、为每次调用保留
requestId。请求头
string
required
AIBase 开放平台 API Key,例如
AIBase_xxx。请仅在服务端保存和使用。string
required
固定为
application/json。string
可选的客户端请求标识。建议为每次调用生成唯一值,方便排查链路问题。
请求体
string
required
固定为
geo.questions_corr_recommend。object
required
当前业务接口的参数对象。
string
required
用于发现相关问题的关键词。该字段不能为空。
curl --request POST \
--url https://api.aibase.cn/v1/openapi/tasks \
--header "AIBase-API-Key: ${AIBASE_API_KEY}" \
--header 'AIBase-Request-Id: req-20260908-000001' \
--header 'Content-Type: application/json' \
--data '{
"apiCode": "geo.questions_corr_recommend",
"data": {
"keyword": "多智能体系统"
}
}'
import os
import uuid
import requests
api_key = os.environ["AIBASE_API_KEY"]
response = requests.post(
"https://api.aibase.cn/v1/openapi/tasks",
headers={
"AIBase-API-Key": api_key,
"AIBase-Request-Id": str(uuid.uuid4()),
"Content-Type": "application/json",
},
json={
"apiCode": "geo.questions_corr_recommend",
"data": {"keyword": "多智能体系统"},
},
timeout=30,
)
response.raise_for_status()
payload = response.json()
if payload.get("code") != 200:
raise RuntimeError(f"AIBase API error: {payload}")
print(payload["data"]["result"])
print("requestId:", payload["data"].get("requestId"))
import { randomUUID } from "node:crypto";
const apiKey = process.env.AIBASE_API_KEY;
if (!apiKey) throw new Error("请先设置 AIBASE_API_KEY");
const response = await fetch("https://api.aibase.cn/v1/openapi/tasks", {
method: "POST",
headers: {
"AIBase-API-Key": apiKey,
"AIBase-Request-Id": randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
apiCode: "geo.questions_corr_recommend",
data: { keyword: "多智能体系统" },
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const payload = await response.json();
if (payload.code !== 200) throw new Error(`AIBase API error: ${JSON.stringify(payload)}`);
console.log(payload.data.result);
console.log("requestId:", payload.data.requestId);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.aibase.cn/v1/openapi/tasks"))
.header("AIBase-API-Key", System.getenv("AIBASE_API_KEY"))
.header("AIBase-Request-Id", UUID.randomUUID().toString())
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString("""
{
"apiCode": "geo.questions_corr_recommend",
"data": { "keyword": "多智能体系统" }
}
"""))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
成功响应
integer
required
业务状态码。
200 表示调用成功。string
required
响应说明。
object | null
业务数据。失败时可能为空。
object[]
required
AI 相关问题列表。
object[]
required
百度相关问题列表。
string
required
问题文本。
integer
required
问题热度值。返回
0 不表示接口失败。string
required
问题文本。
integer
required
问题热度值。返回
0 不表示接口失败。string
required
本次请求的唯一追踪标识。联系技术支持时请提供此值。
integer
required
服务端响应时间戳,单位为毫秒。
{
"code": 200,
"msg": "成功",
"data": {
"result": {
"aiQuestions": [
{ "keyword": "多智能体系统品牌推荐", "hotValue": 532 },
{ "keyword": "多智能体系统哪个好", "hotValue": 720 }
],
"baiduQuestions": [
{ "keyword": "智能体的概念与结构ppt", "hotValue": 0 },
{ "keyword": "多智能体协同控制理论pdf", "hotValue": 0 }
]
},
"requestId": "599b2f8f39078d"
},
"timeStamp": 1788830174812
}
{
"code": 400,
"msg": "请求参数错误",
"data": null,
"timeStamp": 1788830174812
}
类型定义
- Java
- TypeScript
public class AIBaseResponse<T> {
private Integer code;
private String msg;
private T data;
private Long timeStamp;
}
public class QuestionsRecommendData {
private QuestionsRecommendResult result;
private String requestId;
}
public class QuestionsRecommendResult {
private List<QuestionItem> aiQuestions;
private List<QuestionItem> baiduQuestions;
}
public class QuestionItem {
private String keyword;
private Integer hotValue;
}
AIBaseResponse<QuestionsRecommendData>。export interface AIBaseResponse<T> {
code: number;
msg: string;
data: T | null;
timeStamp: number;
}
export interface QuestionsRecommendData {
result: QuestionsRecommendResult;
requestId: string;
}
export interface QuestionsRecommendResult {
aiQuestions: QuestionItem[];
baiduQuestions: QuestionItem[];
}
export interface QuestionItem {
keyword: string;
hotValue: number;
}
接入建议
- 在服务端读取 API Key,避免将密钥写入网页或客户端应用。
- 同时处理 HTTP 状态、响应中的业务
code、网络异常和超时。 - 记录
data.requestId,用于日志关联和问题排查。 - 将两组问题按数组处理,并兼容数组为空的情况。
hotValue = 0只表示当前没有可用热度,不表示接口调用失败。
调试时可以直接修改右侧请求示例中的
keyword。需要完整工程步骤时,可打开 Python 调用 或 Node.js 调用;出现异常时按联调排错清单逐项检查。