主题
获取 Google 以图搜图 SERP 高级结果(按任务 ID)
接口说明
用于根据任务 ID 获取 Google 以图搜图(Search By Image)的 SERP 高级结果。
请求地址
GET https://api.seermartech.cn/v3/serp/google/search_by_image/task_get/advanced/$id
计费说明
本接口在创建任务时扣费,任务结果在生成后的 30 天可重复获取。
扣费以响应头 X-SeerMarTech-Charge-CNY 为准。
路径参数
| 参数名 | 类型 | 说明 |
|---|---|---|
id | string | 任务唯一标识,UUID 格式。可在任务创建后的 30 天随时用于获取结果。 |
返回结构说明
接口返回 JSON 数据,顶层 tasks 数组,每个任务项中对应结果。
顶层字段
| 字段 | 类型 | 说明 |
|---|---|---|
version | string | 当前 API 版本 |
status_code | integer | 接口级状态码 |
status_message | string | 接口级提示信息 |
time | string | 执行时间,单位秒 |
cost | float | 本次请求总成本,单位 USD |
tasks_count | integer | tasks 数组中的任务数 |
tasks_error | integer | 返回错误的任务数 |
tasks | array | 任务结果数组 |
建议在接时设计完整的异常处理与状态码处理机制。
tasks[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
id | string | 任务 ID,UUID 格式 |
status_code | integer | 任务状态码,范围通常为 10000-60000 |
status_message | string | 任务状态信息 |
time | string | 任务执行时间 |
cost | float | 单任务成本,单位 USD |
result_count | integer | result 数组中的结果数量 |
path | array | 请求路径 |
data | object | 创建任务时传的参数 |
result | array | 结果数组 |
result[] 字段
| 字段 | 类型 | 说明 |
|---|---|---|
image_url | string | POST 提交时指定的图片 URL |
keyword | string | 搜索引擎为该图片的 |
type | string | 搜索引擎类型 |
se_domain | string | 搜索引擎域名 |
location_code | integer | 地区代码 |
language_code | string | 语言代码 |
check_url | string | 搜索结果直达链接,可用于人工核验结果准确性 |
datetime | string | 结果抓取时间,UTC 格式:yyyy-mm-dd hh-mm-ss +00:00 |
spell | object | 搜索引擎自动纠错信息 |
refinement_chips | object | 搜索细化建议模块 |
item_types | array | 当前 SERP 中的结果类型 |
se_results_count | integer | SERP 总结果数 |
items_count | integer | items 数组返回的数 |
items | array | SERP 结果项 |
spell 字段
当搜索引擎对进行了纠错时,会返回该对象。
| 字段 | 类型 | 说明 |
|---|---|---|
keyword | string | 自动纠错后的 |
type | string | 纠错类型 |
type 可能值:
did_you_meanshowing_results_forno_results_found_forincluding_results_for
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 中的域名 |
item_types 可选值
item_types 表示当前 SERP 中出现的结果类型,可能:
organicimages
SERP素说明
organic 自然结果
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 organic |
rank_group | integer | 同类型结果中的组排名 |
rank_absolute | integer | 在整个 SERP 中的绝对排名 |
position | string | 布局位置,可为 left 或 right |
xpath | string | 素 XPath |
domain | string | 结果域名 |
title | string | 结果标题 |
url | string | 结果链接 |
cache_url | string | 网页缓存链接 |
related_search_url | string | 相似搜索链接 |
breadcrumb | string | 面屑路径 |
website_name | string | 网站名称 |
is_image | boolean | 是否图片 |
is_video | boolean | 是否视频 |
is_featured_snippet | boolean | 是否为精选摘要 |
is_malicious | boolean | 是否被标记为恶意 |
is_web_story | boolean | 是否为 Web Story |
description | string | 结果描述 |
pre_snippet | string | 描述前附加信息 |
extended_snippet | string | 描述后附加信息 |
images | array | 结果图片 |
amp_version | boolean | 是否有 AMP 版本 |
rating | object | 评分信息 |
price | object | 价格信息 |
highlighted | array | 描述中加粗高亮的词 |
links | array | 附加站点链接(sitelinks) |
faq | object | FAQ 扩展块 |
extended_people_also_search | array | 扩展搜索 |
about_this_result | object | “此结果”面板信息 |
related_result | array | 同域名结果 |
timestamp | string | 发布时间,UTC 格式 |
rectangle | object | 页面矩形坐标与尺寸信息 |
images[](自然结果中的图片)
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 images_element |
alt | string | 图片 alt 文本 |
url | string | 页面 URL |
image_url | string | 图片 URL |
image_url可能指向原始资源,也可能指向本平台存储的图片副本(当原始资源不可用时)。
rating 字段
| 字段 | 类型 | 说明 |
|---|---|---|
rating_type | string | 评分类型,可为 Max5、Percents、CustomMax |
value | float | 评分值 |
votes_count | integer | 评价数量 |
rating_max | integer | 评分上限 |
price 字段
| 字段 | 类型 | 说明 |
|---|---|---|
current | float | 当前价格 |
regular | float | 原价 |
max_value | float | 最高价格 |
currency | string | 货币代码,ISO 格式 |
is_price_range | boolean | 是否为价格区间 |
displayed_price | string | 结果页展示的原始价格文本 |
links[] 站点链接
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 link_element |
title | string | 链接标题 |
description | string | 链接描述 |
url | string | 链接地址 |
domain | string | 域名 |
faq FAQ 扩展
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 faq_box |
items | array | FAQ 条目 |
faq.items[]
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 faq_box_element |
title | string | 问题标题 |
description | string | 下拉答案 |
links | array | FAQ 中的链接 |
about_this_result 字段
表示 Google“此结果”面板中的补上下文。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 about_this_result_element |
url | string | 结果 URL |
source | string | 附加信息来源 |
source_info | string | 来源说明或网站背景描述 |
source_url | string | 来源链接 |
language | string | 结果语言 |
location | string | 结果适用地区 |
search_terms | array | 命中的搜索词 |
related_terms | array | 搜索词 |
related_result[]
如果主结果摘要中同域名的结果,会返回在该字段中。
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 related_result |
xpath | string | 素 XPath |
domain | string | 域名 |
title | string | 标题 |
url | string | 结果链接 |
cache_url | string | 缓存链接 |
related_search_url | string | 相似搜索链接 |
breadcrumb | string | 面屑 |
is_image | boolean | 是否图片 |
is_video | boolean | 是否视频 |
description | string | 描述 |
pre_snippet | string | 描述前附加信息 |
extended_snippet | string | 描述后附加信息 |
images | array | 图片信息 |
amp_version | boolean | 是否有 AMP 版本 |
rating | object | 评分信息 |
price | object | 价格信息 |
highlighted | array | 高亮词 |
about_this_result | object | “此结果”面板信息 |
timestamp | string | 发布时间,UTC 格式 |
如果在创建任务时将
group_organic_results设为false,这些结果也可能作为独立的"type": "organic"项返回。
rectangle 字段
表示该结果块在页面上的位置和尺寸。
当创建任务时将 calculate_rectangles 设置为 true 时返回,否则为 null。
| 字段 | 类型 | 说明 |
|---|---|---|
x | integer | 左上角 x 坐标 |
y | integer | 左上角 y 坐标 |
width | integer | 素宽度,像素 |
height | integer | 素高度,像素 |
images 图片结果
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 images |
rank_group | integer | 同类型结果中的组排名 |
rank_absolute | integer | 在整个 SERP 中的绝对排名 |
position | string | 布局位置,可为 left 或 right |
xpath | string | 素 XPath |
title | string | 结果标题 |
url | string | 结果链接 |
items | array | 图片项 |
related_image_searches | array | 图片搜索建议 |
rectangle | object | 页面矩形坐标与尺寸信息 |
images.items[]
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 images_element |
alt | string | 图片 alt 文本 |
url | string | 图片所在资源页 URL |
image_url | string | 压缩后的缩略图 URL |
related_image_searches[]
| 字段 | 类型 | 说明 |
|---|---|---|
type | string | 固定为 related_image_searches_element |
title | string | 标题,可用于细化图片搜索 |
alt | string | 特色图片 alt 文本 |
url | string | 特色图片原始 URL |
image_url | string | 压缩后的特色图片 URL |
沙箱调试
可通过沙箱接口查看当前端点所有可能返回的字段结构,字段为模拟数据,不会产生费用。
沙箱地址
https://sandbox.本平台.com/v3/serp/google/search_by_image/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/search_by_image/task_get/advanced/${id}" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json"Python
python
import requests
task_id = "02231934-2604-0066-2000-570459f04879"
url = f"https://api.seermartech.cn/v3/serp/google/search_by_image/task_get/advanced/{task_id}"
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json)TypeScript
typescript
import axios from "axios";
const taskId = "02231934-2604-0066-2000-570459f04879";
axios({
method: "get",
url: `https://api.seermartech.cn/v3/serp/google/search_by_image/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 拉取已完成任务
通常建议通过 /v3/serp/google/search_by_image/tasks_ready 获取已完成任务,再逐个请求高级结果接口。
Python 示例
python
import requests
headers = {
"Authorization": "Bearer smt_live_YOUR_KEY",
"Content-Type": "application/json"
}
# 1. 获取已完成任务列表
ready_resp = requests.get(
"https://api.seermartech.cn/v3/serp/google/search_by_image/tasks_ready",
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", []):
endpoint = task_info.get("endpoint_advanced")
task_id = task_info.get("id")
# 2. 直接使用 endpoint_advanced 拉取
if endpoint:
resp = requests.get(
"https://api.seermartech.cn" + endpoint,
headers=headers
)
results.append(resp.json)
# 3. 或根据任务 ID 拼接接口地址拉取
# if task_id:
# resp = requests.get(
# f"https://api.seermartech.cn/v3/serp/google/search_by_image/task_get/advanced/{task_id}",
# headers=headers
# )
# results.append(resp.json)
print(results)响应示例
json
{
"version": "0.1.20230825",
"status_code": 20000,
"status_message": "Ok.",
"time": "0.0957 sec.",
"cost": 0,
"tasks_count": 1,
"tasks_error": 0,
"tasks": [
{
"data": {
"api": "serp",
"function": "task_get",
"se": "google",
"se_type": "search_by_image",
"language_code": "en",
"location_code": 2840,
"image_url": "https://www.shutterstock.com/blog/wp-content/uploads/sites/5/2021/11/shutterstock_721703848.jpg?w=580&h=580&crop=1",
"priority": 2,
"device": "desktop",
"os": "windows"
},
"result": [
{
"se_results_count": 0,
"items_count": 61,
"items": [
{
"related_image_searches": null,
"rectangle": null
},
{
"type": "organic",
"rank_group": 1,
"rank_absolute": 2,
"position": "left",
"xpath": null,
"domain": "$43.35* • Amazon",
"title": "ART.COM Wall Art Prints Colorful Flower on Dark Tropical Foliage Nature Background, Botanical Decor, 36\" x 24\"",
"url": "https://www.amazon.com/ART-COM-Colorful-Tropical-Background-Botanical/dp/B0CBL4YQ1L",
"cache_url": null,
"related_search_url": null,
"breadcrumb": null,
"website_name": null,
"is_image": true,
"is_video": false,
"is_featured_snippet": false,
"is_malicious": false,
"is_web_story": false,
"description": null,
"pre_snippet": null,
"extended_snippet": null,
"images": [],
"amp_version": false,
"rating": null,
"price": null,
"highlighted": null,
"links": null,
"faq": null,
"extended_people_also_search": null,
"about_this_result": null,
"related_result": null,
"timestamp": null,
"rectangle": null
},
{
"type": "organic",
"rank_group": 2,
"rank_absolute": 3,
"position": "left",
"xpath": null,
"domain": "twitter.com",
"title": "everpix on X: \"Today is a good day to change the #wallpaper 👌🏻😏😍 #wallpapers #iphonewallpapers #iphonewallpaper #background #backgrounds #bestbackground #bestwallpaper #iphone_wallpaper #iphone_wallpapers #everpix #everpixlive #livewallpaper #contrast #abstractart #abstarct #brightbackground https://t.co/4XYPcKED2G\" / X",
"url": "https://twitter.com/everpixapp/status/1097804893534982144",
"cache_url": null,
"related_search_url": null,
"breadcrumb": null,
"website_name": null,
"is_image": true,
"is_video": false,
"is_featured_snippet": false,
"is_malicious": false,
"is_web_story": false,
"description": null,
"pre_snippet": null,
"extended_snippet": null,
"images": [],
"amp_version": false,
"rating": null,
"price": null,
"highlighted": null,
"links": null,
"faq": null,
"extended_people_also_search": null,
"about_this_result": null,
"related_result": null,
"timestamp": null,
"rectangle": null
},
{
"type": "organic",
"rank_group": 3,
"rank_absolute": 4,
"position": "left",
"xpath": null,
"domain": "$10.82* • Redbubble",
"title": "Golden Tropical Bloom + Blue-Green Jungle Leaves Art Board Print",
"url": "https://www.redbubble.com/i/art-board-print/Golden-Tropical-Bloom-Blue-Green-Jungle-Leaves-by-EscapistDecor/64463975.5E8EA",
"cache_url": null,
"related_search_url": null,
"breadcrumb": null,
"website_name": null,
"is_image": true,
"is_video": false,
"is_featured_snippet": false,
"is_malicious": false,
"is_web_story": false,
"description": null,
"pre_snippet": null,
"extended_snippet": null,
"images": [],
"amp_version": false,
"rating": null,
"price": null,
"highlighted": null,
"links": null,
"faq": null,
"extended_people_also_search": null,
"about_this_result": null,
"related_result": null,
"timestamp": null,
"rectangle": null
},
{
"type": "organic",
"rank_group": 4,
"rank_absolute": 5,
"position": "left",
"xpath": null,
"domain": "globalgovernanceproject.org",
"title": "Inger Andersen, Author at The Global Governance Project",
"url": "https://www.globalgovernanceproject.org/author/inger-andersen/",
"cache_url": null,
"related_search_url": null,
"breadcrumb": null,
"website_name": null,
"is_image": true,
"is_video": false,
"is_featured_snippet": false,
"is_malicious": false,
"is_web_story": false,
"description": null,
"pre_snippet": null,
"extended_snippet": null,
"images": [],
"amp_version": false,
"rating": null,
"price": null,
"highlighted": null,
"links": null,
"faq": null,
"extended_people_also_search": null,
"about_this_result": null,
"related_result": null,
"timestamp": null,
"rectangle": null
}
]
}
]
}
]
}状态码与错误处理
- 顶层
status_code表示整个请求是否成功。 tasks[].status_code表示单个任务的处理状态。- 建议同时检查:
- 顶层
status_code == 20000 tasks_error == 0tasks[].result是否为空- 单任务状态码是否大于等于
40000
如果任务尚未完成,建议调用 /v3/serp/google/search_by_image/tasks_ready 查询可拉取的任务列表。
实用场景
- 识别图片对应:根据图片反查 Google ,用于图片 SEO、素材归类和标签自动生成。
- 追踪图片落地页:提取以图搜图中的自然结果 URL、域名和排名,评估品牌图片或商品图在哪些站点被搜索引擎识别和展示。
- 挖掘竞品图片分发渠道:分析
organic和images结果中的来源域名,定位竞品图片被转载、引用或售卖的平台。 - 发现图片搜索细分需求:利用
refinement_chips和related_image_searches获取用户可能的细化搜索方向,扩展图片选题与长尾。 - 评估商品图搜索商业价值:结合结果中的价格、评分、图片和站点链接信息,识别图片搜索结果中的电商机会与转化页面布局。