# Yandex

**SERP API Yandex查詢參數**

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

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

</details>

## 本土化

<details>

<summary><code>yandex_domain</code> <strong>，域名(非必填)</strong></summary>

該參數定義了爬取時使用的域名，預設值為 `yandex.com`

**示例請求：**

查询 `q` : <mark style="color:blue;">pizza</mark>,`url`:<mark style="color:blue;">yandex.com.tr</mark>的示例結果

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

</details>

<details>

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

該參數定義了爬取時搜索結果使用的語言，預設值為 **`en`**。它是一個由兩個字母組成的語言代碼（例如：`en`、`ru`、`es`）。

詳情列表: [Yandex Language Codes](https://yandex.com/support/search/query-language.html)

**示例請求：**

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

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

</details>

## 地理位置

<details>

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

該參數用於指定搜索結果的地區範圍（例如 `lr=Moscow,Russia` 將僅顯示莫斯科地區的結果），其優先級高於 IP 定位。

**示例請求：**

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

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

</details>

<details>

<summary><strong><code>rstr</code> ，位置嚴格檢查(非必填)</strong></summary>

直接雙重過濾——強制結果匹配指定地區（`lr`）或啟用安全搜索（如 `rstr=family` 屏蔽成人內容）。

**示例請求：**

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

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

</details>

## 分頁

<details>

<summary><strong><code>p</code> ，頁碼（非必填)</strong></summary>

分頁控制（從 `p=0` 開始），需配合每頁條數參數使用。\
範例：`p=2`，獲取第3頁的結果。

**示例請求：**

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

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

</details>

## 高級參數

<details>

<summary><code>within</code><strong>，時間周期 （非必填)</strong></summary>

指定搜索結果的地區（如 `within`=example.com 僅顯示`within`=7d結果），優先級高於7定位。

**示例請求：**

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

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

</details>

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