主题
keywords_data/bing/keywords_for_site/task_get
接口说明
GET /v3/keywords_data/bing/keywords_for_site/task_get/$id
根据任务 ID 获取网站建议结果。本接口返回与指定网站的,以及以下数据:
- 最近一个月的搜索量
- 最近 12 个月的搜索量趋势
- 当前平均每次点击费用(CPC)
- 付费搜索竞争程度
单次请求最多返回 3000 个。
任务创建后,可在 30 天随时获取任务结果。
计费说明
本接口获取结果不单独收费,账户在提交任务时产生费用。任务结果可在提交后的 30 天重复获取。
扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求参数
请求方式为 GET,参数通过 URL 路径传。
| 参数 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识符,UUID 格式。任务提交成功后,可在 30 天使用该 ID 获取任务结果。 |
请求示例
cURL
bash
curl --location --request GET \
"https://api.seermartech.cn/v3/keywords_data/bing/keywords_for_site/task_get/10081459-0001-0108-0000-9cf7e621c573" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"TypeScript
typescript
import axios from "axios";
const taskId = "02231934-2604-0066-2000-570459f04879";
axios
.get(
`https://api.seermartech.cn/v3/keywords_data/bing/keywords_for_site/task_get/${taskId}`,
{
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
}
)
.then((response) => {
// 处理任务结果
console.log(response.data);
})
.catch((error) => {
// 处理请求错误
console.error(error.response?.data || error.message);
});Python
python
import requests
task_id = "10081459-0001-0108-0000-9cf7e621c573"
url = (
"https://api.seermartech.cn"
f"/v3/keywords_data/bing/keywords_for_site/task_get/{task_id}"
)
response = requests.get(
url,
headers={
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
timeout=60,
)
response.raise_for_status()
result = response.json()
# 处理任务结果
print(result)响应结构
接口返回 JSON 对象 tasks 数组。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 请求的通用状态码。 |
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 | 结果数组。 |
如需处理异常,建议根据顶层 status_code 和任务级 status_code 实现错误处理逻辑。
tasks[].data 字段
data 对象提交任务时指定的参数,例如:
| 字段 | 类型 | 说明 |
|---|---|---|
api | string | API 模块名称,通常为 keywords_data。 |
function | string | API 功能名称,通常为 keywords_for_site。 |
se | string | 搜索引擎名称,本接口为 bing。 |
language_code | string | 语言代码。 |
location_code | integer | 地理位置代码。 |
target | string | 目标网站或域名。 |
tasks[].result 字段
每个结果对象以下字段:
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 。 |
location_code | integer | 地理位置代码。如果没有可用数据,则为 null。 |
language_code | string | 语言代码。如果没有可用数据,则为 null。 |
search_partners | boolean | 是否合作伙伴网络中的搜索数据。 |
device | string | 设备类型。如果没有可用数据,则为 null。 |
competition | float | 付费搜索竞争程度,基于搜索广告数据计算。可选值 0.1、0.5 和 0.9:<br> 0.1:低竞争;<br> 0.5:中等竞争;<br> 0.9:高竞争。<br>无数据时为 null。 |
cpc | float | 历史平均每次点击费用。原始数据以计价;如无数据,则为 null。费用以响应头 X-SeerMarTech-Charge-CNY 为准。 |
search_volume | integer | 月均搜索量,表示根据目标地区和定位条件,在 Bing 上搜索该的大致次数。无数据时为 null。 |
categories | array | 产品和服务分类。该字段为历史遗留字段,当前始终为 null。 |
monthly_searches | array | 最近 12 个月的月度搜索量数据。无数据时为 null。 |
monthly_searches素字段
| 字段 | 类型 | 说明 |
|---|---|---|
year | integer | 年份。 |
month | integer | 月份,取值范围为 1 至 12。 |
search_volume | integer | 当月搜索量。搜索量为近似值,并按最接近的整数进行取整。 |
响应示例
json
{
"version": "0.1.20200923",
"status_code": 20000,
"status_message": "Ok.",
"time": "0 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "10081459-0001-0108-0000-9cf7e621c573",
"status_code": 20000,
"status_message": "Ok.",
"time": "0 sec.",
"cost": 0,
"result_count": 2,
"path": [
"v3",
"keywords_data",
"bing",
"keywords_for_site",
"task_get"
],
"data": {
"api": "keywords_data",
"function": "keywords_for_site",
"se": "bing",
"language_code": "en",
"location_code": 2840,
"target": "seermartech.cn"
},
"result": [
{
"keyword": "keyword",
"location_code": 2840,
"language_code": "en",
"search_partners": false,
"device": "all",
"competition": 0.9,
"cpc": 0.94,
"search_volume": 6300,
"categories": null,
"monthly_searches": [
{
"year": 2024,
"month": 6,
"search_volume": 6100
},
{
"year": 2024,
"month": 7,
"search_volume": 6300
}
]
},
{
"keyword": "seo",
"location_code": 2840,
"language_code": "en",
"search_partners": false,
"device": "all",
"competition": 0.9,
"cpc": 0.22,
"search_volume": 5210,
"categories": null,
"monthly_searches": [
{
"year": 2024,
"month": 6,
"search_volume": 5000
},
{
"year": 2024,
"month": 7,
"search_volume": 5210
}
]
}
]
}
]
}状态码与错误处理
建议至少检查以下字段:
- 顶层
status_code tasks_errortasks[].status_codetasks[].status_messagetasks[].result
当任务级状态码表示失败,或 result 为空时,应记录任务 ID 和错误信息,并根据业务需要进行重试或告警。
实用场景
- 挖掘竞品网站:获取目标网站及搜索量,扩展 SEO规划和竞品覆盖分析。
- 评估商业价值:结合
cpc与competition判断的广告竞争程度和潜在转化价值。 - 识别季节性搜索趋势:分析
monthly_searches的 12 个月数据,制定季节性、活动和投放计划。 - 筛选区域市场:按
location_code和language_code获取特定地区及语言的数据,支持本地化 SEO 策略。 - 构建优级模型:综合搜索量、竞争程度和点击费用,为生产和付费搜索投放建立排序依据。