AI 概览

从搜索结果中提取 Google AI 概览,解析答案文本、要点列表、产品、食谱、来源面板、信息列表和相关问题等数据。

google_searchgoogle_ads sources can return AI Overviews from Google Search results in all supported global regions. ai_overviews result array supports multiple AI blocks in a single response, including sections like “People also ask” and “Things to know.”

To maximize the chance of receiving fully rendered AI Overviews content, you must include the following parameters:

参数
Value

source

google_searchgoogle_ads

render

html

user_agent_type

desktop移动

Using these parameters also allows you to receive both the general response and AI Overviews content with a single request.

triangle-exclamation
circle-check

AI Overviews regional availability

Google AI Overviews are available in most countries apart from a few exceptions. Currently biggest excluded countries are:

  • 法国

  • 中国

  • Iran

  • North Korea

circle-exclamation

请求示例

我们在示例中使用同步 Realtime 集成方法。如果您想使用 Proxy Endpoint 或异步 Push-Pull 集成,请参阅 集成方法 部分。

请求参数值

通用

Basic setup and customization options for scraping Google Web search results with AI Overviews.

参数
描述
默认值

source

Sets the scraper. Use google_searchgoogle_ads.

google_search

query

要搜索的关键词或短语。

-

render

当设置为时启用 JavaScript 渲染 html. 更多信息.

-

parse

当设置为时返回解析后的数据 true.

false

callback_url

回调端点的 URL。 更多信息.

-

user_agent_type

Device type and browser. Use desktop移动.

desktop

- 必填参数

Google 高级搜索运算符

抓取时,将 Google 高级搜索运算符与查询结合使用可能很有用。它使您能够自定义搜索范围,从而确保结果更相关、聚焦。探索这些特殊命令 herearrow-up-rightherearrow-up-right. See the example query below.

本地化

将搜索结果适配到特定地理位置和语言。

参数
描述
默认值

geo_location

应适配结果的地理位置。正确使用此参数对于获取正确数据非常重要。有关更多信息,请阅读我们建议的 geo_location 参数结构 here.

-

locale

Accept-Language 标头值,用于更改您 Google 搜索页面的网页界面语言。 更多信息.

-

context: results_language

结果语言。受支持的 Google 语言列表可在 here。 了解如何使用上下文参数 here.

-

分页

用于管理搜索结果分页和检索的控制项。

参数
描述
默认值

start_page

起始页码。

1

pages

要检索的页数。

1

limit

每页要检索的结果数量。

10

context:limit_per_page

使用相同 IP 地址和会话(cookie 集)抓取多页。通过在带有 page 键的 JSON 数组中指定页码,并使用 limit 键指示每页的自然结果数,您可以将不同页面之间出现重复自然结果的概率降到最低(例如,第一页的最后一个自然结果与第二页的第一个自然结果相同)。 见示例.

-

支持连续滚动

The Web Scraper API fully supports Google Search continuous scroll. It automatically detects continuous scrolling layouts, efficiently loading the requested organic results without any extra parameters required.

每页限制

circle-exclamation

要使用此功能,请包含一个 JSON 数组,数组内为包含以下数据的 JSON 对象:

参数
描述
示例

page

您要抓取的页码。任何大于 0 的整数值都可用

1

limit

相关页的结果数量。任何介于 1100 (含)之间的整数值都可用。

90

请求示例

过滤

用于根据各种条件筛选和精炼搜索结果的选项。了解如何使用上下文参数 here.

参数
描述
默认值

context: filter

将此参数的值设置为 0 可让您查看因与其他结果相似而被排除的结果。

1

context: safe_search

安全搜索。设置为 true 以启用它。

false

context: udm

udm 参数允许在不同的搜索选项卡(例如图片、地点或视频)之间切换,以自定义显示的结果类型。查找可接受的值 herearrow-up-right.

-

context: tbm

待匹配或 tbm 参数。可接受的值为: app, blg, bks, dsc, isch, nws, pts, plcs, rcp, lcl

-

context: tbs

This parameter is like a container for more obscure Google parameters, like limiting/sorting results by date as well as other filters some of which depend on the tbm 参数(例如 tbs=app_os:1 仅在与 tbmapp一起使用时可用)。更多信息 herearrow-up-right.

-

circle-exclamation

其他

用于特殊需求的其他高级设置和控制项。

参数
描述
默认值

context: fpstate

fpstate 值设置为 aig 将使 Google 加载更多应用。此参数仅在与 render 参数一起使用时有用。

-

context: nfpr

true 将关闭拼写自动更正

false

上下文参数

所有上下文参数应作为对象添加到 context 数组,形式为具有 对,例如:

Data structure and processing

Data dictionary

All of the available keys within AI Overviews SERP feature are defined in the table below:

Key (results.ai_overview)
描述
类型

answer_text

General information about the Google Search query term.

数组

bullet_list

Indicates information on items rendered in a bulleted list within the AI Overviews SERP feature.

数组

products

A list of products with their respective details.

对象

source_panel

A list of sources used to generate AI Overviews result in Google SERP feature.

对象

additional_questions

A list of additional questions with their respective details.

对象

recipes

包含各自详细信息的菜谱列表。

对象

info_list

A list of information most frequently used to represent steps of a process relevant to the search query.

数组

pos_overall

An indication of the position of the AI Overviews SERP feature result among all available Google SERP results.

整数

Working with Multiple AI Overviews

Since AI Overviews are now returned as an array, you have to iterate through them:

In most cases, there will be only one AI Overview, but your code should be prepared to handle multiple entries.

Explore examples of AI Overviews results below, categorized by different search queries: Item, Recipes, Instruction.

Item

In the following example, "Emporio Armani EA3192" query was used.

Answer text

Key (results.ai_overviews.answer_text)
描述
类型

text

A short answer to the Google Search query.

数组

pos

An indicator denoting the position of a given item among all AI Overviews answer results.

整数

Bullet list

Key (results.ai_overviews.bullet_list)
描述
类型

list_title

The title of the bullet list.

字符串

points

The items rendered in the bullet list. All items are comma-separated.

数组

pos

An indicator denoting the position of a given item among all AI Overviews bullet list results.

整数

Products

Key (results.ai_overviews.products)
描述
类型

项目

A list of products with their respective details.

数组

items.product_name

The name of the product.

字符串

items.price

The current price of the product.

字符串

items.previous_price

The initial price of the product (if applicable).

字符串

items.seller

The seller of the product.

字符串

items.shipping

The type of shipping available for the product.

字符串

items.url

产品的 URL。

字符串

items.pos

An indicator denoting the position of a given item among all AI Overviews Product results.

整数

Source panel

Key (results.ai_overviews.source_panel)
描述
类型

项目

A list of sources used to generate AI Overviews result in Google SERP feature.

对象

items.url

The URL of the website.

字符串

items.source

The name of the website.

字符串

items.date

The date when the article was published.

字符串

items.title

文章的标题。

字符串

items.pos

An indicator denoting the position of a given item among all AI Overviews source panel results.

整数

Additional questions

Key (results.ai_overviews.additional_questions)
描述
类型

items.question

A list of comma-separated Additional questions relevant to the original search query.

数组

items.pos

An indicator denoting the position of a given item among all AI Overviews additional questions results.

整数

Recipe

In the following example, "recipe for an apple pie" query was used.

Recipes

Key (results.ai_overviews.recipes)
描述
类型

项目

包含各自详细信息的菜谱列表。

数组

items.description

A short description of the recipe.

字符串

items.image

A base64-encoded thumbnail image of the recipe.

字符串

items.source

The name of the site where the recipe is published.

字符串

items.rating

食谱的评分。

字符串

items.rating_count

The number of ratings.

字符串

items.duration

准备该菜肴所需的时间。

字符串

items.url

完整食谱的 URL。

字符串

items.title

食谱的标题。

字符串

In the following example, "recipe of a juicy succulent steak" query was used.

Info list

Key (results.ai_overviews.info_list)
描述
类型

list_title

The title of the list.

字符串

list_items

Contains a list of items with their respective details.

数组

list_items.title

The title of the section within the list.

字符串

list_items.content

A short description of the section.

数组

list_item.pos

An indicator denoting the position of a given item among all AI Overviews Info list results.

整数

Instruction

In the following example, "docker exec commands explained" query was used.

Answer text command

circle-info

Note: details are rendered in the same array as for item related search query, however, one new type of key (command) appears for instruction related type of query

Key (results.ai_overviews.answer_text)
描述
类型

command

An instruction given to a computer or software to perform a specific task.

字符串

最后更新于

这有帮助吗?