> For the complete documentation index, see [llms.txt](https://doc.thordata.com/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.thordata.com/doc/zh/pa-qu/serp-api/cha-xun-can-shu/yandex.md).

# 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>参数的示例

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

</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` 仅显示`Moscow`结果），优先级高于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><strong><code>within</code> ，时间周期(非必填)</strong></summary>

时间/域限制:

时间范围:within=7天(过去7天)

**示例请求：**

查询 `q` : <mark style="color:blue;">pizza</mark>,`within`:<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 "within=2"
```

</details>

如果您需要更多帮助，请通过邮箱<support@thordata.com>联系我们。
