Skip to content

按任务 ID 获取 Bing 类目结果

本接口使用 GET 方法,通过任务 ID 获取 Bing 类目任务的结果:

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

接口会返回指定产品或服务类目下的建议,并提供以下数据:

  • 最近一个月的搜索量
  • 最近 12 个月的搜索量趋势
  • 付费搜索竞争度
  • 平均每次点击成本(CPC)
  • 所属的产品或服务类目

同一类目返回的通常不随地域变化,但竞争度、CPC、搜索量和月度搜索数据会根据任务中指定的地域返回。单个任务最多可返回 3000 条建议。

计费说明

本接口查询已提交任务的结果,不会因重复获取结果而重复创建任务。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

任务结果通常可在任务创建后的 30 天通过任务 ID 查询。

请求参数

路径参数

参数类型说明
idstring任务唯一标识,UUID 格式。任务创建后 30 天可使用该 ID 查询结果。

请求示例

cURL

bash
task_id="10251448-0001-0109-0000-6f4dd84c430d"

curl --location --request GET \
  "https://api.seermartech.cn/v3/keywords_data/bing/keywords_for_category/task_get/${task_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/keywords_for_category/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"keywords_for_category/task_get/{task_id}"
)

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

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

响应结构

接口返回 JSON 对象,主要字段如下:

字段类型说明
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请求路径信息。
dataobject创建任务时提交的参数。
resultarray结果数组。

tasks.data 字段

data 对象通常创建任务时提交的参数,例如:

字段类型说明
apistringAPI 模块名称,例如 keywords_data
functionstring功能名称,例如 keywords_for_category
sestring搜索引擎名称,例如 bing
location_codeinteger地域代码。
language_codestring语言代码。
category_codeinteger产品或服务类目代码。

tasks.result 字段

字段类型说明
keywordstring
location_codeinteger地域代码。无数据时为 null
language_codestring语言代码。无数据时为 null
search_partnersboolean是否合作伙伴网络中的数据。
devicestring设备类型。数据会指定设备返回;无数据时为 null
competitionfloat付费搜索竞争度,取值范围为 01,边界值。该值反映付费搜索结果中的相对竞争程度;无数据时为 null
cpcfloat平均每次点击成本。该值表示历史付费搜索中的平均点击成本;无数据时为 null。如需换算人民币,可按汇率或业务计价口径换算。
search_volumeinteger最近一个月的月均搜索量。搜索量为近似值,可能经过取整;无数据时为 null
categoriesarray对应的产品或服务类目。无数据时为 null
monthly_searchesarray最近 12 个月、针对指定地域的月度搜索量数据。无数据时为 null

monthly_searches 字段

字段类型说明
yearinteger年份。
monthinteger月份。
search_volumeinteger当月月均搜索量,通常为近似值并经过取整。

响应示例

json
{
  "version": "0.1.20200923",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0 sec.",
  "cost": 0,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "10251448-0001-0109-0000-6f4dd84c430d",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0 sec.",
      "cost": 0,
      "result_count": 2,
      "path": [
        "v3",
        "keywords_data",
        "bing",
        "keywords_for_category",
        "task_get"
      ],
      "data": {
        "api": "keywords_data",
        "function": "keywords_for_category",
        "se": "bing",
        "location_code": 2840,
        "language_code": "en",
        "category_code": 10178
      },
      "result": [
        {
          "keyword": "sunglasses",
          "location_code": 2840,
          "language_code": "en",
          "search_partners": false,
          "device": "desktop",
          "competition": 0.9,
          "cpc": 0.28,
          "search_volume": 177700,
          "categories": [
            10178
          ],
          "monthly_searches": [
            {
              "year": 2024,
              "month": 1,
              "search_volume": 165000
            },
            {
              "year": 2024,
              "month": 2,
              "search_volume": 177700
            }
          ]
        },
        {
          "keyword": "cheap sunglasses",
          "location_code": 2840,
          "language_code": "en",
          "search_partners": false,
          "device": "desktop",
          "competition": 0.72,
          "cpc": 0.28,
          "search_volume": 12100,
          "categories": [
            10178
          ],
          "monthly_searches": [
            {
              "year": 2024,
              "month": 1,
              "search_volume": 9900
            },
            {
              "year": 2024,
              "month": 2,
              "search_volume": 12100
            }
          ]
        }
      ]
    }
  ]
}

状态码与异常处理

接口级和任务级状态码均应进行判断:

  • 20000:请求或任务执行成功。
  • 40000 及以上:通常表示任务处理失败或返回异常。
  • tasks_error > 0:表示至少有一个任务返回错误。

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

  1. 顶层 status_code
  2. tasks[].status_code
  3. tasks[].status_message
  4. tasks[].result 是否存在;
  5. tasks_error 是否大于 0

完整状态码和错误说明请参考本平台错误码文档。

实用场景

  • 获取类目:根据产品类目批量发现搜索词,扩大 SEO和落地页的覆盖范围。
  • 评估商业价值:结合 competitioncpc 筛选付费竞争适中、转化潜力较高的。
  • 分析搜索趋势:使用 monthly_searches 对比过去 12 个月的搜索量,识别季节性需求和增长词。
  • 制定地域化 SEO 策略:按不同 location_code 获取搜索量、竞争度和 CPC 数据,为地区站点或市场投放制定优级。
  • 规划与广告协同:将高搜索量用于选题,将高 CPC 或高竞争用于广告预算和竞品投放分析。

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