# Google Product

**SERP API Google 查詢參數**

使用 Thordata 的 SERP API 配置 Google 產品查詢，包括本地化參數、地理定位、搜索類型、分頁以及「高級篩選」輸出選項。

<details>

<summary><code>product_id</code>,產品ID<strong>(必填)</strong></summary>

該參數定義要獲取結果的產品，通常出現在支援產品的購物結果中（例如：[https://www.google.com/shopping/product/{product\_id}](https://www.google.com/shopping/product/%7Bproduct_id%7D)）。

**範例請求：**

使用參數 `product_id` 的範例：`4887235756540435899`

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

</details>

## 本地化

<details>

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

定義用於數據爬取的搜尋引擎網域名稱（預設值：google.com）。\
您可以在系統中修改此參數，或參考 Google 網域頁面以獲取完整支援的網域名稱清單。

**範例請求：**

使用參數 `product_id: 4887235756540435899` 和 `google_domain: google.co.ao` 的範例結果。

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

</details>

<details>

<summary><strong><code>gl</code> ,</strong>國家<strong>(非必填)</strong></summary>

指定搜尋結果的目標國家/地區（預設值：us）。請使用兩位字母的國家代碼（例如：us、ru、uk）。\
如需完整的支援國家代碼清單，請參考：Google 國家代碼列表。

**範例請求：**

使用參數 `product_id: 4887235756540435899` 及 `gl: ru` 的範例結果。

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

</details>

<details>

<summary><strong><code>hl</code> ,</strong>語言<strong>(非必填)</strong></summary>

設定搜尋結果的介面語言（預設值：en）。請使用標準語言代碼格式（例如：en、es、zh-CN）。\
如需完整的支援語言代碼清單，請參考：Google 語言代碼列表。

**範例請求：**

使用參數 `product_id: 4887235756540435899` 及 `hl: es` 的範例結果。

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

</details>

## 地理位置

<details>

<summary><strong><code>location</code> ,</strong>位置<strong>(非必填)</strong></summary>

模擬從特定位置發起搜索，此參數必須與 uule 參數搭配使用。若未指定，系統可能採用代理伺服器的地理位置。

範例請求：

使用參數 `product_id`:4887235756540435899,`location`:India,`uule`:w+CAIQICIFSW5kaWE 的範例結果

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

</details>

<details>

<summary><strong><code>uule</code> ,</strong>編碼位置<strong>(非必填)</strong></summary>

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

範例請求：

使用參數 `product_id`:4887235756540435899,`location`:India,`uule`:w+CAIQICIFSW5kaWE 的範例結果

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

</details>

## 搜尋類型

<details>

<summary><code>offers</code> <strong>,</strong>優惠結果<strong>(非必填)</strong></summary>

獲取優惠結果的參數設定（取代先前的 seller=online 結果）。可設定為 `1`或 `true`。\
注意：`offers` 參數不可與 `offer_id` 參數同時使用。

**範例請求：**

使用參數 `product_id`: 4887235756540435899, `offers`: 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_product" \
 -d "product_id=4887235756540435899" \
 -d "json=1" \
 -d "offers=1"
```

</details>

<details>

<summary><code>specs</code> <strong>,</strong>取得規格結果<strong>(非必填)</strong></summary>

用於獲取規格結果的參數設定。可設定為 `1` 或 `true`。\
注意：`specs` 參數不可與 `offer_id` 參數同時使用。

**範例請求：**

使用參數 `product_id`: 4887235756540435899, `specs`: 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_product" \
 -d "product_id=4887235756540435899" \
 -d "json=1" \
 -d "specs=1"
```

</details>

<details>

<summary><code>reviews</code> <strong>,</strong>取得評論結果<strong>(非必填)</strong></summary>

用於獲取評論結果的參數設定。可設定為 `1` 或 `true`。\
請注意：`reviews` 參數不可與 `offer_id` 參數同時使用。

**範例請求：**

使用參數 `product_id:` 4887235756540435899, `reviews`: 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_product" \
 -d "product_id=4887235756540435899" \
 -d "json=1" \
 -d "reviews=1"
```

</details>

## 分頁

<details>

<summary><strong><code>start</code> ,</strong>結果位移量<strong>(非必填)</strong></summary>

此參數定義結果偏移量。它會跳過指定數量的結果。它用於分頁。 （例如，0（預設值）表示第一頁結果，10 表示第二頁結果，20 表示第三頁結果，以此類推。）

**範例請求：**

使用參數 `product_id`: 4887235756540435899, `start`: 30 的範例結果

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

</details>

<details>

<summary><code>page</code> <strong>,</strong>從頁面開始<strong>(非必填)</strong></summary>

此參數用於定義 Google 線上商家的頁面編號，每頁顯示 10 筆結果。此參數等同於 `start`（偏移量）= 頁碼 \* 10。\
注意：僅在啟用 offers 參數時可使用此功能。

**範例請求：**

使用參數 `product_id`: 4887235756540435899, `page`: 20 的範例結果

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

</details>

## 高級篩選

<details>

<summary><strong><code>filter</code> ,</strong>進階搜尋參數<strong>(非必填)</strong></summary>

此參數用於設定評論與優惠結果的篩選條件、排序方式及分頁設定。

優惠篩選條件：\
`freeship:1` 僅顯示免運費商品\
`ucond:1` 僅顯示二手商品\
`scoring:p` 依基礎價格排序\
`scoring:tp` 依總價排序\
`scoring:cpd` 依當前促銷優惠排序\
`scoring:mrd` 依賣家評分排序

**範例請求：**

使用參數 product\_id: 4887235756540435899, filter:ucond: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_product" \
 -d "product_id=4887235756540435899" \
 -d "filter=ucond:1" \
 -d "json=1"
```

</details>

<details>

<summary><strong><code>offer_id</code>,</strong>優惠ID<strong>(非必填)</strong></summary>

此參數用於定義從線上商家獲取多個優惠的ID，該ID可在 sellers\_results.online\_sellers 中找到。\
注意：`offer_id` 參數不可與 `offers`、`specifications` 及 `reviews` 參數同時使用。

**範例請求：**

使用參數 `product_id`: 4887235756540435899, offer\_id:detali 的範例結果

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

</details>

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