你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

SerpAPI 工具

SerpAPI 是一种 Python 工具,它提供 SerpAPI Google 搜索引擎结果 API 和 SerpAPI 必应搜索引擎结果 API包装器。

你可以使用该工具从多种不同的搜索引擎(包括 Google 和必应)中检索搜索结果。 还可以指定一系列搜索参数,例如搜索查询、位置和设备类型。

先决条件

SerpAPI 网站上注册。

Connection

连接是用于与 SerpAPI 建立连接的模型。

类型 名称 API 密钥
Serp 必需 必须

API 密钥位于 SerpAPI 帐户仪表板上。

输入

SerpAPI 工具支持以下参数:

名称 Type 描述 必须
query string 要运行的搜索查询。
引擎 字符串 用于搜索的搜索引擎。 默认为 google
num 整型 要返回的搜索结果数。 默认值为 10。
location string 从中运行搜索的地理位置。
安全 字符串 用于搜索的安全搜索模式。 默认值为 off

Outputs

SerpAPI 查询中的 JSON 表示形式。

引擎 返回类型 输出
Google JSON 示例
必应 JSON 示例