# Bing搜索API

**SERP API Bing查詢參數**

使用Thordata的SERP API配置Bing搜索查詢，包括本土化、地理位置和分頁等參數選項。

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

</details>

## 本土化

<details>

<summary><strong><code>cc</code> ，國家(非必填)</strong></summary>

此參數用於設定搜尋結果的地區化顯示（採用兩位字母國家代碼），例如：（`gl=us`：依美國用戶習慣顯示、`gl=ru`：依俄羅斯用戶習慣顯示`gl=uk`：依英國用戶習慣顯示）

**示例請求：**

查询 `q` : <mark style="color:blue;">pizza</mark>,`cc`:<mark style="color:blue;">jp</mark>的示例結果

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

</details>

## 地理位置

<details>

<summary><strong><code>mkt</code> ，語言(非必填)</strong></summary>

此參數用於設定搜尋結果的介面顯示語言，採用標準語言代碼格式：

<語言代碼>-<國家代碼>（例如：`en-US`、`zh-TW`）

**示例請求：**

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

<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=bing" \
 -d "q=pizza" \
 -d "json=1" \
 -d "mkt=fr-fr"
</code></pre>

</details>

<details>

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

該參數定義了爬取時的起始地理位置，應與 `lat`（緯度）和 `lon`（經度）參數一起使用。

**示例請求：**

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

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=bing" \
 -d "q=pizza" \
 -d "json=1" \
 -d "location=Tokyo%2CJapan" \
 -d "uule=w+CAIQICILVG9reW8sSmFwYW4"
```

</details>

<details>

<summary><strong><code>lat</code>，緯度(非必填)</strong></summary>

此參數用於設定搜尋起始位置的 GPS 緯度座標，需配合以下參數共同使用：

* `location`：地理位置描述
* `lon`：經度座標（注意：原說明誤植為 lat）

**示例請求：**

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

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

</details>

<details>

<summary><strong><code>lon</code> ，經度(非必填)</strong></summary>

此參數用於設定資料擷取的起始位置 GPS 經度，需搭配下列參數共同使用：

* `location`：地理位置文字描述
* `lat`：緯度座標（修正說明：原內容誤將緯度參數標示為 lon）

**示例請求：**

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

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

</details>

## 分頁

<details>

<summary><strong><code>first</code> ，結果偏移量(非必填)</strong></summary>

參數用於控制自然搜索結果的偏移量，默認值為1（例如：first=10時，系統會將第10條自然搜索結果提升至首位）。

**示例請求：**

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

</details>

<details>

<summary><strong><code>count</code> ，每頁結果數(非必填)</strong></summary>

每頁參數用於控制每頁顯示的搜索結果數量（最小值：1，最大值：50），實際生效值會受到first偏移量參數的影響。

**示例請求：**

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

</details>

## 高級篩選

<details>

<summary><strong><code>adlt</code> ，安全(非必填)</strong></summary>

此參數用於控制搜尋結果的成人內容過濾設定，可指定下列值：

* `strict`：嚴格過濾成人內容
* `off`：完全停用過濾功能

**示例請求：**

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

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

</details>

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