Skip to content

keywords_data/bing/audience_estimation/job_functions

GET /v3/keywords_data/bing/audience_estimation/job_functions

本接口使用 GET 方法,路径为:

/v3/keywords_data/bing/audience_estimation/job_functions

接口说明

获取 Bing Ads Audience Estimation 支持的职位职能列表及对应的 job_function_id。返回结果可用于构建受众估算请求中的职位职能筛选条件。

计费说明

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

请求

请求方法

GET

请求地址

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

请求头

http
Authorization: Bearer smt_live_YOUR_KEY
Content-Type: application/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职位职能结果数组

result 数组字段

字段类型说明
job_function_idinteger职位职能 ID
job_function_namestring职位职能名称

请求示例

cURL

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

PHP

php
<?php

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => 'https://api.seermartech.cn/v3/keywords_data/bing/audience_estimation/job_functions',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer smt_live_YOUR_KEY',
        'Content-Type: application/json',
    ],
]);

$response = curl_exec($curl);

if ($response === false) {
    echo '请求失败:' . curl_error($curl);
} else {
    $result = json_decode($response, true);

    if (($result['status_code'] ?? 0) === 20000) {
        print_r($result);
        // 在此处理职位职能列表
    } else {
        echo '错误码:' . ($result['status_code'] ?? '');
        echo ',错误信息:' . ($result['status_message'] ?? '');
    }
}

curl_close($curl);

TypeScript

typescript
import axios from "axios";

axios
  .get(
    "https://api.seermartech.cn/v3/keywords_data/bing/audience_estimation/job_functions",
    {
      headers: {
        Authorization: "Bearer smt_live_YOUR_KEY",
        "Content-Type": "application/json",
      },
    }
  )
  .then((response) => {
    const result = response.data;

    if (result.status_code === 20000) {
      console.log(result);
      // 在此处理职位职能列表
    } else {
      console.error(
        `错误码:${result.status_code},错误信息:${result.status_message}`
      );
    }
  })
  .catch((error) => {
    console.error("请求失败:", error.message);
  });

Python

python
import requests

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

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

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

if result.get("status_code") == 20000:
    print(result)
    # 在此处理职位职能列表
else:
    print(
        "错误码:%s,错误信息:%s"
        % (result.get("status_code"), result.get("status_message"))
    )

C#

csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

public static class AudienceEstimationDemo
{
    public static async Task GetJobFunctionsAsync()
    {
        using var httpClient = new HttpClient();

        httpClient.DefaultRequestHeaders.Authorization =
            new AuthenticationHeaderValue("Bearer", "smt_live_YOUR_KEY");

        var response = await httpClient.GetAsync(
            "https://api.seermartech.cn/v3/keywords_data/bing/audience_estimation/job_functions"
        );

        var content = await response.Content.ReadAsStringAsync();

        if (response.IsSuccessStatusCode)
        {
            Console.WriteLine(content);
            // 在此解析并处理职位职能列表
        }
        else
        {
            Console.WriteLine($"HTTP 请求失败:{response.StatusCode}");
            Console.WriteLine(content);
        }
    }
}

响应示例

json
{
  "version": "0.1.20240801",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.0648 sec.",
  "cost": 0,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "01234567-89ab-cdef-0123-456789abcdef",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.0123 sec.",
      "cost": 0,
      "result_count": 3,
      "path": [
        "v3",
        "keywords_data",
        "bing",
        "audience_estimation",
        "job_functions"
      ],
      "data": {
        "api": "keywords_data",
        "function": "job_functions",
        "se": "bing",
        "se_type": "audience_estimation"
      },
      "result": [
        {
          "job_function_id": 1,
          "job_function_name": "Accounting"
        },
        {
          "job_function_id": 2,
          "job_function_name": "Administrative"
        },
        {
          "job_function_id": 3,
          "job_function_name": "Arts and Design"
        }
      ]
    }
  ]
}

状态码说明

  • 顶层 status_code20000:请求成功。
  • 任务级 tasks[].status_code20000:该任务执行成功。
  • 状态码表示请求或任务处理异常,请结合 status_message 定位问题。

实用场景

  • 获取职位职能字:在广告受众定向后台展示可选职位职能,业务系统维护过时的静态枚举。
  • 映射职位职能 ID:将用户的职位类别转换为 Bing Ads Audience Estimation 所需的 job_function_id,提高受众估算请求的准确性。
  • 构建受众筛选器:基于返回的职位职能名称和 ID 创建职位维度筛选条件,支持更细粒度的潜客规模评估。
  • 同步广告:定期拉取最新职位职能列表并更新本地数据库,降低广告投放因字变更而失败的风险。

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