Lens
Google Lens API 可从提供的图片 URL 提取视觉搜索结果。返回视觉匹配的图片结果,包括标题、URL、域名等。
我们的 google_lens 我们的数据源使您能够在执行图像搜索时,从 Google Lens 功能中提取结果。
请求示例
API 会向 Google Lens 功能发送请求,以检索与图像内容相关的结构化数据。
curl 'https://realtime.oxylabs.io/v1/queries' \\
--user 'USERNAME:PASSWORD' \\
-H 'Content-Type: application/json' \\
-d '{
"source": "google_lens",
"query": "https://www.beginningboutique.com.au/cdn/shop/files/Flossie-Pink-Maxi-Sleeveless-Dress_750x.jpg",
"parse": "true"
}'import requests
from pprint import pprint
# 结构化载荷。
payload = {
'source': 'google_lens',
'query': 'https://www.beginningboutique.com.au/cdn/shop/files/Flossie-Pink-Maxi-Sleeveless-Dress_750x.jpg',
'parse': 'true'
}
# 获取响应。
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('USERNAME', 'PASSWORD'),
json=payload,
)
# Print prettified response to stdout.
pprint(response.json())
我们在示例中使用同步 Realtime 集成方法。如果您想使用 Proxy Endpoint 或异步 Push-Pull 集成,请参阅 集成方法 部分。
请求参数值
通用
用于抓取 Google Lens 结果的基础设置和自定义选项。
- 必填参数
本地化
使搜索结果适配特定地理位置和语言。
结构化数据
输出数据字典
JSON 结构
该表概述了 Google Lens 搜索结果的关键元素。下表列出了我们解析的每个 SERP 功能的详细清单,以及其描述和数据类型。该表还包含一些元数据。
自然搜索
Google Lens 会综合多种因素,根据用户上传图像的内容,为用户提供最相关、最有用的信息。

键(results.organic)
描述
类型
pos
用于表示某个项目在所有 Google Lens 结果中的位置的指示器。
整数
url
Google Lens 结果的 URL。
字符串
title
结果的标题。
字符串
domain
Google Lens 结果的来源。
字符串
pos_overall
Google Lens 结果在 SERP 中的位置索引。
整数
url_thumbnail
Google Lens 结果的 base64 编码缩略图图像。
字符串
最后更新于
这有帮助吗?

