Skip to content

根据 URL 获取 Bing Ads 建议任务结果

本接口使用 GET 方法,通过任务 ID 获取基于网页 URL 生成的 Bing Ads 建议结果:

GET https://api.seermartech.cn/v3/keywords_data/bing/keyword_suggestions_for_url/task_get/$id

接口会分析任务中指定网页的,并返回列表。每个都 confidence_score,用于表示该与用户搜索查询匹的概率。

计费说明

  • 提交任务时计费。
  • 任务提交后的 30 天,可重复获取任务结果。
  • 实扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
  • 响应中的 cost 表示任务成本,金额单位为人民币。

请求参数

任务 ID 通过 URL 路径传递。

参数类型说明
idstring任务唯一标识,采用 UUID 格式。任务提交后 30 天可使用该 ID 随时获取结果。

请求示例

cURL

bash
id="10081455-0001-0110-0000-c75b21dcca1c"

curl --location --request GET \
  "https://api.seermartech.cn/v3/keywords_data/bing/keyword_suggestions_for_url/task_get/${id}" \
  --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/keyword_suggestions_for_url/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 = "02231934-2604-0066-2000-570459f04879"

url = (
    "https://api.seermartech.cn/v3/keywords_data/bing/"
    f"keyword_suggestions_for_url/task_get/{task_id}"
)

response = requests.get(
    url,
    headers={
        "Authorization": "Bearer smt_live_YOUR_KEY",
        "Content-Type": "application/json",
    },
)

if response.ok:
    data = response.json()
    print(data)
else:
    print(f"请求失败:HTTP {response.status_code}")
    print(response.text)

响应结构

接口返回 JSON 数据,顶层 tasks 数组。每个任务对象任务状态、成本及建议结果。

顶层字段

字段类型说明
versionstring当前 API 版本。
status_codeinteger通用响应状态码。完整错误码请参考错误码文档。
status_messagestring通用状态说明。
timestring接口执行耗时,单位为秒。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks_countintegertasks 数组中的任务数量。
tasks_errorintegertasks 数组中返回错误的任务数量。
tasksarray任务结果数组。

tasks 任务字段

字段类型说明
idstring任务唯一标识,UUID 格式。
status_codeinteger当前任务的状态码,通常位于 1000060000 范围。
status_messagestring当前任务的状态说明。
timestring任务执行耗时,单位为秒。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
result_countintegerresult 数组中的结果数量。
patharray请求 URL 路径信息。
dataobject提交任务时使用的参数。
resultarray建议结果数组。结果 confidence_score 从高到低排序。

data 字段

data 对象提交任务时使用的参数,例如:

字段类型说明
apistringAPI 产品名称,例如 keywords_data
functionstring接口功能名称,例如 keyword_suggestions_for_url
sestring搜索引擎,例如 bing
idstring任务 ID。
language_codestring语言代码,例如 en
targetstring目标网页或域名。

result 结果字段

字段类型说明
keywordstring推荐。
confidence_scorefloat与用户搜索查询匹的置信度,取值范围为 0.01.0

响应示例

json
{
  "version": "0.1.20240801",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.12 sec.",
  "cost": 0,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "09271534-1535-0597-0000-59b5253fe0c0",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.08 sec.",
      "cost": 0,
      "result_count": 3,
      "path": [
        "v3",
        "keywords_data",
        "bing",
        "keyword_suggestions_for_url",
        "task_get",
        "09271534-1535-0597-0000-59b5253fe0c0"
      ],
      "data": {
        "api": "keywords_data",
        "function": "keyword_suggestions_for_url",
        "se": "bing",
        "id": "09271534-1535-0597-0000-59b5253fe0c0",
        "language_code": "en",
        "target": "example.com"
      },
      "result": [
        {
          "keyword": "example keyword",
          "confidence_score": 0.91
        },
        {
          "keyword": "related search term",
          "confidence_score": 0.76
        },
        {
          "keyword": "another relevant keyword",
          "confidence_score": 0.63
        }
      ]
    }
  ]
}

状态码与异常处理

建议客户端同时检查以下状态字段:

  • 顶层 status_code:判断本次 API 请求是否成功。
  • 任务级 tasks[].status_code:判断任务是否成功。
  • tasks_error:确认是否有任务返回错误。
  • result:任务成功时读取建议;如果结果为空,应按无匹处理。

当任务状态码表示错误,或 result 不存在时,应记录对应的 status_message,并根据业务需要进行重试或异常提示。完整状态码列表请参考错误码文档。

实用场景

  • 分析目标页面并扩展库:根据落地页获取,补 SEO 词库并发现新的主题。
  • 评估页面与搜索意图的匹度:结合及置信度判断页面主题是否符合 Bing 用户的潜在搜索需求,指导页面优化。
  • 生成选题建议:批量分析竞品或行业页面,提取高置信度,为文章、产品页和专题页制定选题。
  • 优化 Bing Ads 投放词:使用页面发现潜在广告词,减少人工拓展成本并提升广告组覆盖率。
  • 构建聚类:获取多个 URL 的建议后进行归类和去重,支持站点信息架构及链接规划。

统一入口:官网 · LLM API · 控制台