# Google Search

**SERP API 谷歌查詢參數**

使用 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>

關閉緩存：當no\_cache開啟時，搜索引擎將被強制獲取更新的結果而不使用緩存數據，確保最新資訊。注意這可能導致查詢速度變慢。緩存蒐索免費，且不計入您的蒐索統計。

**示例請求：**

查询  `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><strong><code>google_domain</code>， 域名（非必填）</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;">countryFR|countryDE</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` 設定。

`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>的示例結果

```
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>

此參數用於指定要擷取的「Google 我的商家」清單識別碼（CID，亦稱為 Google 地點 ID）。

**示例請求：**

查询 `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 知識圖譜（Knowledge Graph）中特定條目的加密資料，將覆蓋常規搜尋參數並回傳結構化結果。

**示例請求：**

查询 `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`：僅顯示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>safe</code> ，</strong>成人內容過濾<strong>（非必填）</strong></summary>

此參數用於設定是否過濾成人內容（預設值：依Google政策）。可指定值：

* `active`：啟用嚴格過濾
* `off`：完全停用過濾\
  （注意：即使設為`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>

<details>

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

此參數用於設定是否停用搜尋關鍵字自動校正功能，例如：

* `nfpr=1`：啟用嚴格模式（輸入「googl」將不會自動校正為「google」）
* `nfpr=0`：使用預設自動校正功能

**示例請求：**

查询  `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>

如需進一步幫助，請透過 **<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-hk/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.
