# Google Images

**ERP API 谷歌 Images 查詢參數**\
使用 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_images" \
 -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_images" \
 -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_images" \
 -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_images" \
 -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_images" \
 -d "q=pizza" \
 -d "json=1" \
 -d "cr=countryAI|countryAQ"
```

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

</details>

## 時間段

<details>

<summary><strong><code>period_unit</code> ，時間段（非必填）</strong></summary>

定義搜尋最近圖像的時間段單位，例如，從過去的分鐘、小時、日期等。 `s` - 秒 `n` - 分鐘 `h` - 小時 `d` - 天 `w` - 週 `m` - 月 `y` - 年 此參數不能與start\_date/end\_date參數一起使用。&#x20;

**示例請求：**

&#x20;查詢 `q` : pizza,`period_unit`:h的示例

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

</details>

<details>

<summary><strong><code>period_value</code>，時間段值（非必填）</strong></summary>

定義一個可選的時間段值，該值可與 `period_unit` 一起使用，以描述 `15 秒、42 小時、178 天`等時間段。

\
**示例請求：**

\
查詢 `q` : pizza,`period_value`:178 day 的示例

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

</details>

<details>

<summary><strong><code>start_date</code> ，開始日期（非必填）</strong></summary>

定義要將圖像搜索限制到的時間段的開始日期。 格式：YYYYMMDD，例如：20250801 此參數不能與 `period_unit/period_value` 參數一起使用。&#x20;

**示例請求：**&#x20;

查詢 `q` : pizza,`start_date`:20250801 的示例

<pre class="language-sh"><code class="lang-sh"><strong>curl -X POST https://scraperapi.thordata.com/request \
</strong> -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_images" \
 -d "q=pizza" \
 -d "json=1" \
 -d "start_date=20250801"
</code></pre>

</details>

<details>

<summary><strong><code>end_date</code> ，結束日期（非必填）</strong></summary>

定義要將圖像搜索限制到的時間段的開始日期。 格式：YYYYMMDD，例如：20250801 此參數不能與 `period_unit/period_value` 參數一起使用。&#x20;

**示例请求：**

**示例請求：**&#x20;

查詢 `q` : pizza,`end_date`:20250801 的示例

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

</details>

## 高级参数

<details>

<summary><strong><code>chips</code>，圖像搜索篩選器 （替代）（非必填）</strong></summary>

數用於篩選圖像搜索。

\
**示例請求：**

\
查詢 `q` : pizza`,ludocid`:size的示例

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

</details>

<details>

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

時間/類型篩選（支持複雜條件），比如 `tbs=qdr:d，qdr:d=24` 小時內的內容；再比如 `tbs=sur:f`，表示結果僅展示圖片。

\
**示例請求：**

\
查詢 `q` : pizza,`tbs`:sur:f 的示例

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

</details>

<details>

<summary><strong><code>imgar</code>，縱橫比過濾（非必填）</strong></summary>

參數定義圖像的設置縱橫比。\
選項：\
`s` - 方形\
`t` - 高\
`w` - 寬\
`xw` - 全景

\
**示例請求：**

\
查詢 `q` : pizza,`imgar`:s 的示例

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

</details>

<details>

<summary><strong><code>imgsz</code> ，圖像大小篩選（非必填）</strong></summary>

參數定義圖像的大小。\
選項：\
`l` - 大\
`m` - 中\
`i` - 圖示\
`qsvga` - 大於 400×300\
`vga` - 大於 640×480\
`svga` - 大於 800×600\
`xga` - 大於 1024×768\
`2mp` - 大於 2 MP\
`4mp` - 大於 4 MP\
`6mp` - 大於 6 MP\
`8mp` - 大於 8 MP\
`10mp` - 大於 10 MP\
`12mp` - 大於 12 MP\
`15mp` - 大於 15 MP\
`20mp` - 大於 20 MP\
`40mp` - 大於 40 MP\
`70mp` - 大於 70 MP

\
**示例請求：**

\
查詢 `q` : pizza,`imgsz`:qsvga 的示例

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

</details>

<details>

<summary><strong><code>image_color</code> ，圖像顔色過濾（非必填）</strong></summary>

參數定義圖像的類型。\
選項：\
`bw` - 黑白\
`trans` - 透明\
`red` - 紅色\
`orange` - 橙色\
`yellow` - 黃色\
`green` - 綠色\
`teal` - 青色\
`blue` - 藍色\
`purple` - 紫色\
`pink` - 粉色\
`white` - 白色\
`gray` - 灰色\
`black` - 黑色\
`brown` - 棕色

**示例請求：**

\
查詢 `q` : pizza,`imgcolor`:red 的示例

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

</details>

<details>

<summary><strong><code>image_type</code>，圖像類型篩選（非必填）</strong></summary>

參數定義圖像類型。\
選項：\
`face` - 人臉\
`photo` - 照片\
`clipart` - 剪貼畫\
`lineart` - 線條畫\
`animated` - 動畫

**示例請求：**

查詢 `q` : pizza,`imgtype`:face 的示例

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

</details>

<details>

<summary><strong><code>licenses</code> ，使用權限篩選（非必填）</strong></summary>

參數定義圖像的授權範圍。\
選項：\
`f` - 免費使用或分享\
`fc` - 免費使用或分享，甚至用於商業用途\
`fm` - 免費使用、分享或修改\
`fmc` - 免費使用、分享或修改，甚至用於商業用途\
`cl` - 創用CC授權\
`ol` - 商業及其他授權

**示例請求：**

\
查詢 `q` : pizza,`rights`:f 的示例

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

</details>

<details>

<summary><strong><code>safe</code> ，成人內容過濾（非必填）</strong></summary>

參數定義是否過濾成人內容。\
選項：\
`active` - 啟用安全搜尋（屏蔽成人內容）\
`off` - 關閉安全搜尋

示例請求：\
查詢 `q` : pizza`,safe`:active 的示例

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

</details>

<details>

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

**參數定義是否禁用自動糾正拼寫。**\
選項：\
`nfpr=1` - 禁用自動糾正（嚴格匹配關鍵字）\
`nfpr=0` - 啟用自動糾正（預設值）

**示例請求：**

\
查詢 `q : pizza,nfpr: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_images" \
 -d "q=pizza" \
 -d "json=1" \
 -d "nfpr=1"
```

</details>

<details>

<summary><strong><code>filter</code> ，結果篩選（非必填）</strong></summary>

**参数定义搜索结果去重功能**\
选项：\
`filter=1` - 启用去重（移除相似结果）\
`filter=0` - 禁用去重（显示所有结果）

**示例请求：**

\
查询 `q : pizza,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_images" \
 -d "q=pizza" \
 -d "json=1" \
 -d "filter=1"
```

</details>

## 分頁

<details>

<summary><code>ijn</code><strong>，頁碼（非必填）</strong></summary>

**参数定义分页偏移量（每页100张图片）**\
选项：\
`start=N` - 跳过前N张图片（N必须为100的倍数）\
\*等效关系：页码ijn对应的偏移量=ijn×100\*

**示例请求：**

\
查询 `q : pizza,start:100` 的示例

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

</details>

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