主题
按 ID 获取 Google Ads 搜索高级结果
本接口使用 GET 方法,通过以下路径获取指定任务的 Google Ads 搜索高级结果:
/v3/serp/google/ads_search/task_get/advanced/$id
接口信息
http
GET https://api.seermartech.cn/v3/serp/google/ads_search/task_get/advanced/$id认证
请求头中使用 Bearer Token:
http
Authorization: Bearer smt_live_YOUR_KEY路径参数
| 参数 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式。任务创建后 30 天可通过该 ID 随时获取结果。 |
计费说明
- 本接口用于获取已提交任务的结果,任务结果可在任务创建后的 30 天获取。
- 费用通常在提交任务时产生,扣费以响应头
X-SeerMarTech-Charge-CNY为准。 - 沙箱请求不产生费用。
- 建议在客户端实现错误状态和异常处理机制。
沙箱调试
可使用以下沙箱路径查看 Google Ads 搜索高级结果中可能返回的字段和:
text
https://api.seermartech.cn/v3/serp/google/ads_search/task_get/advanced/00000000-0000-0000-0000-000000000000沙箱返回的数据为演示数据,不代表真实搜索结果。
响应结构
接口返回 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 | 任务结果数组。 |
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 | 搜索结果数组。 |
data 字段
data含创建任务时提交的参数,示例字段如下:
| 字段 | 类型 | 说明 |
|---|---|---|
api | string | API 类型,例如 serp。 |
function | string | API 方法,例如 task_get。 |
se | string | 搜索引擎,例如 google。 |
se_type | string | 搜索结果类型,例如 ads_search。 |
location_code | integer | 地区代码。 |
platform | string | 搜索平台。 |
advertiser_ids | array | 广告主账号 ID 列表。 |
device | string | 设备类型,例如 desktop。 |
os | string | 操作系统,例如 windows。 |
result 字段
搜索结果字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 请求中的。返回时会对编码后的字符进行解码,+ 会被解码为空格。 |
type | string | 搜索结果类型,例如 ads_search。 |
se_domain | string | 搜索引擎域名。 |
location_code | integer | 地区代码。 |
language_code | string | 语言代码。 |
check_url | string | 搜索结果页直达 URL。此接口中通常为 null。 |
datetime | string | 获取结果的 UTC 日期时间,格式为 yyyy-mm-dd hh-mm-ss +00:00。示例:2019-11-15 12:57:46 +00:00。 |
spell | object | 搜索引擎自动纠错信息。如果被自动纠正,将返回纠正后的和纠错类型;无纠错时为 null。 |
refinement_chips | object | 搜索细化选项。 |
item_types | array | 当前搜索结果页中的结果类型,可能 ads_search。 |
se_results_count | integer | 搜索结果页中的结果总数。 |
items_count | integer | items 数组中返回的结果数量。 |
items | array | 搜索结果数组。 |
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 | 搜索结果中的域名。 |
options | array | 进一步的搜索细化选项。 |
refinement_chips.items.options 字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 refinement_chips_option。 |
title | string | 选项标题。 |
url | string | 带细化参数的搜索 URL。 |
domain | string | 搜索结果中的域名。 |
items 数组
ads_search 广告
当 items[].type 为 ads_search 时,字段说明如下:
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 素类型,固定为 ads_search。 |
rank_group | integer | 组排名。同一 type素会参与组排名,不同类型之间不计该字段。 |
rank_absolute | integer | 绝对排名,即该在整个搜索结果页中的位置。 |
advertiser_id | string | 广告主账号唯一标识。 |
creative_id | string | 广告创意唯一标识。 |
title | string | 广告标题,通常广告主名称。 |
url | string | 广告 URL,指向广告透明度平台中的广告页面。 |
verified | boolean | 广告主账号是否已验证。由广告平台验证通过时为 true。 |
format | string | 广告格式,可能为 text、image 或 video。 |
preview_image | array | 广告预览图信息。 |
preview_url | string | 指向广告预览页面的 URL。 |
first_shown | string | 广告首次展示时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。 |
last_shown | string | 广告最近一次展示时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00。 |
preview_image 字段
| 字段 | 类型 | 说明 |
|---|---|---|
url | string | 预览图 URL。 |
height | integer | 预览图高度。 |
width | integer | 预览图宽度。 |
请求示例
curl
bash
id="02261816-2027-0066-0000-c27d02864073"
curl --location --request GET \
"https://api.seermartech.cn/v3/serp/google/ads_search/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"
f"/v3/serp/google/ads_search/task_get/advanced/{task_id}"
)
response = requests.get(
url,
headers={
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
)
response.raise_for_status()
data = response.json()
if data.get("status_code") != 20000:
print(
f"请求失败,状态码:{data.get('status_code')},"
f"消息:{data.get('status_message')}"
)
else:
print(data)TypeScript
typescript
import axios from "axios";
const taskId = "02231256-2604-0066-2000-57133b8fc54e";
axios
.get(
`https://api.seermartech.cn/v3/serp/google/ads_search/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);
});响应示例
json
{
"version": "0.1.20241101",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0338 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "02261816-2027-0066-0000-c27d02864073",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0210 sec.",
"cost": 0,
"result_count": 1,
"path": [
"v3",
"serp",
"google",
"ads_search",
"task_get",
"advanced"
],
"data": {
"api": "serp",
"function": "task_get",
"se": "google",
"se_type": "ads_search",
"location_code": 2840,
"platform": "google_search",
"advertiser_ids": [],
"device": "desktop",
"os": "windows"
},
"result": [
{
"keyword": "example keyword",
"type": "ads_search",
"se_domain": "google.com",
"location_code": 2840,
"language_code": "en",
"check_url": null,
"datetime": "2019-11-15 12:57:46 +00:00",
"spell": null,
"refinement_chips": null,
"item_types": [
"ads_search"
],
"se_results_count": 0,
"items_count": 0,
"items": []
}
]
}
]
}状态码与错误处理
响应中的 status_code 和 tasks[].status_code 用于判断请求及任务执行状态:
20000:请求或任务执行成功。40000及以上:通常表示任务执行失败或返回错误。- 状态码:请结合
status_message判断原因。
建议同时检查以下字段:
- 顶层
status_code; tasks_error;tasks[].status_code;tasks[].result是否为空;status_message中的错误说明。
实用场景
- 回收广告主与广告创意信息:按任务 ID 获取 Google Ads 广告主、创意 ID 及广告格式,支持竞品广告库建设。
- 监控竞品广告展示周期:利用
first_shown和last_shown分析竞品广告的投放持续时间,判断市场投放策略。 - 分析广告覆盖:读取
items、rank_group和rank_absolute,评估目标的广告竞争强度。 - 识别已验证广告主:结合
advertiser_id与verified字段筛选可信广告主,支持广告主画像和行业研究。 - 跟踪搜索结果细化需求:分析
refinement_chips及选项,挖掘用户搜索意图并优化分组。