Skip to content

Google 自动补实时查询(高级版)

接口说明

该接口用于实时获取 Google 搜索自动补建议。你可以基于一个种子,获取:

  • Google 返回的自动补建议列表 -标在搜索框中的位置对建议结果的影响
  • 不同搜索客户端下的补结果差异

接口路径:

POST /v3/serp/google/autocomplete/live/advanced

请求地址:

https://api.seermartech.cn/v3/serp/google/autocomplete/live/advanced

计费说明

该接口按请求计费,每次请求都会扣费。

参考价约 ¥0.0320 / 次 扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

使用限制

  • 所有 POST 数据使用 JSON(UTF-8 编码)
  • 请求体为 JSON 数组格式:[{ ... }]
  • 实时 SERP 接口单次请求支持 1 个任务
  • 最高支持 2000 次 API 调用/分钟

请求参数

主要参数

字段名类型说明
keywordstring目标,最长 700 个字符。字段中的 %## 会被解码,字符 + 会被解码为空格。如果本身需要 %,请写为 %25;如果需要 +,请写为 %2B
location_codeinteger否*搜索地域代码。当未传 location_name 时填。例如:2840。可通过 /v3/serp/google/locations 查询可用地域。
language_codestring否*搜索语言代码。当未传 language_name 时填。例如:en。可通过 /v3/serp/google/languages 查询可用语言。
cursor_pointerinteger搜索框标的水平位置。调整标位置后,同一个可能返回不同的自动补建议。最小值为 0。默认值为最后一个字符的位置。

location_codelocation_name 二选一;language_codelanguage_name 二选一。

cursor_pointer 示例

搜索框cursor_pointer
|which query are s0
which query is s|16
which que|ry is s9

附加参数

字段名类型说明
location_namestring否*搜索地域完整名称。当未传 location_code 时填。例如:London,England,United Kingdom。可通过 /v3/serp/google/autocomplete/locations 查询。
language_namestring否*搜索语言完整名称。当未传 language_code 时填。例如:English。可通过 /v3/serp/google/languages 查询。
clientstring自动补所属的搜索客户端。不同客户端返回的建议可能不同。
tagstring自定义任务标识,最长 255 字符。可用于结果回传时进行任务匹,响应中的 data 对象会原样返回该值。

client 可选值

说明
chromeGoogle Chrome 中的搜索
chrome-omniChrome 地址栏中的搜索建议
gws-wizGoogle 首页搜索框
gws-wiz-serpGoogle 搜索结果页中的搜索框
safariSafari 浏览器中的搜索
firefoxFirefox 浏览器中的搜索
psy-ab某些 Chrome 场景下使用
toolbar返回 XML
youtube返回 JSONP
gws-wiz-localGoogle 本地搜索
imgGoogle 图片搜索
products-ccGoogle Shopping 搜索

请求示例

cURL

bash
curl --location --request POST "https://api.seermartech.cn/v3/serp/google/autocomplete/live/advanced" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
 {
 "language_code": "en",
 "location_code": 2840,
 "keyword": "albert einstein",
 "cursor_pointer": 6,
 "client": "gws-wiz-serp"
 }
]'

Python

python
import requests

url = "https://api.seermartech.cn/v3/serp/google/autocomplete/live/advanced"
headers = {
 "Authorization": "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json"
}
data = [
 {
 "language_code": "en",
 "location_code": 2840,
 "keyword": "albert einstein",
 "cursor_pointer": 6,
 "client": "gws-wiz-serp"
 }
]

response = requests.post(url, json=data, headers=headers)
print(response.json)

TypeScript

typescript
import axios from "axios";

async function main {
 const response = await axios.post(
 "https://api.seermartech.cn/v3/serp/google/autocomplete/live/advanced",
 [
 {
 language_code: "en",
 location_code: 2840,
 keyword: "albert einstein",
 cursor_pointer: 6,
 client: "gws-wiz-serp"
 }
 ],
 {
 headers: {
 Authorization: "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json"
 }
 }
 );

 console.log(response.data);
}

main.catch(console.error);

响应结构

接口返回 JSON 数据,顶层 tasks 数组。

顶层字段

字段名类型说明
versionstring当前 API 版本
status_codeinteger通用状态码
status_messagestring通用状态信息
timestring执行耗时,单位秒
costfloat总任务成本,单位 USD
tasks_countintegertasks 数组中的任务数量
tasks_errorinteger返回错误的任务数量
tasksarray任务结果数组

完整错误码和状态说明请参考 /v3/appendix/errors。建议在接时做好异常状态处理。

tasks[] 字段

字段名类型说明
idstring任务唯一标识,UUID 格式
status_codeinteger任务状态码,范围通常为 10000–60000
status_messagestring任务状态信息
timestring任务执行耗时
costfloat该任务成本,单位 USD
result_countintegerresult 数组数量
patharrayURL 路径
dataobject请求中提交的参数,会在此回传
resultarray结果数组

result[] 字段

字段名类型说明
keywordstring请求中的,返回时 %## 会被解码,+ 会被解码为空格
typestring搜索引擎类型
se_domainstring搜索引擎域名
location_codeinteger请求中的地域代码
language_codestring请求中的语言代码
check_urlstring可直接打开验证结果的搜索 URL
datetimestring结果抓取时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00
spellobject搜索引擎自动纠错信息;若无纠错则可能为 null
refinement_chipsobject搜索细化建议
item_typesarray结果中的类型
se_results_countintegerSERP 结果总数
items_countintegeritems 数组中的结果数量
itemsarray自动补建议明细

refinement_chips 结构

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

refinement_chips.items[]

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

refinement_chips.items[].options[]

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

items[] 字段说明

item_types 目前可能:

  • autocomplete

自动补结果对象

字段名类型说明
typestring固定为 autocomplete
rank_groupinteger同类型的分组排名
rank_absoluteinteger所有 SERP素中的绝对排名
relevanceinteger建议词与目标的性,范围 500–2000,值越高性越强。在 client=chromechrome-omni 时可用。
suggestionstring自动补建议词
suggestion_typestring建议词类型。在 client=chromechrome-omni 时可用。
search_query_urlstring对应建议词的搜索结果地址
thumbnail_urlstring建议词缩略图地址。在 client=gws-wizgws-wiz-serp 时可用。
highlightedarray搜索框中被高亮的片段。在 client=gws-wizpsy-abgws-wiz-local 时可用。

响应示例

json
{
 "version": "0.1.20240514",
 "status_code": 20000,
 "status_message": "Ok.",
 "time": "2.0961 sec.",
 "cost": 0.002,
 "tasks_count": 1,
 "tasks_error": 0,
 "tasks": [
 {
 "data": {
 "api": "serp",
 "function": "live",
 "se": "google",
 "se_type": "autocomplete",
 "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 表示整个请求的执行状态
  • tasks[].status_code 表示任务状态
  • 建议同时检查:
  • 顶层 status_code == 20000
  • tasks_error == 0
  • 每个任务的 status_code 是否成功
  • 详细错误码请参考 /v3/appendix/errors

实用场景

  • 挖掘长尾:基于核心词批量获取自动补建议,快速扩展选题和 SEO 词库。
  • 比较不同搜索场景的补差异:切换 client 参数,分析首页、结果页、地址栏等场景下的用户搜索意图差异。
  • 研究过程中的意图变化:通过调整 cursor_pointer,观察用户在不同位置可能触发的补建议,用于优化联想词策略。
  • 监控品牌与人物搜索联想:抓取品牌词、人名词的自动补结果,识别舆风险、热点话题和高频词。
  • 生成结构与 FAQ 主题:将自动补建议转化为文章标题、问答页和专题页规划,提高自然搜索覆盖率。

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