主题
Google Ads 广告主高级实时接口
GET /v3/serp/google/ads_advertisers/locations
本接口用于基于 Google Ads 广告透明度平台,查询指定和地理位置下的广告主及广告投放信息,并返回对应的搜索结果页面数据。
请求方式与路径:
http
POST https://api.seermartech.cn/v3/serp/google/ads_advertisers/live/advanced本接口支持两种任务优级:
1:普通优级,默认值2:高优级,执行速度更快,但会产生额外费用
每次调用只能提交一个任务。所有请求体使用 UTF-8 编码的 JSON 数组格式,单个任务请求示例为:
json
[
{
"keyword": "apple",
"location_code": 2840,
"priority": 1,
"tag": "example-task"
}
]平台限流以认证说明中的 30/60/120 次/分钟规则为准。
计费说明
提交任务时计费。示例任务成本约为 ¥0.0144 / 次,价格可能因任务优级及平台计费策略变化。
扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
请求参数
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
keyword | string | 是 | 查询,最多 700 个字符。请求中的百分号编码会被解码,字符 + 会被解码为空格。<br><br>如果中需要使用 %,请编码为 %25;如果需要使用 +,请编码为 %2B。 |
location_name | string | 否 | 搜索引擎位置的完整名称。使用该参数后,无需同时指定 location_code 或 location_coordinate。<br><br>可通过 /v3/serp/google/ads_advertisers/locations 获取可用位置名称。<br><br>示例:London,England,United Kingdom |
location_code | integer | 否 | 搜索引擎位置代码。使用该参数后,无需同时指定 location_name 或 location_coordinate。<br><br>可通过 /v3/serp/google/ads_advertisers/locations 获取可用位置代码。<br><br>示例:2840 |
location_coordinate | string | 否 | 地理位置的 GPS 坐标,格式为 纬度,经度。使用该参数后,无需同时指定 location_name 或 location_code。<br><br>示例:52.6178549,-155.352142 |
priority | integer | 否 | 任务优级:<br>1:普通优级,默认值;<br>2:高优级,执行速度更快并产生额外费用。 |
tag | string | 否 | 用户自定义任务标识,最长 255 个字符。可用于任务和结果,提交的值会原样返回在响应的 data 对象中。 |
如果未指定 location_name、location_code 或 location_coordinate,平台会在所有可用位置范围搜索广告主。
请求示例
curl
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/serp/google/ads_advertisers/live/advanced" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"keyword": "apple",
"location_code": 2840,
"priority": 1,
"tag": "apple-search"
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/serp/google/ads_advertisers/live/advanced"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
# 每次请求只能提交一个任务,但请求体仍需使用 JSON 数组
payload = [
{
"keyword": "apple",
"location_code": 2840,
"priority": 1,
"tag": "apple-search",
}
]
response = requests.post(url, headers=headers, json=payload)
result = response.json()
if result.get("status_code") == 20000:
print(result)
else:
print(
"请求失败,错误码:%s,错误信息:%s"
% (result.get("status_code"), result.get("status_message"))
)TypeScript
typescript
import axios from "axios";
const response = await axios.post(
"https://api.seermartech.cn/v3/serp/google/ads_advertisers/live/advanced",
[
{
keyword: "apple",
location_code: 2840,
priority: 1,
tag: "apple-search",
},
],
{
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
}
);
const result = response.data;
if (result.status_code === 20000) {
console.log(result);
} else {
console.error(
`请求失败,错误码:${result.status_code},错误信息:${result.status_message}`
);
}响应结构
接口返回 JSON 对象 tasks 数组。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本。 |
status_code | integer | 通用响应状态码。20000 表示请求成功。完整错误码请参考错误码文档。 |
status_message | string | 通用状态说明。 |
time | string | 请求执行耗时,单位为秒。 |
cost | float | 平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。 |
tasks_count | integer | tasks 数组中的任务总数。 |
tasks_error | integer | tasks 数组中返回错误的任务数。 |
tasks | array | 任务结果数组。 |
任务字段
| 字段 | 类型 | 说明 |
|---|---|---|
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 | 搜索结果数组。 |
结果字段
通用结果字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 请求中的。返回时会对编码进行解码,字符 + 会还原为空格。 |
type | string | 搜索引擎结果类型。 |
se_domain | string | 搜索引擎域名。 |
location_code | integer | 搜索位置代码。 |
language_code | string | 搜索语言代码。 |
check_url | string | 搜索结果页面的直接 URL,可用于核验结果准确性。 |
datetime | string | 获取结果的日期和时间,使用 UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。<br><br>示例:2019-11-15 12:57:46 +00:00 |
spell | object | 搜索引擎自动纠错信息。如果搜索引擎对进行了纠正,则返回纠正后的及纠错类型;否则为 null。 |
refinement_chips | object | 搜索细化选项。 |
item_types | array | SERP 中的结果类型。可能:ads_muti_account_advertiser、ads_advertiser、ads_domain。 |
se_results_count | integer | SERP 中的结果总数。 |
items_count | integer | items 数组中返回的结果数量。 |
items | array | SERP 中发现的结果。 |
refinement_chips 字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 refinement_chips。 |
xpath | string | 素对应的 XPath。 |
items | array | 搜索细化项列表。 |
refinement_chips.items 中的字段:
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 refinement_chips_element。 |
title | string | 细化项标题。 |
url | string | 带细化参数的搜索 URL。 |
domain | string | SERP 中的域名。 |
options | array | 进一步的搜索细化选项。 |
options 中的字段:
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 refinement_chips_option。 |
title | string | 选项标题。 |
url | string | 带细化参数的搜索 URL。 |
domain | string | SERP 中的域名。 |
SERP 结果
ads_multi_account_advertiser
表示 Google Ads 中相似标题的多个广告账户。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 ads_multi_account_advertiser。 |
rank_group | integer | 分组排名。同一 type素中的相对位置;不同类型之间不计该排名。 |
rank_absolute | integer | SERP 中的绝对排名,即所有结果中的位置。 |
title | string | 广告主名称。 |
location | string | 广告主所在位置。 |
approx_ads_count | integer | 估算广告数量,表示该广告主在所有可用 Google Ads 平台上投放的广告数量。 |
advertisers | array | 的广告账户列表。 |
advertisers 数组中的账户字段:
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,可能为 advertiser。 |
advertiser_id | string | 广告账户唯一标识。可用于进一步查询广告系列数据。 |
location | string | 广告账户所在国家或地区代码。 |
verified | boolean | 是否为已验证广告账户。true 表示已通过 Google Ads 验证。 |
approx_ads_count | integer | 该广告账户投放广告的估算数量。 |
ads_advertiser
表示单个 Google Ads 广告账户。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 ads_advertiser。 |
rank_group | integer | 分组排名。同一 type素中的相对位置。 |
rank_absolute | integer | SERP 中的绝对排名。 |
title | string | 广告主名称。 |
advertiser_id | string | 广告账户唯一标识。 |
location | string | 广告主所在位置。 |
verified | boolean | 是否为已验证广告账户。 |
approx_ads_count | integer | 该广告账户投放广告的估算数量。 |
ads_domain
表示通过域名识别的 Google Ads 广告主。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 ads_domain。 |
rank_group | integer | 分组排名。同一 type素中的相对位置。 |
rank_absolute | integer | SERP 中的绝对排名。 |
domain | string | 广告主域名。示例:apple.com。 |
响应示例
json
{
"version": "0.1.20241203",
"status_code": 20000,
"status_message": "Ok.",
"time": "2.0907 sec.",
"cost": 0.002,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "01234567-89ab-cdef-0123-456789abcdef",
"status_code": 20000,
"status_message": "Ok.",
"time": "1.9500 sec.",
"cost": 0.002,
"result_count": 1,
"path": [
"v3",
"serp",
"google",
"ads_advertisers",
"live",
"advanced"
],
"data": {
"api": "serp",
"function": "live",
"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,
"refinement_chips": null,
"item_types": [
"ads_multi_account_advertiser",
"ads_advertiser",
"ads_domain"
],
"se_results_count": 0,
"items_count": 16,
"items": [
{
"type": "ads_multi_account_advertiser",
"rank_group": 2,
"rank_absolute": 2,
"title": "Apple",
"location": "US",
"approx_ads_count": 602,
"advertisers": [
{
"type": "advertiser",
"advertiser_id": "AR08619798719379800065",
"location": "US",
"verified": true,
"approx_ads_count": 63
}
]
},
{
"type": "ads_advertiser",
"rank_group": 1,
"rank_absolute": 3,
"title": "Apple Inc",
"advertiser_id": "AR08619798719379800065",
"location": "US",
"verified": true,
"approx_ads_count": 63
},
{
"type": "ads_advertiser",
"rank_group": 2,
"rank_absolute": 4,
"title": "AppleAire",
"advertiser_id": "AR17003630320609656833",
"location": "US",
"verified": true,
"approx_ads_count": 59
},
{
"type": "ads_domain",
"rank_group": 1,
"rank_absolute": 7,
"domain": "apple.com"
},
{
"type": "ads_domain",
"rank_group": 2,
"rank_absolute": 8,
"domain": "applern.com"
}
]
}
]
}
]
}> 注意:响应中的 cost 字段(平台原始 USD 成本兼容字段)用于表示任务计费信息;人民币扣费以响应头 X-SeerMarTech-Charge-CNY 为准。建议在业务系统中根据 status_code 和 status_message 完善异常及错误处理。
错误处理
平台会在顶层响应和任务对象中分别返回状态码及状态信息:
- 顶层
status_code:表示整个请求的处理状态。 - 任务级
status_code:表示单个任务的处理状态。 status_message:提供对应的状态说明。tasks_error:表示返回错误的任务数量。
成功状态码为 20000。完整错误码及状态说明请参考错误码文档。
实用场景
- 识别对应的广告主,分析目标市场中的主要付费搜索竞争,为竞品研究和投放策略制定提供依据。
- 统计广告主的估算广告数量,评估竞争品牌的投放活跃度和市场强度。
- 广告账户与广告主位置,按国家或地区拆分广告竞争格局,支持本地化 SEO 和区域投放分析。
- 提取 SERP 中出现的广告主域名,构建竞争域名单,用于竞品监测、差距分析和外链研究。
- 利用广告账户唯一标识进行后续查询,追踪特定广告主的广告系列变化,支持长期竞品报分析。