AI 模式
通过提交提示提取 Google AI Mode 响应,包括完整响应文本、引用链接和带来源 URL 的引用。
该 google_ai_mode 此来源旨在提交提示并检索 Google AI Mode 的对话响应。它会返回完整的 Google AI Mode 响应文本及其结构化元数据。
AI Mode 区域可用性
Google AI Mode 可在全球大多数国家/地区使用 除以下例外情况外:
欧洲
法国、土耳其
亚洲
中国、伊朗、朝鲜、叙利亚
美洲
古巴
Google AI Mode 功能正在持续推出,随着时间推移会纳入更多国家/地区。
请求示例
以下代码示例演示如何检索带有解析结果的 Google AI Mode 响应。
curl 'https://realtime.oxylabs.io/v1/queries' \\
--user 'USERNAME:PASSWORD' \\
-H 'Content-Type: application/json' \\
-d '{
"source": "google_ai_mode",
"query": "200 美元以下最佳健康追踪器",
"render": "html",
"parse": true
}'import requests
from pprint import pprint
# 结构化载荷。
payload = {
'source': 'google_ai_mode',
'query': '200 美元以下最佳健康追踪器',
'render': 'html',
'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 AI Mode 响应的基础设置和自定义选项。
- 必填参数
结构化数据
网页爬虫API 会返回 Google AI Mode 输出的 HTML 或 JSON 对象,其中包含结果页的结构化数据。
元素的组成可能会因查询是否来自 desktop 或 mobile 设备而有所不同。
输出数据字典
HTML 示例

JSON 结构
结构化的 google_ai_mode 输出包含如下字段: URL, page, results,以及更多。下表展示了我们解析的每个 Google AI 模式元素的详细列表,包括说明、数据类型和相关元数据。
url
Google AI 模式的 URL。
字符串
page
页码。
整数
content
包含已解析的 Google AI Mode 响应数据的对象。
对象
content.links
响应中引用的外部链接列表。显示在页面右侧的框中。
数组
content.prompt
提交给 Google AI Mode 的原始提示。
字符串
content.citations
包含 URL 和关联文本的引用列表,如 Google AI Mode 响应主区域所示。引用同一文本的多个 URL 会分组到一个列表中。
数组
content.response_text
来自 Google AI Mode 的完整响应文本。
字符串
content.parse_status_code
解析操作的状态代码。
整数
创建时间
抓取任务创建时的时间戳。
时间戳
更新时间
抓取任务完成时的时间戳。
时间戳
任务ID
与抓取任务关联的任务ID。
字符串
最后更新于
这有帮助吗?

