# Google Lens

**SERP API Google 查詢參數**

使用 Thordata 的 SERP API 配置 Google 搜索查詢，包括本地化參數、搜索類型以及進階參數輸出選項。

<details>

<summary><code>url</code> <strong>,</strong>圖片URL<strong>(必填)</strong></summary>

參數定義用於執行 Google Lens 搜尋的圖片 URL。\
<https://i.imgur.com/HBrB8p0.png>

**範例請求：**

使用參數 url 的範例：`https://i.imgur.com/HBrB8p0.png`

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_lens" \
 -d "url=https://i.imgur.com/HBrB8p0.png" \
 -d "json=1"
```

</details>

## 本地化

<details>

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

指定搜尋結果的目標國家/地區（預設值：us）。請使用兩位字母的國家代碼（例如：us、ru、uk）。\
完整支援的國家代碼清單，請參閱：[Google 國家代碼列表](https://developers.google.com/adwords/api/docs/appendix/geotargeting)。

範例請求：

針對參數 q : pizza、country: 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_lens" \
 -d "url=https://i.imgur.com/HBrB8p0.png" \
 -d "gl=ru" \
 -d "json=1"
```

</details>

<details>

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

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

**範例請求：**

針對參數 `url`: <https://i.imgur.com/HBrB8p0.png、`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_lens" \
 -d "url=https://i.imgur.com/HBrB8p0.png" \
 -d "json=1" \
 -d "hl=es"
```

</details>

## 搜尋類型

<details>

<summary><code>type</code> <strong>,</strong>搜尋類型<strong>(非必填)</strong></summary>

此參數用於定義要執行的搜尋類型，預設搜尋類型為`all`（全部）。

可用選項：\
`all` - 全部\
`products` - 商品\
`exact_matches` - 完全匹配\
`visual_matches` - 視覺匹配

**範例請求：**

針對參數 url: <https://i.imgur.com/HBrB8p0.png>, type: products 的範例結果

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_lens" \
 -d "url=https://i.imgur.com/HBrB8p0.png" \
 -d "json=1" \
 -d "type=products"
```

</details>

## 高級參數

<details>

<summary><code>q</code> <strong>,</strong>搜尋查詢<strong>(非必填)</strong></summary>

此參數用於定義 Google Lens 搜尋所使用的查詢詞，僅在類型設定為 `all`（全部）、`products`（商品）或 `visual_matches`（視覺匹配）時適用。

**範例請求：**

針對參數 `url`: <https://i.imgur.com/HBrB8p0.png>, `q`: acting 的範例結果

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_lens" \
 -d "url=https://i.imgur.com/HBrB8p0.png" \
 -d "json=1" \
 -d "q=acting" \
 -d "type=all"
```

</details>

<details>

<summary><strong><code>safe</code> ,</strong>成人內容過濾<strong>(非必填)</strong></summary>

成人內容篩選設定：\
`safe=active` – 嚴格篩選（預設值）\
`safe=off` – 不進行篩選

**範例請求：**

針對參數 `url`: <https://i.imgur.com/HBrB8p0.png>, `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" \
 -d "q=pizza" \
 -d "json=1" \
 -d "safe=active"
```

</details>

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