主题
Google Local Finder 实时高级结果接口
POST /v3/serp/google/local_finder/live/advanced
本接口使用 POST /v3/serp/wp/v2/live/advanced,实时获取指定、语言和地理位置下的本地搜索结果。默认返回桌面端最多 20 条结果、移动端最多 10 条结果。平台限流以认证说明中的 30/60/120 次/分钟规则为准。
请求地址
http
POST https://api.seermartech.cn/v3/serp/wp/v2/live/advanced
Authorization: Bearer smt_live_YOUR_KEY
Content-Type: application/json所有请求体使用 UTF-8 编码的 JSON 格式,并以数组形式提交:
json
[
{
"language_code": "en",
"location_code": 2840,
"keyword": "local nail services",
"min_rating": 4.5,
"time_filter": "monday"
}
]计费说明
接口按请求和任务计费。
- 默认按桌面端每 20 条结果或移动端每 10 条结果计费。
- 当
depth过默认值,且搜索引擎返回了更多结果时,可能产生额外费用。 - 如果指定的
depth高于返回结果数,未使用部分会自动退还到账户余额。 - 使用高优级
priority=2会产生额外费用。 - 参考价约 ¥0.0144 / 次(示例中的单任务基础费用)。
- 实扣费以响应头
X-SeerMarTech-Charge-CNY为准。
请求参数
###填及主要参数
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
keyword | string | 是 | 搜索,最多 700 个字符。请求中的 %## 会被解码,字符 + 会被解码为空格。若中需要使用 %,请传 %25;需要使用 +,请传 %2B。 |
location_code | integer | 条件填 | 搜索位置代码。当未指定 location_name 或 location_coordinate 时填。使用该参数时,不要同时传另外两个位置参数。可通过 GET /v3/serp/wp/locations 获取可用位置代码。例如:2840。 |
language_code | string | 条件填 | 搜索语言代码。当未指定 language_name 时填。使用该参数时,不要同时传 language_name。可通过 GET /v3/serp/wp/languages 获取可用语言代码。例如:en。 |
depth | integer | 否 | 解析深度,即希望获取的结果数量。桌面端默认值为 20,最大值为 100;移动端默认值为 10,最大值为 100。 |
device | string | 否 | 设备类型,可选值:desktop、mobile。默认值为 desktop。 |
附加参数
| 参数 | 类型 | 填 | 说明 |
|---|---|---|---|
location_name | string | 条件填 | 搜索位置的完整名称。当未指定 location_code 或 location_coordinate 时填。使用该参数时,不要同时传另外两个位置参数。例如:London,England,United Kingdom。 |
language_name | string | 条件填 | 搜索语言的完整名称。当未指定 language_code 时填。例如:English。 |
os | string | 否 | 设备操作系统。device=desktop 时可选 windows、macos,默认值为 windows;device=mobile 时可选 android、ios,默认值为 android。 |
tag | string | 否 | 自定义任务标识,最多 255 个字符。可用于请求与结果,响应中的 data 对象会返回该值。 |
priority | integer | 否 | 任务优级:1 为普通优级,默认值;2 为高优级。高优级任务会产生额外费用。 |
location_coordinate | string | 条件填 | 地理坐标,格式为 纬度,经度,缩放级别,例如 52.6178549,-155.352142,20z。未指定缩放级别时默认使用 9z。纬度和经度最多保留 7 位小数,缩放级别范围为 4z 至 18z。使用该参数时,不要同时传 location_name 或 location_code。 |
min_rating | number | 否 | 最低评分过滤条件。桌面端可选:3.5、4、4.5;移动端可选:2、2.5、3、3.5、4、4.5。 |
time_filter | string | 否 | 按营业时间过滤结果。搜索引擎可能仍返回不符合过滤条件的结果。可选值:open_now、24_hours、$day_value、$day_value;$time_value。星期值可使用 monday 至 sunday;小时值可使用 00 至 23。例如:tuesday;18。 |
请求示例
curl
bash
curl --location --request POST \
"https://api.seermartech.cn/v3/serp/wp/v2/live/advanced" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
{
"language_code": "en",
"location_code": 2840,
"keyword": "local nail services",
"min_rating": 4.5,
"time_filter": "monday"
}
]'Python
python
import requests
url = "https://api.seermartech.cn/v3/serp/wp/v2/live/advanced"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
}
payload = [
{
"language_code": "en",
"location_code": 2840,
"keyword": "local nail services",
"min_rating": 4.5,
"time_filter": "monday",
}
]
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/wp/v2/live/advanced",
[
{
language_code: "en",
location_code: 2840,
keyword: "local nail services",
min_rating: 4.5,
time_filter: "monday",
},
],
{
headers: {
Authorization: "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json",
},
}
);
if (response.data.status_code === 20000) {
console.log(response.data);
} else {
console.error(
`请求失败,错误码:${response.data.status_code},错误信息:${response.data.status_message}`
);
}响应结构
接口返回 JSON 数据,顶层 tasks 数组。每个任务对应一次提交的查询。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前接口版本。 |
status_code | integer | 请求整体状态码。完整错误码请参考 /v3/appendix/errors。 |
status_message | string | 请求整体状态信息。 |
time | string | 请求执行耗时,例如 4.0522 sec.。 |
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 | 请求路径信息。 |
data | object | 请求中提交的参数。 |
result | array | 搜索结果数组。 |
result 字段
| 字段 | 类型 | 说明 |
|---|---|---|
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。 |
spell | object | 搜索引擎自动纠错信息。 |
refinement_chips | object | 搜索细化选项。 |
item_types | array | 返回的结果类型。目前可能 local_pack。 |
se_results_count | integer | 搜索结果总数。 |
items_count | integer | items 数组中返回的结果数。 |
items | array | 搜索结果数组。 |
spell 自动纠错字段
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 搜索引擎纠正后的,结果对应纠正后的。 |
type | string | 纠错类型,可选值:did_you_mean、showing_results_for、no_results_found_for、including_results_for。 |
refinement_chips 字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 refinement_chips。 |
xpath | string | 素在页面中的 XPath。 |
items | array | 搜索细化项。 |
options | array | 搜索细化选项。 |
items 和 options 中的以下字段:
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | items 中固定为 refinement_chips_element;options 中固定为 refinement_chips_option。 |
title | string | 细化项标题。 |
url | string | 携带细化参数的搜索 URL。 |
domain | string | 结果所在域名。 |
local_pack 本地商户结果字段
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 local_pack。 |
rank_group | integer | 同类型结果组的排名。不同类型之间不会计该排名。 |
rank_absolute | integer | 在整个搜索结果页面中的绝对排名。 |
position | string | 素在页面中的对齐位置,可选值:left、right。 |
xpath | string | 素在页面中的 XPath。 |
title | string | 商户或结果标题。 |
description | string | 结果描述营业信息、营业时间或评价摘要等。 |
domain | string/null | 结果对应的域名。无域名时为 null。 |
phone | string | 电话号码。 |
booking_url | string | 预约或预订页面 URL。 |
url | string/null | 页面 URL。 |
is_paid | boolean | 是否为广告结果。 |
rating | object | 商户评分信息。 |
cid | string | 搜索引擎定义的商户唯一 ID,可用于获取该商户的完整评价列表。 |
rectangle | object/null | 结果摘要在页面中的矩形位置和像素尺寸。本地商户结果中通常为 null。 |
rating 评分字段
| 字段 | 类型 | 说明 |
|---|---|---|
rating_type | string | 评分类型,可选:Max5、Percents、CustomMax。 |
value | float | 评分值。 |
votes_count | integer | 评价或反馈数量。 |
rating_max | integer | 当前评分类型的最大值。 |
响应示例
json
{
"version": "0.1.20220819",
"status_code": 20000,
"status_message": "Ok.",
"time": "4.0522 sec.",
"cost": 0.0144,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"id": "task-uuid-example",
"status_code": 20000,
"status_message": "Ok.",
"time": "3.8421 sec.",
"cost": 0.0144,
"result_count": 1,
"data": {
"api": "serp",
"function": "live",
"se": "google",
"se_type": "local_finder",
"language_code": "en",
"location_code": 2840,
"keyword": "local nail services",
"min_rating": 4.5,
"time_filter": "monday",
"device": "desktop",
"os": "windows"
},
"result": [
{
"keyword": "local nail services",
"type": "local_finder",
"se_domain": "google.com",
"location_code": 2840,
"language_code": "en",
"check_url": "https://www.google.com/search?q=local+nail+services",
"datetime": "2019-11-15 12:57:46 +00:00",
"item_types": [
"local_pack"
],
"se_results_count": 20,
"items_count": 20,
"items": [
{
"type": "local_pack",
"rank_group": 1,
"rank_absolute": 1,
"position": "right",
"xpath": "/html/body/div/div/div",
"title": "Liam Nails",
"description": "5+ years in business · Mon: 9AM–5PM",
"domain": "example.com",
"phone": "+1 443-640-4298",
"booking_url": "https://www.google.com/maps/reserve/appt",
"url": "https://example.com/",
"is_paid": false,
"rating": {
"rating_type": "Max5",
"value": 4.5,
"votes_count": 50,
"rating_max": 5
},
"cid": "5302726516741959894",
"rectangle": null
}
]
}
]
}
]
}当 status_code 不为 20000 时,应根据 status_code 和 status_message 处理异常。完整错误码列表请参考 /v3/appendix/errors。
实用场景
- 监测本地排名:按城市、坐标和设备批量查询本地商户结果,评估门店在本地搜索中的位置。
- 对比竞争商户表现:提取竞争商户的排名、评分、评价数量、电话和官网,制定本地 SEO 优化策略。
- 筛选高评分经营场所:结合
min_rating过滤结果,定位高评分竞品或潜在合作商户,支持市场调研。 - 分析营业时间覆盖:使用
time_filter查询营业中的商户,评估特定时段的本地搜索竞争状况。 - 追踪桌面端与移动端差异:分别提交
device和os参数,比较不同设备下的本地搜索排名与结果展示差异。