Skip to content

keywords_data/bing/locations

GET /v3/keywords_data/bing/locations

获取 Bing 数据 API 支持的地域列表。

HTTP 方法:GET
接口路径:/v3/keywords_data/bing/locations
完整地址:https://api.seermartech.cn/v3/keywords_data/bing/locations

该接口无需请求参数,调用后将返回 Bing Ads API 支持的地域及层级。

> 注意:由于服务政策调整,俄罗斯和白俄罗斯的地域目前不再受支持。

效果接口可能使用不同的地域和语言列表,请以对应接口文档为准。

计费说明

本接口当前不收取调用费用,响应中的 cost 通常为 0。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

请求示例

cURL

bash
curl --location --request GET \
  "https://api.seermartech.cn/v3/keywords_data/bing/locations" \
  --header "Authorization: Bearer smt_live_YOUR_KEY" \
  --header "Content-Type: application/json"

Python

python
import requests

url = "https://api.seermartech.cn/v3/keywords_data/bing/locations"

headers = {
    "Authorization": "Bearer smt_live_YOUR_KEY",
    "Content-Type": "application/json",
}

response = requests.get(url, headers=headers)
data = response.json()

if data.get("status_code") == 20000:
    print(data)
else:
    print(
        "请求失败,错误码:{},错误信息:{}".format(
            data.get("status_code"),
            data.get("status_message"),
        )
    )

TypeScript

typescript
import axios from "axios";

axios
  .get("https://api.seermartech.cn/v3/keywords_data/bing/locations", {
    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);
  });

响应结构

接口返回 JSON 数据,顶层 tasks 数组。每个任务的 result 数组一个地域对象。

字段名类型说明
versionstring当前 API 版本
status_codeinteger通用响应状态码
status_messagestring通用状态说明
timestring请求执行耗时,单位为秒
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks_countintegertasks 数组中的任务数量
tasks_errorintegertasks 数组中返回错误的任务数量
tasksarray任务列表
tasks[].idstring任务唯一标识,UUID 格式
tasks[].status_codeinteger任务状态码,通常位于 1000060000 范围
tasks[].status_messagestring任务状态说明
tasks[].timestring任务执行耗时,单位为秒
tasks[].costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks[].result_countintegerresult 数组中的数量
tasks[].patharray请求 URL 路径
tasks[].dataobjectGET 请求 URL 中使用的参数信息
tasks[].resultarray地域结果列表
tasks[].result[].location_codeinteger地域编码
tasks[].result[].location_namestring地域完整名称
tasks[].result[].location_code_parentinteger上级地域编码
tasks[].result[].country_iso_codestring地域所属国家或地区的 ISO 编码
tasks[].result[].location_typestring地域类型

地域层级

location_code_parent 用于表示当前地域的上级地域。例如:

json
{
  "location_code": 9041134,
  "location_name": "Vienna International Airport,Lower Austria,Austria",
  "location_code_parent": 20044
}

location_code_parent20044 的上级地域可能为:

json
{
  "location_code": 20044,
  "location_name": "Lower Austria,Austria"
}

响应示例

json
{
  "version": "0.1.20201021",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.2425 sec.",
  "cost": 0,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.1000 sec.",
      "cost": 0,
      "result_count": 1,
      "path": [
        "v3",
        "keywords_data",
        "bing",
        "locations"
      ],
      "data": {
        "api": "keywords_data",
        "function": "locations",
        "se": "bing"
      },
      "result": [
        {
          "location_code": 9041134,
          "location_name": "Vienna International Airport,Lower Austria,Austria",
          "location_code_parent": 20044,
          "country_iso_code": "AT",
          "location_type": "Airport"
        }
      ]
    }
  ]
}

响应状态码

  • 20000:请求成功。
  • 状态码:请求或任务处理失败,错误信息请查看 status_message 字段。

实用场景

  • 构建地域选择器:获取 Bing 支持的国家、城市及细分地域,帮助 SEO 平台为用户提供标准化地域筛选项。
  • 解析地域层级:利用 location_code_parent 建立国家、省州、城市等层级,支持按地域聚合数据。
  • 校验投放地域:在提交 Bing 任务前核对地域编码,减少因地域不受支持导致的任务失败。
  • 统一地域主数据:定期同步地域编码、名称和 ISO 国家代码,为跨市场分析和报表系统提供统一维度。
  • 生成区域化 SEO 报告:根据地域编码匹或广告数据,比较不同市场的搜索表现与业务机会。

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