Yandex

SERP API Yandex查询参数

使用 Thordata的 SERP API 配置Yandex搜索查询,包括本土化、地理位置和分页等参数输出选项。

q ,搜索查询(必填)

定义用于数据抓取的搜索查询(默认值:q=pizza)。支持任何语言的任意关键词。

示例请求:

使用qpizza参数的示例

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer Token" -d "{\"url\": \"https://yandex.com/search?text=pizza^&json=1\"}"

本土化

url ,域名(非必填)

该参数定义了爬取时使用的域名,默认值为 yandex.com

示例请求:

查询 q : pizza,url:yandex.com.tr的示例结果

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer Token" -d "{\"url\": \"https://yandex.com.tr/search?text=pizza^&json=1\"}"
lang ,语言(非必填)

该参数定义了爬取时搜索结果使用的语言,默认值为 en 。它是一个由两个字母组成的语言代码(例如,en, ru, es)。

详情列表: Yandex Language Codes

示例请求:

查询 q : pizza,lang:en的示例结果

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer Token" -d "{\"url\": \"https://yandex.com/search?text=pizza^&json=1^&lang=en\"}"

地理位置

lr ,位置(非必填)

指定搜索结果的地区(如 lr=Moscow,Russia 仅显示Moscow结果),优先级高于IP定位。

示例请求:

查询 q : pizza,lr:India的示例结果

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer Token" -d "{\"url\": \"https://yandex.com/search?text=pizza^&json=1^&lr=India\"}"
rstr ,位置严格检查(非必填)

双重过滤——强制结果匹配指定地区(lr)或启用安全搜索(如 rstr=family 屏蔽成人内容)。

示例请求:

查询 q : pizza,rstr:true的示例结果

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer Token" -d "{\"url\": \"https://yandex.com/search?text=pizza^&json=1^&rstr=true\"}"

分页

p ,页码(非必填)

分页控制(从 p=0 开始),需配合每页条数参数使用。 示例:p=2,获取第3页的结果。

示例请求:

查询 q : pizza,p:2的示例结果

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer Token" -d "{\"url\": \"https://yandex.com/search?text=pizza^&json=1^&p=2\"}"
within ,时间周期(非必填)

时间/域限制:

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

示例请求:

查询 q : pizza,within:2的示例结果

curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer Token" -d "{\"url\": \"https://yandex.com/search?text=pizza^&json=1^&within=2\"}"

如果您需要更多帮助,请通过邮箱[email protected]联系我们。

Last updated

Was this helpful?