# Google Local

**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_local" \
 -d "q=pizza" \
 -d "json=1"
```

</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_local" \
 -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_local" \
 -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_local" \
 -d "q=pizza" \
 -d "json=1" \
 -d "hl=es"
```

</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_local" \
 -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_local" \
 -d "q=pizza" \
 -d "json=1" \
 -d "location=India" \
 -d "uule=w+CAIQICIFSW5kaWE"
```

</details>

## 分頁

<details>

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

谷歌本地結果只接受20的倍數(例如，第二頁結果為20，第三頁結果為40等)作為起始值。

**示例請求：**

查询 `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_local" \
 -d "q=pizza" \
 -d "json=1" \
 -d "start=30"
```

</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_local" \
 -d "q=pizza" \
 -d "json=1" \
 -d "ludocid=14389889685039125943"
```

</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_local" \
 -d "q=pizza" \
 -d "json=1" \
 -d "tbs=sur:f"
```

</details>

如需進一步幫助，請透過 **<support@thordata.com>** 聯繫我們。
