Skip to content

设置 Bing Ads 受众估算任务

POST /v3/keywords_data/bing/audience_estimation/task_post

本接口使用 POST /v3/keywords_data/bing/audience_estimation/task_post 创建 Bing Ads 受众估算任务。

接口根据指定的定位条件,估算广告活动的受众规模,并返回预计受众总量、建议出价、预算和参与度等指标。

本接口采用标准任务模式:提交任务后,系统异步采集数据。任务完成后,可通过任务 ID 获取结果。执行时间取决于系统负载。

如果业务需要实时返回结果,可使用实时查询接口。实时模式会在同一个请求中完成任务提交和结果返回,无需分别调用 POST 和 GET 接口。

请求地址

text
POST https://api.seermartech.cn/v3/keywords_data/bing/audience_estimation/task_post

计费说明

提交任务时计费,无论后续是否通过任务 ID 获取结果,均不会重复收取任务设置费用。

参考价约 ¥0.36 / 任务(示例响应中的 0.05 USD 按参考汇率折算供价格说明)。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

请求说明

  • 请求体使用 UTF-8 编码的 JSON 格式。
  • 请求体是 JSON 数组,每个数组代表一个任务。
  • 单次请求最多 100 个任务。 平台限流以认证说明中的 30/60/120 次/分钟规则为准。
  • 如果单次请求 100 个任务,出部分将返回错误码 40006
  • 可通过任务返回的唯一 id 获取任务结果。
  • 提交任务时也可以指定 postback_urlpingback_url,任务完成后由本平台向指定地址推送结果。
  • 如果接收服务器在 10 秒未响应,推送连接将因时中止,任务会转 tasks_ready 列表。错误码和错误信息取决于接收服务器。

请求参数

每个任务对象支持以下字段:

字段类型说明
location_namestring搜索引擎位置的完整名称。如果未指定 location_codelocation_coordinate,则填。使用此字段后,无需再指定另外两个位置字段。可通过 /v3/keywords_data/bing/locations 获取可用位置名称。示例:London,England,United Kingdom
location_codeinteger搜索引擎位置代码。如果未指定 location_namelocation_coordinate,则填。使用此字段后,无需再指定另外两个位置字段。可通过 /v3/keywords_data/bing/locations 获取可用位置代码。示例:2840
location_coordinatestring位置的 GPS 坐标,格式为 "纬度,经度,半径()"。数据将指定坐标所属国家提供。示例:29.6821525,-82.4098881,100
agearray目标年龄段。可选值:eighteen_to_twenty_fourfifty_to_sixty_foursixty_five_and_abovethirteen_to_seventeenthirty_five_to_forty_ninetwenty_five_to_thirty_fourunknownzero_to_twelve
bidfloat目标出价,单位为。最大值:1000。使用时请根据账户币种和投放换算。
daily_budgetfloat广告活动每日预算,单位为。最大值:10000。使用时请根据账户币种和投放换算。
genderarray目标性别。可选值:malefemaleunknown
industryarrayLinkedIn 资料定位中的行业 ID。可通过 /v3/keywords_data/bing/audience_estimation/industries 获取可用行业名称及对应 ID。示例:806301758
job_functionarrayLinkedIn 资料定位中的职能 ID。可通过 /v3/keywords_data/bing/audience_estimation/job_functions 获取可用职能名称及对应 ID。示例:806300451
postback_urlstring可选。任务完成后接收结果推送的 URL。
pingback_urlstring可选。任务完成后接收结果通知的 URL。

位置参数互斥

以下三个字段至少提供一个,且不建议同时提供:

  • location_name
  • location_code
  • location_coordinate

请求示例

cURL

bash
curl --location --request POST \
  "https://api.seermartech.cn/v3/keywords_data/bing/audience_estimation/task_post" \
  --header "Authorization: Bearer smt_live_YOUR_KEY" \
  --header "Content-Type: application/json" \
  --data-raw '[
    {
      "location_code": 2840,
      "bid": 10,
      "daily_budget": 24,
      "gender": ["male", "female"],
      "industry": [806301758],
      "job_function": [806300451]
    }
  ]'

PHP

php
<?php

$apiUrl = 'https://api.seermartech.cn';
$apiKey = 'smt_live_YOUR_KEY';

$postData = [
    [
        'location_code' => 2840,
        'bid' => 10,
        'daily_budget' => 24
    ]
];

$ch = curl_init($apiUrl . '/v3/keywords_data/bing/audience_estimation/task_post');

curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . $apiKey,
        'Content-Type: application/json'
    ],
    CURLOPT_POSTFIELDS => json_encode($postData, JSON_UNESCAPED_UNICODE)
]);

$response = curl_exec($ch);

if ($response === false) {
    throw new Exception(curl_error($ch));
}

curl_close($ch);

$result = json_decode($response, true);

if ($result['status_code'] === 20000) {
    print_r($result);
} else {
    echo '错误码:' . $result['status_code'] . PHP_EOL;
    echo '错误信息:' . $result['status_message'] . PHP_EOL;
}

TypeScript

typescript
const response = await fetch(
  "https://api.seermartech.cn/v3/keywords_data/bing/audience_estimation/task_post",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer smt_live_YOUR_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify([
      {
        location_code: 2840,
        bid: 10,
        daily_budget: 24,
        gender: ["male", "female"],
        industry: [806301758],
        job_function: [806300451],
      },
    ]),
  }
);

const result = await response.json();

if (result.status_code === 20000) {
  console.log(result);
} else {
  console.error(
    `错误码:${result.status_code},错误信息:${result.status_message}`
  );
}

Python

python
import requests

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

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

post_data = [
    {
        "location_code": 2840,
        "bid": 10,
        "daily_budget": 24,
        "gender": ["male", "female"],
        "industry": [806301758],
        "job_function": [806300451],
    }
]

response = requests.post(url, headers=headers, json=post_data)
result = response.json()

if result.get("status_code") == 20000:
    print(result)
else:
    print(
        f"错误码:{result.get('status_code')},"
        f"错误信息:{result.get('status_message')}"
    )

响应结构

接口返回 JSON 对象 tasks 数组已创建任务的信息。

顶层响应字段

字段类型说明
versionstring当前 API 版本
status_codeinteger顶层状态码。20000 表示请求成功。完整错误码请参考错误码文档。
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 / null任务结果数组。创建任务成功后,此字段通常为 null,需要在任务完成后获取结果。

响应示例

json
{
  "version": "0.1.20240801",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.1243 sec.",
  "cost": 0.05,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "01234567-89ab-cdef-0123-456789abcdef",
      "status_code": 20100,
      "status_message": "Task Created.",
      "time": "0.0187 sec.",
      "cost": 0.05,
      "result_count": 0,
      "path": [
        "v3",
        "keywords_data",
        "bing",
        "audience_estimation",
        "task_post"
      ],
      "data": {
        "api": "keywords_data",
        "function": "audience_estimation",
        "se": "bing",
        "location_coordinate": "29.6821525,-82.4098881,100",
        "age": [
          "twenty_five_to_thirty_four"
        ],
        "bid": 1,
        "daily_budget": 24,
        "gender": [
          "male",
          "female"
        ],
        "industry": [
          806301758
        ],
        "job_function": [
          806300451
        ]
      },
      "result": null
    }
  ]
}

状态码与错误处理

  • 顶层 status_code20000:请求已成功处理。
  • 单个任务的 status_code 用于表示该任务的创建状态或错误状态。
  • 单次请求 100 个任务时,出限制的任务将返回 40006
  • 建议客户端同时检查:
    • HTTP 状态码;
    • 顶层 status_code
    • 每个任务的 status_code
    • tasks_error 是否大于 0
  • 完整状态码和错误信息请参考错误码文档。

实用场景

  • 评估广告受众规模:根据地区、年龄和性别预估目标受众数量,为广告投放范围和预算规划提供依据。
  • 比较不同定位组合:批量提交多个行业、职能或人口属性组合,筛选潜在受众更大的定向方案。
  • 制定广告预算:结合 biddaily_budget 估算不同出价与日预算下的投放潜力,制定媒体采购计划。
  • 构建 LinkedIn 职业人群画像:使用行业和职能 ID 评估企业决策、专业人士等职业人群的可触达规模。
  • 批量生成投放建议:通过一次提交多个任务,为不同国家、地区或人群建立受众规模对比报表,支持 SEO 与付费搜索协同决策。

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