curl --location 'https://geobaseapi.aibase.com/v1/openapi/execute' \
--header 'Content-Type: application/json' \
--header 'AIBase-API-Key: AIBase_xxxxxxxxxxxxxxxx' \
--header 'AIBase-Request-Id: req-20260924-001' \
--data '{
"apiCode": "geo.competitors",
"data": {
"brandId": "brand-001",
"competitorName": "竞品A"
}
}'
import os
import requests
api_key = os.environ["AIBASE_API_KEY"]
headers = {
"AIBase-API-Key": api_key,
"Content-Type": "application/json",
"AIBase-Request-Id": "req-20260924-001",
}
res = requests.post(
"https://geobaseapi.aibase.com/v1/openapi/execute",
headers=headers,
json={"apiCode": "geo.competitors", "data": {"brandId": "brand-001", "competitorName": "竞品A"}},
timeout=60,
)
res.raise_for_status()
payload = res.json()
if payload["code"] == 200:
for item in payload["data"]["records"]:
print(item)
const res = await fetch("https://geobaseapi.aibase.com/v1/openapi/execute", {
method: "POST",
headers: {
"Content-Type": "application/json",
"AIBase-API-Key": process.env.AIBASE_API_KEY,
"AIBase-Request-Id": "req-20260924-001",
},
body: JSON.stringify({"apiCode": "geo.competitors", "data": {"brandId": "brand-001", "competitorName": "竞品A"}}),
});
const payload = await res.json();
if (payload.code === 200) {
for (const item of payload.data.records) {
console.log(item);
}
}
String body = """
{
"apiCode": "geo.competitors",
"data": {
"brandId": "brand-001",
"competitorName": "竞品A"
}
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://geobaseapi.aibase.com/v1/openapi/execute"))
.header("Content-Type", "application/json")
.header("AIBase-API-Key", "AIBase_xxxxxxxxxxxxxxxx")
.header("AIBase-Request-Id", "req-20260924-001")
.POST(BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, BodyHandlers.ofString());
System.out.println(response.body());
{
"code": 200,
"msg": "成功",
"data": {
"records": [
{
"id": "comp-001",
"competitorName": "竞品A",
"logoUrl": "https://cdn.example.com/comp-a.png",
"monitorType": 1,
"competitorWebsite": "https://www.comp-a.com",
"competitorKeywords": ["关键词1", "关键词2"],
"createTime": "2026-09-20 10:00:00"
}
],
"total": 1,
"size": -1,
"current": 1,
"pages": 1
},
"timeStamp": 1788830174812
}
竞品列表查询
查询指定品牌下的竞争对手列表。
POST
/
v1
/
openapi
/
execute
curl --location 'https://geobaseapi.aibase.com/v1/openapi/execute' \
--header 'Content-Type: application/json' \
--header 'AIBase-API-Key: AIBase_xxxxxxxxxxxxxxxx' \
--header 'AIBase-Request-Id: req-20260924-001' \
--data '{
"apiCode": "geo.competitors",
"data": {
"brandId": "brand-001",
"competitorName": "竞品A"
}
}'
import os
import requests
api_key = os.environ["AIBASE_API_KEY"]
headers = {
"AIBase-API-Key": api_key,
"Content-Type": "application/json",
"AIBase-Request-Id": "req-20260924-001",
}
res = requests.post(
"https://geobaseapi.aibase.com/v1/openapi/execute",
headers=headers,
json={"apiCode": "geo.competitors", "data": {"brandId": "brand-001", "competitorName": "竞品A"}},
timeout=60,
)
res.raise_for_status()
payload = res.json()
if payload["code"] == 200:
for item in payload["data"]["records"]:
print(item)
const res = await fetch("https://geobaseapi.aibase.com/v1/openapi/execute", {
method: "POST",
headers: {
"Content-Type": "application/json",
"AIBase-API-Key": process.env.AIBASE_API_KEY,
"AIBase-Request-Id": "req-20260924-001",
},
body: JSON.stringify({"apiCode": "geo.competitors", "data": {"brandId": "brand-001", "competitorName": "竞品A"}}),
});
const payload = await res.json();
if (payload.code === 200) {
for (const item of payload.data.records) {
console.log(item);
}
}
String body = """
{
"apiCode": "geo.competitors",
"data": {
"brandId": "brand-001",
"competitorName": "竞品A"
}
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://geobaseapi.aibase.com/v1/openapi/execute"))
.header("Content-Type", "application/json")
.header("AIBase-API-Key", "AIBase_xxxxxxxxxxxxxxxx")
.header("AIBase-Request-Id", "req-20260924-001")
.POST(BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, BodyHandlers.ofString());
System.out.println(response.body());
{
"code": 200,
"msg": "成功",
"data": {
"records": [
{
"id": "comp-001",
"competitorName": "竞品A",
"logoUrl": "https://cdn.example.com/comp-a.png",
"monitorType": 1,
"competitorWebsite": "https://www.comp-a.com",
"competitorKeywords": ["关键词1", "关键词2"],
"createTime": "2026-09-20 10:00:00"
}
],
"total": 1,
"size": -1,
"current": 1,
"pages": 1
},
"timeStamp": 1788830174812
}
查询指定品牌下的竞争对手列表。可通过
完整响应类型可表示为
可按以下 TypeScript 类型定义解析响应数据。
competitorName 按名称模糊筛选,不传则返回该品牌全部竞品。接口固定返回全量列表,按创建时间倒序排列。
执行模式:SYNC · 实时请求。
请求发出后服务端同步执行业务,结果直接在当前响应的
data 中返回,不存在异步任务、无需轮询、无需二次查询。接口速查
| 项目 | 当前接口约定 |
|---|---|
| 接口状态 | 已上线 |
| 请求方式 | POST |
| 请求地址 | https://geobaseapi.aibase.com/v1/openapi/execute |
| 业务标识 | geo.competitors |
| 执行模式 | SYNC · 实时请求(直接返回,无需轮询) |
| 身份认证 | Header AIBase-API-Key |
| 请求格式 | application/json |
| 返回结构 | 分页结构(含 records) |
请求头
string
required
开发者 API Key,例如
AIBase_xxx。用于身份认证、有效期与调用权限校验,请仅在服务端保存和使用。string
required
固定为
application/json。string
开发者自定义请求 ID,用于请求追踪;不传时系统自动生成 UUID。
请求体
string
required
固定为
geo.competitorsstring
required
所属品牌 ID,为空返回
4001string
竞品名称关键字,按名称模糊筛选;不传返回全部竞品
curl --location 'https://geobaseapi.aibase.com/v1/openapi/execute' \
--header 'Content-Type: application/json' \
--header 'AIBase-API-Key: AIBase_xxxxxxxxxxxxxxxx' \
--header 'AIBase-Request-Id: req-20260924-001' \
--data '{
"apiCode": "geo.competitors",
"data": {
"brandId": "brand-001",
"competitorName": "竞品A"
}
}'
import os
import requests
api_key = os.environ["AIBASE_API_KEY"]
headers = {
"AIBase-API-Key": api_key,
"Content-Type": "application/json",
"AIBase-Request-Id": "req-20260924-001",
}
res = requests.post(
"https://geobaseapi.aibase.com/v1/openapi/execute",
headers=headers,
json={"apiCode": "geo.competitors", "data": {"brandId": "brand-001", "competitorName": "竞品A"}},
timeout=60,
)
res.raise_for_status()
payload = res.json()
if payload["code"] == 200:
for item in payload["data"]["records"]:
print(item)
const res = await fetch("https://geobaseapi.aibase.com/v1/openapi/execute", {
method: "POST",
headers: {
"Content-Type": "application/json",
"AIBase-API-Key": process.env.AIBASE_API_KEY,
"AIBase-Request-Id": "req-20260924-001",
},
body: JSON.stringify({"apiCode": "geo.competitors", "data": {"brandId": "brand-001", "competitorName": "竞品A"}}),
});
const payload = await res.json();
if (payload.code === 200) {
for (const item of payload.data.records) {
console.log(item);
}
}
String body = """
{
"apiCode": "geo.competitors",
"data": {
"brandId": "brand-001",
"competitorName": "竞品A"
}
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://geobaseapi.aibase.com/v1/openapi/execute"))
.header("Content-Type", "application/json")
.header("AIBase-API-Key", "AIBase_xxxxxxxxxxxxxxxx")
.header("AIBase-Request-Id", "req-20260924-001")
.POST(BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, BodyHandlers.ofString());
System.out.println(response.body());
返回参数
业务结果位于data,为分页结构,其中 records 为竞品列表(本接口固定返回全量,size = -1)。
object[]
竞品明细列表。
string
竞品唯一标识。
string
竞品名称。
string
竞品 Logo URL。
integer
1 开启监控,0 关闭监控。string
竞品官网 URL。
object
竞品监控关键词,JSON 数组解析后的数组,可能为 null。
string
格式
yyyy-MM-dd HH:mm:ss。long / integer
总数、每页条数、当前页、总页数;本接口返回全量,
size = -1。long / integer
同上,见上方分页字段说明。
long / integer
同上,见上方分页字段说明。
long / integer
同上,见上方分页字段说明。
{
"code": 200,
"msg": "成功",
"data": {
"records": [
{
"id": "comp-001",
"competitorName": "竞品A",
"logoUrl": "https://cdn.example.com/comp-a.png",
"monitorType": 1,
"competitorWebsite": "https://www.comp-a.com",
"competitorKeywords": ["关键词1", "关键词2"],
"createTime": "2026-09-20 10:00:00"
}
],
"total": 1,
"size": -1,
"current": 1,
"pages": 1
},
"timeStamp": 1788830174812
}
接入注意事项
apiCode必须固定为geo.competitors。brandId为必填参数,为空返回4001(所需参数不足)。competitorName可选,按名称模糊筛选。- 接口固定返回全量列表,
size = -1,无需传分页参数。 competitorKeywords可能为null,解析时做好空值兼容。- 建议先通过
geo.brand获取品牌 ID,再调用本接口。
Java 返回对象
Java 返回对象
public class CompetitorData {
private String id;
private String competitorName;
private String logoUrl;
private Integer monitorType;
private String competitorWebsite;
private Object competitorKeywords;
private LocalDateTime createTime;
}
ReturnResult<PageResult<CompetitorData>>(PageResult 定义见 6.2.5)。TypeScript 类型
TypeScript 类型
export interface CompetitorData {
id: string;
competitorName: string;
logoUrl: string | null;
monitorType: number;
competitorWebsite: string | null;
competitorKeywords: string[] | null;
createTime: string;
}
本页的 cURL 与 Java 示例来自官方接口文档;Python 与 Node.js 示例为等价转写,未经服务端联调,请以实际返回结果为准。