主题
按任务 ID 获取 Google Ads 广告主高级结果
本接口使用 GET 方法,通过以下路径获取指定任务的 Google Ads 广告主高级结果:
GET https://api.seermartech.cn/v3/serp/google/ads_advertisers/task_get/advanced/$id
,$id 为创建任务时返回的任务 ID。
计费说明
- 本接口在提交任务时计费。
- 任务提交成功后,可在 30 天获取任务结果。
- 实扣费以响应头
X-SeerMarTech-Charge-CNY为准。 - 可使用沙箱任务 ID 调试接口,沙箱请求不计费:
https://api.seermartech.cn/v3/serp/google/ads_advertisers/task_get/advanced/00000000-0000-0000-0000-000000000000
请求参数
路径参数
| 参数 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式。任务创建后可在 30 天使用该 ID 获取结果。 |
响应说明
接口返回 JSON 数据 tasks 数组。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 接口整体状态码。 |
status_message | string | 接口整体状态信息。 |
time | string | 接口执行耗时,单位为秒。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
tasks_count | integer | tasks 数组中的任务数量。 |
tasks_error | integer | tasks 数组中返回错误的任务数量。 |
tasks | array | 任务结果数组。 |
tasks 数组
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式。 |
status_code | integer | 任务状态码,通常在 10000 至 60000 范围。 |
status_message | string | 任务状态信息。 |
time | string | 任务执行耗时,单位为秒。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
result_count | integer | result 数组中的数量。 |
path | array | 请求 URL 路径。 |
data | object | 创建任务时提交的参数。 |
result | array | SERP 结果数组。 |
data 对象字段
data 对象创建任务时提交的参数,例如:
| 字段 | 类型 | 说明 |
|---|---|---|
api | string | API 类型,例如 serp。 |
function | string | API 功能,例如 task_get。 |
se | string | 搜索引擎,例如 google。 |
se_type | string | 搜索结果类型,例如 ads_advertisers。 |
location_code | integer | 地区代码。 |
keyword | string | 查询。 |
device | string | 设备类型,例如 desktop。 |
os | string | 操作系统,例如 windows。 |
result 结果字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | POST 请求中提交的。返回时会对编码进行解码,+ 会被解码为空格。 |
type | string | POST 请求中提交的搜索结果类型。 |
se_domain | string | POST 请求中提交的搜索引擎域名。 |
location_code | integer | POST 请求中提交的地区代码。 |
language_code | string | POST 请求中提交的语言代码。 |
check_url | string | 搜索引擎结果页的直接 URL,可用于核验返回结果。 |
datetime | string | 获取结果的时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。 |
spell | object/null | 搜索引擎自动纠错信息。如果未被纠正,通常为 null。 |
refinement_chips | object | 搜索细化选项。 |
se_results_count | integer | SERP 中的结果总数。 |
items_count | integer | items 数组中的结果数量。 |
items | array | SERP 中识别到的结果。 |
refinement_chips
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 refinement_chips。 |
xpath | string | 素的 XPath。 |
items | array | 搜索细化项列表。 |
items[].type | string | 素类型,固定为 refinement_chips_element。 |
items[].title | string | 细化项标题。 |
items[].url | string | 携带细化参数的搜索 URL。 |
items[].domain | string | SERP 中的域名。 |
options | array | 进一步的搜索细化选项。 |
options[].type | string | 素类型,固定为 refinement_chips_option。 |
options[].title | string | 选项标题。 |
options[].url | string | 携带细化参数的搜索 URL。 |
options[].domain | string | SERP 中的域名。 |
item_types
item_types 为 SERP 中结果的类型列表,可能:
ads_multi_account_advertiserads_advertiserads_domain
广告主结果
ads_multi_account_advertiser
表示 Google Ads 中相似标题的多个广告账户的聚合结果。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 ads_multi_account_advertiser。 |
rank_group | integer | 同类型中的分组排名。不同类型不会参与该字段的排名。 |
rank_absolute | integer | 在所有 SERP素中的绝对排名。 |
title | string | 广告主名称。 |
location | string | 广告主所在地。 |
approx_ads_count | integer | 该广告主在可用 Google Ads 平台中投放的广告数量估算值。 |
advertisers | array | 的广告账户列表。 |
advertisers 子
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,通常为 advertiser。 |
advertiser_id | string | 广告账户唯一标识。可用于 Google Ads 广告数据接口。 |
location | string | 广告账户的国家或地区代码。 |
verified | boolean | 广告账户是否已由 Google Ads 验证。 |
approx_ads_count | integer | 该广告账户投放的广告数量估算值。 |
ads_advertiser
表示单个 Google Ads 广告账户。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 ads_advertiser。 |
rank_group | integer | 同类型中的分组排名。 |
rank_absolute | integer | 在所有 SERP素中的绝对排名。 |
title | string | 广告主名称。 |
location | string | 广告主所在地。 |
advertiser_id | string | 广告账户唯一标识。 |
verified | boolean | 广告账户是否已由 Google Ads 验证。 |
approx_ads_count | integer | 该广告账户投放的广告数量估算值。 |
ads_domain
表示通过域名识别的 Google Ads 广告主。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 ads_domain。 |
rank_group | integer | 同类型中的分组排名。 |
rank_absolute | integer | 在所有 SERP素中的绝对排名。 |
domain | string | 广告主域名,例如 example.com。 |
请求示例
cURL
bash
id="02261816-2027-0066-0000-c27d02864073"
curl --location --request GET \
"https://api.seermartech.cn/v3/serp/google/ads_advertisers/task_get/advanced/${id}" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
task_id = "02231256-2604-0066-2000-57133b8fc54e"
url = (
"https://api.seermartech.cn/v3/serp/google/ads_advertisers/"
f"task_get/advanced/{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},{response.text}")TypeScript
typescript
import axios from "axios";
const taskId = "02231256-2604-0066-2000-57133b8fc54e";
axios
.get(
`https://api.seermartech.cn/v3/serp/google/ads_advertisers/task_get/advanced/${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);
});PHP
php
<?php
$task_id = '02261816-2027-0066-0000-c27d02864073';
$url = 'https://api.seermartech.cn/v3/serp/google/ads_advertisers/task_get/advanced/' . $task_id;
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer smt_live_YOUR_KEY',
'Content-Type: application/json',
],
]);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($http_code >= 200 && $http_code < 300) {
print_r(json_decode($response, true));
} else {
echo "请求失败:HTTP {$http_code}\n";
echo $response;
}响应示例
json
{
"version": "0.1.20241101",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0751 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "02261816-2027-0066-0000-c27d02864073",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0751 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"serp",
"google",
"ads_advertisers",
"task_get",
"advanced"
],
"data": {
"api": "serp",
"function": "task_get",
"se": "google",
"se_type": "ads_advertisers",
"location_code": 2840,
"keyword": "apple",
"device": "desktop",
"os": "windows"
},
"result": [
{
"keyword": "apple",
"type": "ads_advertisers",
"se_domain": "google.com",
"location_code": 2840,
"language_code": "en",
"check_url": "https://www.google.com/search?q=apple",
"datetime": "2019-11-15 12:57:46 +00:00",
"spell": null,
"se_results_count": 0,
"items_count": 17,
"items": [
{
"type": "ads_multi_account_advertiser",
"rank_group": 2,
"rank_absolute": 2,
"title": "Apple",
"location": "US",
"approx_ads_count": 702,
"advertisers": [
{
"type": "advertiser",
"advertiser_id": "AR17003630320609656833",
"location": "US",
"verified": true,
"approx_ads_count": 66
}
]
},
{
"type": "ads_advertiser",
"rank_group": 1,
"rank_absolute": 3,
"title": "AppleAire:US",
"advertiser_id": "AR17003630320609656833",
"location": "US",
"verified": true,
"approx_ads_count": 66
},
{
"type": "ads_domain",
"rank_group": 1,
"rank_absolute": 8,
"domain": "example.com"
}
]
}
]
}
]
}状态码与异常处理
请根据 status_code 和 status_message 判断请求及任务是否成功:
20000:请求成功。40000及以上:任务或接口处理失败,应结合status_message记录错误原因。- 当
result为空或tasks_error大于0时,应将任务标记为异常并进行重试或人工排查。
建议客户端同时处理 HTTP 错误、接口状态码错误、任务级错误以及结果为空等。
实用场景
- 识别对应的广告主账户,分析竞品或行业参与,支持广告竞争格局研究。
- 统计广告主的广告投放规模,利用
approx_ads_count评估竞争强度和市场活跃度。 - 多个广告账户与统一品牌名称,通过
ads_multi_account_advertiser聚合同名或账户,完善竞品画像。 - 提取 SERP 中出现的广告主域名,发现潜在竞品网站、联盟站点或新市场的广告投放方。
- 结合排名与验证状态筛选广告账户,优分析已验证且排名靠前的广告主,提升投放监测和 SEO 竞品分析效率。