# Google Search

**SERP  API 谷歌 Search查询参数**

使用 Thordata的 SERP API 配置谷歌搜索查询，包括本地化参数、地理位置、分页、以及“高级参数”输出选项。

<details>

<summary><strong><code>q</code> ，搜索查询(必填)</strong></summary>

定义用于数据抓取的搜索查询（默认值：`q=pizza`）。支持任何语言的任意关键词。

**示例请求：**

使用`q`：<mark style="color:blue;">pizza</mark>参数的示例

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1"
```

</details>

<details>

<summary><strong><code>json</code> ,</strong>输出格式<strong>(非必填)</strong></summary>

该参数定义了抓取结果的输出格式。可选择JSON、Light JSON和HTML(支持下载)格式，默认为JSON。注意：当默认数据格式设置为轻量Light JSON输出，仅包含来自 Google 的顶部自然搜索结果。

**示例请求：**

查询  `q` ：<mark style="color:blue;">pizza</mark> ,**`json` :1**

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1"
```

</details>

<details>

<summary><strong><code>render_js</code> ,</strong>JS渲染<strong>(非必填)</strong></summary>

如果为 true，系统将使用浏览器执行页面脚本并返回完整渲染后的 HTML。

**示例请求：**

查询  `q` ：<mark style="color:blue;">pizza</mark> ,`render_js` **:**&#x74;rue

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "render_js=true"
```

</details>

<details>

<summary><strong><code>no_cache</code> ,</strong>禁用缓存<strong>(非必填)</strong></summary>

默认情况下，5分钟内缓存相同参数的搜索结果。将 no\_cache 设为 true 可跳过缓存，设为 false（默认）则使用缓存结果。缓存搜索免费，且不计入您的搜索统计。

**示例请求：**

查询  `q` ：<mark style="color:blue;">pizza</mark> ，`no_cache` **:**&#x74;rue

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "no_cache=true"
```

</details>

<details>

<summary><strong><code>ai_overview</code> ,</strong>AI 概览<strong>(非必填)</strong></summary>

控制是否获取 Google 搜索结果中的 AI 概览（AI Overview）内容。计费方式：成功获取 AI 概览通常计为 1 次响应。当首次请求仅返回page\_token时，系统自动进行的第二次请求将额外计费，总共消耗 2 次响应。

**示例请求：**

查询  `q` ：<mark style="color:blue;">pizza</mark> ，**`ai_overview` :**&#x74;rue

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "ai_overview=true"
```

</details>

## 本土化

<details>

<summary><code>google_domain</code><strong>，域名(非必填)</strong></summary>

定义用于数据抓取的搜索引擎域名（默认值：google.com）。

您可在系统中修改此参数或参考[Google域名页面](https://domains.squarespace.com/)获取完整支持的域名列表。

**示例请求：**

查询  `q` ：<mark style="color:blue;">pizza</mark> ，`url` ：<mark style="color:blue;">google.co.ao</mark>的示例结果

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "google_domain=google.co.ao" \
 -d "json=1"
```

</details>

<details>

<summary><strong><code>gl</code> ，国家(非必填)</strong></summary>

指定搜索结果的定位国家/地区（默认值：`us`）。采用两位字母国家代码（如：`us`-美国，`ru`-俄罗斯，`uk`-英国）。

完整国家代码支持列表请参阅：[Google官方国家代码表](https://developers.google.com/adwords/api/docs/appendix/geotargeting)

**示例请求：**

查询 `q` ：<mark style="color:blue;">pizza</mark>,`gl`<mark style="color:blue;">：ru</mark>的示例结果

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "gl=ru" \
 -d "json=1"
```

</details>

<details>

<summary><strong><code>hl</code> ，语言(非必填)</strong></summary>

设置搜索结果的界面语言（默认值：`en`）。采用标准语言代码格式（如：`en`-英文，`es`-西班牙文，`zh-CN`-简体中文）。

完整语言代码支持列表请参阅：[Google官方语言代码表](https://developers.google.com/google-ads/api/docs/start)

**示例请求：**

查询`q` ：<mark style="color:blue;">pizza</mark>,`hl`： <mark style="color:blue;">es</mark>的示例结果

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "hl=es"
```

</details>

<details>

<summary><strong><code>cr</code>，设置多个国家/地区(非必填)</strong></summary>

限制结果至特定国家，使用 `|` 作为分隔符（例如：`countryFR|countryDE`）。可与 `gl` 参数配合使用以确保界面/内容语言一致。

`gl` 和 `cr` 参数可组合使用，但实际效果以 `cr` 参数为优先。

**示例请求：**

查询`q` : <mark style="color:blue;">pizza</mark>,`cr`: <mark style="color:blue;">countryAI|countryAQ</mark>的示例结果

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "cr=countryAI|countryAQ"
```

</details>

<details>

<summary><strong><code>lr</code>，设置多语言(非必填)</strong></summary>

使用 `lang_XX` 代码（如 `lang_fr|lang_de`）按语言筛选结果。若同时使用 `hl` 参数，此参数将覆盖 `hl`。

&#x20;`hl` 和`lr`可同时使用，但实际效果以 `lr` 为优先。

**示例请求：**

查询 `q` : <mark style="color:blue;">pizza</mark>,`lr`: <mark style="color:blue;">lang\_en|lang\_fr</mark>的示例结果

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "lr=lang_fr|lang_en"
```

</details>

## 地理位置

<details>

<summary><strong><code>location</code>，地理位置(非必填)</strong></summary>

模拟从精确位置发起搜索，必须与 **`uule`** 参数搭配使用。若未指定，则可能采用代理服务器的地理位置。

**示例请求：**

查询 `q` : <mark style="color:blue;">pizza</mark>,`location`:<mark style="color:blue;">India</mark>,`uule`:<mark style="color:blue;">w+CAIQICIFSW5kaWE</mark>的示例结果

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "location=India" \
 -d "uule=w+CAIQICIFSW5kaWE"
```

</details>

<details>

<summary><strong><code>uule</code> ，</strong>编码位置<strong>(非必填)</strong></summary>

使用 Base64 编码目标地理位置，需与 **`location`** 参数配合使用。

**示例请求：**

查询  `q` : <mark style="color:blue;">pizza</mark>,`location`:<mark style="color:blue;">India</mark>,`uule`:<mark style="color:blue;">w+CAIQICIFSW5kaWE</mark>的示例

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "location=India" \
 -d "uule=w+CAIQICIFSW5kaWE"
```

</details>

## 搜索类型

<details>

<summary><strong><code>tbm</code> ，搜索搜索类型(非必填)</strong></summary>

定义搜索结果类型：

* `tbm=images` – 图片
* `tbm=shops` – 购物
* `tbm=news` – 新闻
* `tbm=videos` – 视频

**示例请求：**

查询  `q` : <mark style="color:blue;">pizza</mark>,`tbm`:<mark style="color:blue;">shop</mark>的示例

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "tbm=shops"
```

</details>

## 分页

<details>

<summary><strong><code>start</code> ，结果偏移量（非必填）</strong></summary>

该参数定义结果偏移量。它会跳过指定数量的结果。它用于分页。（例如，0（默认值）表示第一页结果，10 表示第二页结果，20 表示第三页结果，以此类推。）

建议从 0 开始，并以 10 递增获取下一页。起始偏移值没有硬性上限，但我们建议最多 100，与 Google Maps 网页端的行为一致。超过该值，结果可能会重复或不相关。

**示例请求：**

查询 `q` : <mark style="color:blue;">pizza</mark>,`start`:<mark style="color:blue;">30</mark>的示例

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "start=30"
```

</details>

<details>

<summary><strong><code>num</code> ，每页结果数（非必填）</strong></summary>

受Google限制，实际数量可能不足，最多为10条。

**示例请求：**

查询 `cq` : <mark style="color:blue;">pizza</mark>,`num`:<mark style="color:blue;">20</mark>的示例

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "num=20"
```

</details>

## 高级参数

<details>

<summary><strong><code>ludocid</code> ，Google 地点 ID（非必填）</strong></summary>

参数定义您要抓取的谷歌我的业务列表的标识(CID)。也称为谷歌地点标识。

**示例请求：**

查询 `q` : <mark style="color:blue;">pizza</mark>,`ludocid`:<mark style="color:blue;">14389889685039125943</mark>的示例

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "ludocid=14389889685039125943"
```

</details>

<details>

<summary><strong><code>kgmid</code> ，Google 知识图谱 ID（非必填）</strong></summary>

`kgmid` 参数用于直接调用 Google 知识图谱中特定条目的加密数据，覆盖常规搜索参数并返回结构化结果。

**示例请求：**

查询 `q` : <mark style="color:blue;">pizza</mark>,`kgmid`:<mark style="color:blue;">/m/0d6lp</mark>的示例

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "start=06" \
 -d "kgmid=/m/0d6lp"
```

</details>

<details>

<summary><strong><code>ibp</code> ，Google 元素渲染（非必填）</strong></summary>

用于控制特定元素（如带`ludocid`的知识图谱扩展搜索）的布局渲染和展开效果

**示例请求：**

查询 `q` : <mark style="color:blue;">pizza</mark>,`ibp`:<mark style="color:blue;">new</mark>的示例

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "ibp=new"
```

</details>

<details>

<summary><strong><code>tbs</code> ，高级搜索条件（非必填）</strong></summary>

时间/类型筛选（支持复杂条件），比如`tbs=qdr:d qdr:d=24`小时内的内容；再比如`tbs=sur:f`,表示结果仅展示图片

**示例请求：**

查询 `q` : <mark style="color:blue;">pizza</mark>,`tbs`:<mark style="color:blue;">sur:f</mark>的示例

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "tbs=sur:f"
```

</details>

<details>

<summary><strong><code>nfpr</code> ，排除自动更正结果（非必填）</strong></summary>

定义是否禁用自动纠正拼写，比如：`nfpr=1` ，搜索“googl”不自动纠正为“google”

**示例请求：**

查询  `q` : <mark style="color:blue;">pizza</mark>,`nfpr`:<mark style="color:blue;">1</mark>的示例

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "nfpr=1"
```

</details>

<details>

<summary><strong><code>filter</code> ，结果筛选（非必填）</strong></summary>

定义去重结果: `1` (启用), `0` (禁用).

**示例请求：**

查询 `q` : <mark style="color:blue;">pizza</mark>,`filter`:1的示例

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "filter=1"
```

</details>

<details>

<summary><strong><code>safe</code> ，</strong>成人内容过滤<strong>（非必填）</strong></summary>

该参数定义了搜索结果是否屏蔽成人内容。您可设置为 `active` 或者 `off` ，通常情况下，Google会对露骨内容进行模糊处理。

**示例请求：**

查询 `q` : <mark style="color:blue;">pizza</mark>,`safe`:<mark style="color:blue;">active</mark>的示例

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google" \
 -d "q=pizza" \
 -d "json=1" \
 -d "safe=active"
```

</details>

如果您需要更多帮助，请通过邮箱<support@thordata.com>联系我们。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.thordata.com/doc/zh/pa-qu/serp-api/cha-xun-can-shu/gu-ge/google-search.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
