主题
Bing Ads 根据 URL 获取建议(实时)
本接口使用 POST 方法调用:
/v3/keywords_data/bing/keyword_suggestions_for_url/live
接口会分析指定网页的,返回与页面的建议,并为每个提供 confidence_score(置信度分数),用于表示该与用户搜索词匹的可能性。
实时接口会在单次请求中直接返回结果,无需像标准接口一样分别提交任务和查询结果。如果不要求实时获取数据,也可以使用标准任务接口;标准方式需要分别执行 POST 和 GET 请求,但通常成本更低。
接口信息
http
POST https://api.seermartech.cn/v3/keywords_data/bing/keyword_suggestions_for_url/live请求体使用 UTF-8 编码的 JSON 格式,并且是数组。每次调用只能提交一个任务。
平台限流以认证说明中的 30/60/120 次/分钟规则为准。建议根据业务请求量控制调用频率,并对时、限流及任务级错误进行重试和异常处理。
计费说明
每次请求按任务计费。原始文档未提供固定单价,扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
响应中的 cost 字段(平台原始 USD 成本兼容字段)表示本次任务或请求的成本信息,金额以本平台返回值和响应头为准。
请求参数
请求体示例:
json
[
{
"target": "https://example.com/page",
"language_code": "en",
"exclude_brands": false
}
]| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
target | string | 是 | 分析网页的 URL。最大长度为 2000 个字符。 |
language_name | string | 条件填 | 搜索引擎语言的完整名称。当未指定 language_code 时填。使用该参数后无需同时传 language_code。例如:English。 |
language_code | string | 条件填 | 搜索引擎语言代码。当未指定 language_name 时填。使用该参数后无需同时传 language_name。例如:en。 |
exclude_brands | boolean | 否 | 是否排除品牌。true 表示排除,false 表示不排除。 |
language_name 和 language_code 至少传一个,不能同时缺失。
如需获取可用语言及名称、代码,可调用:
http
GET https://api.seermartech.cn/v3/keywords_data/bing/keyword_suggestions_for_url/languages响应结构
接口返回 JSON 数据 tasks 数组。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 请求级状态码。成功通常为 20000。 |
status_message | string | 请求级状态说明。 |
time | string | 请求执行耗时,单位为秒。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
tasks_count | integer | tasks 数组中的任务总数。 |
tasks_error | integer | tasks 数组中返回错误的任务数量。 |
tasks | array | 任务结果数组。 |
tasks 数组中的字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式。 |
status_code | integer | 任务级状态码,通常在 10000 至 60000 范围。 |
status_message | string | 任务级状态说明。 |
time | string | 任务执行耗时,单位为秒。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
result_count | integer | result 数组中的结果数量。 |
path | array | 请求 URL 路径信息。 |
data | object | 创建任务时提交的参数。 |
result | array | 建议结果数组。结果置信度从高到低排序。 |
result 数组中的字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 建议。 |
confidence_score | float | 与用户搜索词匹的概率分数,取值范围为 0.0 至 1.0。 |
请求示例
curl
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/keywords_data/bing/keyword_suggestions_for_url/live" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"target": "https://example.com/page",
"language_code": "en",
"exclude_brands": true
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/keywords_data/bing/keyword_suggestions_for_url/live"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
# POST 请求体是 JSON 数组,每次调用只能一个任务
payload = [
{
"target": "https://example.com/page",
"language_code": "en",
"exclude_brands": True,
}
]
response = requests.post(url, headers=headers, json=payload, timeout=60)
data = response.json()
if data.get("status_code") == 20000:
print(data)
else:
print(
"请求失败,状态码:%s,状态信息:%s"
% (data.get("status_code"), data.get("status_message"))
)TypeScript
typescript
const url =
"https://api.seermartech.cn/v3/keywords_data/bing/keyword_suggestions_for_url/live";
const response = await fetch(url, {
method: "POST",
headers: {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify([
{
target: "https://example.com/page",
language_code: "en",
exclude_brands: true,
},
]),
});
const result = await response.json();
if (result.status_code === 20000) {
console.log(result);
} else {
console.error(
`请求失败,状态码:${result.status_code},状态信息:${result.status_message}`
);
}响应示例
json
{
"version": "0.1.20240801",
"status_code": 20000,
"status_message": "Ok.",
"time": "12.7173 sec.",
"cost": 0.075,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "0192b7b0-7c1a-735a-9e5d-123456789abc",
"status_code": 20000,
"status_message": "Ok.",
"time": "12.7001 sec.",
"cost": 0.075,
"result_count": 3,
"path": [
"v3",
"keywords_data",
"bing",
"keyword_suggestions_for_url",
"live"
],
"data": {
"api": "keywords_data",
"function": "keyword_suggestions_for_url",
"se": "bing",
"language_code": "en",
"target": "https://example.com/page",
"exclude_brands": true
},
"result": [
{
"keyword": "example keyword",
"confidence_score": 0.94
},
{
"keyword": "related search term",
"confidence_score": 0.81
},
{
"keyword": "additional keyword",
"confidence_score": 0.67
}
]
}
]
}错误处理
请同时检查请求级和任务级状态码:
status_code = 20000:请求或任务处理成功。tasks_error > 0:至少有一个任务处理失败。- 当任务级
status_code不为20000时,应结合对应的status_message记录错误原因。 - 建议对网络时、HTTP 错误、限流以及可重试的任务错误实施重试机制。
- 生产环境中应记录任务
id,便于定位请求和排查问题。
实用场景
- 分析竞品页面并提取建议:根据竞品落地页发现搜索词,补库并支持竞品 SEO 研究。
- 扩展现有页面的主题:为已发布的文章或产品页生成,识别可新增的方向和长尾词。
- 筛选非品牌:启用
exclude_brands排除品牌词,构建更适合通用搜索流量拓展的集合。 - 按目标语言生成方案:通过
language_code或language_name指定语言,为不同国家或地区的页面制定本地化 SEO 策略。 - 实时驱动审核与优化流程:在页面发布或更新后即时获取建议和置信度,判断页面主题覆盖。