# Google Shopping

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

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

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

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

</details>

## 分页

<details>

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

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

**示例请求：**

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

</details>

<details>

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

该参数定义了搜索结果每页返回的最大数。例如：10是返回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_shopping" \
 -d "q=pizza" \
 -d "json=1" \
 -d "num=20"
```

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

</details>

<details>

<summary><code>shoprs</code> <strong>，过滤器 ID（非必填）</strong></summary>

该参数定义用于设置搜索筛选器的帮助程序 ID。若要正确应用搜索筛选器，必须将该参数与更新的 `q` 参数结合使用，该参数现在包含在原始查询旁边应用的筛选器的名称。

**示例请求：**

查询 `q` : <mark style="color:blue;">pizza</mark>,`shoprs`:<mark style="color:$primary;">shoprs\_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_shopping" \
 -d "q=pizza" \
 -d "json=1" \
 -d "shoprs=shoprs_1"
```

</details>

<details>

<summary><code>min_price</code> <strong>，最低价格（非必填）</strong></summary>

价格区间查询的下限。此参数会覆盖嵌入到 `shoprs` 参数中的相应过滤器。

**示例请求：**

查询 `q` : <mark style="color:blue;">pizza</mark>,`min_price`:<mark style="color:blue;">10</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_shopping" \
 -d "q=pizza" \
 -d "json=1" \
 -d "min_price=10"
```

</details>

<details>

<summary><code>max_price</code> <strong>，最高价格（非必填）</strong></summary>

价格区间查询的上限。此参数会覆盖嵌入到 `shoprs` 参数中的相应过滤器。

**示例请求：**

查询  `q` : <mark style="color:blue;">pizza</mark>,`max_price`:<mark style="color:blue;">100</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_shopping" \
 -d "q=pizza" \
 -d "json=1" \
 -d "min_price=10" \
 -d "max_price=100"
```

</details>

<details>

<summary><code>sort_by</code><strong>，排序依据（非必填）</strong></summary>

参数定义结果的排序顺序。

可用选项：

`1` - 价格：从低到高

`2` - 价格：从高到低

**示例请求：**

查询 `q` : <mark style="color:blue;">pizza</mark>,`sort_by`: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_shopping" \
 -d "q=pizza" \
 -d "json=1" \
 -d "sort_by=1"
```

</details>

<details>

<summary><code>free_shipping</code><strong>，免费送货（非必填）</strong></summary>

仅显示免费送货的商品。

**示例请求：**

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

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

</details>

<details>

<summary><code>on_sale</code><strong>，特价中（非必填）</strong></summary>

仅显示正在促销的商品。

**示例请求：**

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

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

</details>

<details>

<summary><code>small_business</code><strong>，小型企业（非必填）</strong></summary>

仅显示小型企业的产品。

**示例请求：**

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

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

</details>

<details>

<summary><code>direct_link</code><strong>，包括直接链接（非必填）</strong></summary>

此参数确定搜索结果是否应包含每个产品的直接链接。默认情况下，它为 `false`，如果您需要直接链接，请将其设置为 `true`。

**示例请求：**

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

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

</details>

如果您需要更多帮助，请通过邮&#x7BB1;**<support@thordata.com>**&#x8054;系我们。


---

# 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-shopping.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.
