Skip to content

获取 Google Autocomplete 高级结果(按任务 ID)

通过本接口可根据任务 id 获取 Google Autocomplete 的高级结果。

接口说明

  • 请求方式GET
  • 请求地址https://api.seermartech.cn/v3/serp/google/autocomplete/task_get/advanced/$id

计费说明

本接口本身不单独收费,在创建任务时计费。任务提交成功后,可在 30 天 多次获取结果。

扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

路径参数

字段类型说明
idstring任务唯一标识,UUID 格式。该 ID 可在任务创建后的 30 天 用于随时获取结果。

返回结果说明

接口返回 JSON 数据,顶层 tasks 数组,每个任务项中对应获取结果。

顶层字段

字段类型说明
versionstring当前 API 版本
status_codeinteger通用状态码,完整错误码请参考错误码文档
status_messagestring通用状态信息
timestring执行耗时,单位秒
costfloat本次请求总成本,单位 USD
tasks_countintegertasks 数组中的任务数
tasks_errorintegertasks 数组中返回错误的任务数
tasksarray任务结果数组

tasks[] 字段

字段类型说明
idstring任务唯一标识,UUID 格式
status_codeinteger任务状态码,范围通常为 10000-60000
status_messagestring任务状态信息
timestring任务执行耗时,单位秒
costfloat任务成本,单位 USD
result_countintegerresult 数组中的结果数
patharrayURL 路径
dataobject与创建任务时 POST 请求中传的参数一致
resultarray获取结果数组

result[] 字段

字段类型说明
keywordstring创建任务时的。返回时会对 %## 进行解码,+ 会被解码为空格
typestringPOST 请求中的搜索引擎类型
se_domainstringPOST 请求中的搜索引擎域名
location_codeintegerPOST 请求中的地区代码
language_codestringPOST 请求中的语言代码
check_urlstring搜索引擎结果直达链接,可用于人工核验结果准确性
datetimestring结果抓取时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00
spellobject搜索引擎自动纠错信息;如果搜索词被纠正,这里会返回纠正后的及纠错类型,否则为 null
refinement_chipsobject搜索细化标签信息
item_typesarray当前 SERP 中出现的结果类型列表。该端点可能返回:autocomplete
se_results_countintegerSERP 结果总数
items_countintegeritems 数组中的数量
itemsarrayAutocomplete 结果明细

refinement_chips 字段

字段类型说明
typestring素类型,固定为 refinement_chips
xpathstring素的 XPath
itemsarray细化标签列表

refinement_chips.items[] 字段

字段类型说明
typestring素类型,固定为 refinement_chips_element
titlestring标签标题
urlstring带细化参数的搜索链接
domainstringSERP 中的域名
optionsarray进一步细化选项

refinement_chips.items[].options[] 字段

字段类型说明
typestring素类型,固定为 refinement_chips_option
titlestring选项标题
urlstring带细化参数的搜索链接
domainstringSERP 中的域名

items[] 字段

字段类型说明
typestring素类型,固定为 autocomplete
rank_groupinteger同类型的分组排名
rank_absoluteinteger该在整个 SERP 中的绝对排名
relevanceinteger建议词与目标的度,取值范围 5002000,值越大表示度越高。clientchrome/chrome-omni 时返回
suggestionstringGoogle Autocomplete 建议词
suggestion_typestring建议词类型。clientchrome/chrome-omni 时返回
search_query_urlstring对应建议词的搜索结果页链接
thumbnail_urlstring缩略图链接。clientgws-wizgws-wiz-serp 时返回
highlightedarray搜索框中被高亮的建议词片段。clientgws-wizpsy-abgws-wiz-local 时返回

沙箱调试

可使用沙箱地址查看该端点可能返回的字段结构,字段值为模拟数据,不会产生费用。

https://sandbox.seermartech.cn/v3/serp/google/autocomplete/task_get/advanced/00000000-0000-0000-0000-000000000000

请求示例

curl

bash
id="02261816-2027-0066-0000-c27d02864073"

curl --location --request GET "https://api.seermartech.cn/v3/serp/google/autocomplete/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 = f"https://api.seermartech.cn/v3/serp/google/autocomplete/task_get/advanced/{task_id}"
headers = {
 "Authorization": "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json"
}

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

print(data)

TypeScript

typescript
import axios from "axios";

const taskId = "02231256-2604-0066-2000-57133b8fc54e";

axios({
 method: "get",
 url: `https://api.seermartech.cn/v3/serp/google/autocomplete/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);
});

结合 tasks_ready 批量获取结果

使用中,通常请求已完成任务列表,再按任务 ID 拉取高级结果。

Python

python
import requests

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

# 1. 获取已完成任务列表
ready_url = "https://api.seermartech.cn/v3/serp/google/autocomplete/tasks_ready"
ready_resp = requests.get(ready_url, headers=headers)
ready_data = ready_resp.json

results = []

if ready_data.get("status_code") == 20000:
 for task_group in ready_data.get("tasks", []):
 for task_info in task_group.get("result", []) or []:
 endpoint = task_info.get("endpoint_advanced")
 task_id = task_info.get("id")

 # 2. 直接使用返回的高级结果地址
 if endpoint:
 r = requests.get(f"https://api.seermartech.cn{endpoint}", headers=headers)
 results.append(r.json)

 # 3. 或使用任务 ID 重新拼接查询地址
 # if task_id:
 # r = requests.get(
 # f"https://api.seermartech.cn/v3/serp/google/autocomplete/task_get/advanced/{task_id}",
 # headers=headers
 # )
 # results.append(r.json)

print(results)

响应示例

json
{
 "version": "0.1.20240514",
 "status_code": 20000,
 "status_message": "Ok.",
 "time": "0.0724 sec.",
 "cost": 0,
 "tasks_count": 1,
 "tasks_error": 0,
 "tasks": [
 {
 "data": {
 "se_type": "autocomplete",
 "se": "google",
 "api": "serp",
 "function": "task_get",
 "language_code": "en",
 "location_code": 2840,
 "keyword": "albert einstein",
 "client": "gws-wiz-serp",
 "device": "desktop",
 "os": "windows"
 },
 "result": [
 {
 "se_results_count": 0,
 "items_count": 10,
 "items": [
 {
 "type": "autocomplete",
 "rank_group": 4,
 "rank_absolute": 4,
 "relevance": null,
 "suggestion": "albert einstein death",
 "suggestion_type": null,
 "search_query_url": "https://www.google.com/search?q=albert+einstein+death",
 "thumbnail_url": null,
 "highlighted": null
 },
 {
 "type": "autocomplete",
 "rank_group": 5,
 "rank_absolute": 5,
 "relevance": null,
 "suggestion": "albert einstein quotes",
 "suggestion_type": null,
 "search_query_url": "https://www.google.com/search?q=albert+einstein+quotes",
 "thumbnail_url": "http://t0.gstatic.com/images?q=tbn:ANd9GcRnmMaYbKfIi4s248o1yaRqUZUCsaoJxjiS4BA_s2d8h-WKhBkVbPU98CW-Xw&s=10",
 "highlighted": null
 },
 {
 "type": "autocomplete",
 "rank_group": 6,
 "rank_absolute": 6,
 "relevance": null,
 "suggestion": "albert einstein news",
 "suggestion_type": null,
 "search_query_url": "https://www.google.com/search?q=albert+einstein+news",
 "thumbnail_url": null,
 "highlighted": null
 },
 {
 "type": "autocomplete",
 "rank_group": 7,
 "rank_absolute": 7,
 "relevance": null,
 "suggestion": "albert einstein wife",
 "suggestion_type": null,
 "search_query_url": "https://www.google.com/search?q=albert+einstein+wife",
 "thumbnail_url": null,
 "highlighted": null
 },
 {
 "type": "autocomplete",
 "rank_group": 8,
 "rank_absolute": 8,
 "relevance": null,
 "suggestion": "albert einstein brain",
 "suggestion_type": null,
 "search_query_url": "https://www.google.com/search?q=albert+einstein+brain",
 "thumbnail_url": null,
 "highlighted": null
 },
 {
 "type": "autocomplete",
 "rank_group": 9,
 "rank_absolute": 9,
 "relevance": null,
 "suggestion": "albert einstein inventions",
 "suggestion_type": null,
 "search_query_url": "https://www.google.com/search?q=albert+einstein+inventions",
 "thumbnail_url": null,
 "highlighted": null
 },
 {
 "type": "autocomplete",
 "rank_group": 10,
 "rank_absolute": 10,
 "relevance": null,
 "suggestion": "albert einstein hospital",
 "suggestion_type": null,
 "search_query_url": "https://www.google.com/search?q=albert+einstein+hospital",
 "thumbnail_url": null,
 "highlighted": null
 }
 ]
 }
 ]
 }
 ]
}

状态码与异常处理

  • status_code 表示接口或任务执行状态。
  • 建议同时检查顶层 status_codetasks[].status_code
  • tasks[].status_code >= 40000,通常表示任务级错误,应结合 status_message 做异常处理。
  • 建议为任务结果轮询、空结果、字段缺失、任务过期等设计完整容错机制。

使用说明

  • 该接口适用于查询已经提交且已完成的 Autocomplete 任务结果。
  • 如任务尚未完成,建议调用 /v3/serp/google/autocomplete/tasks_ready 获取可读取的任务列表。
  • 结果保留期为 30 天,期限后可能无法再次获取。
  • 某些字段在特定 client 下返回,接时应按返回值做容处理。

实用场景

  • 挖掘长尾词:获取目标的自动补建议,扩选题库与 SEO 词库覆盖面。
  • 识别搜索意图分支:根据 suggestionhighlightedrefinement_chips 分析用户常见搜索延伸方向,分层与专题页规划。
  • 监控热点联想变化:定期按拉取 Autocomplete 结果,观察建议词变动,及时发现新趋势与突发热点。
  • 优化广告与落地页词:将高建议词补到投放词、标题和落地页文案中,提高流量匹度。
  • 验证多地区多语言差异:结合 location_codelanguage_code 对比不同市场下的联想词差异,支持化 SEO 与本地化策略。

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