SERP API Bing查询参数
使用 Thordata的 SERP API 配置Bing搜索查询,包括本土化、地理位置和分页等参数输出选项。
q,必填,
该参数定义了爬取时的搜索结果,默认值为q= pizza
。您可以输入任意您想要查询的关键词,也可以是任意语言。
代码示例:
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxxx" -d "{\"url\": \"https://www.bing.com/search?q=pizza^&json=1\"}"
本地化
cc,自选
该参数定义了爬取时可以指定搜索结果按照国家/地区用户的习惯展示。
影响搜索结果的语言、排序和本地化条目(如cc=jp
优先显示日语结果)
示例:
cc=us
→ 美国(英语)
cc=ru
→ 俄罗斯(俄语)
cc=fr
→ 法国(法语)
示例请求:
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxx" -d "{"url": "https://www.bing.com/search?q=pizza^&json=1^&cc=jp"}"
mkt,自选
该参数用于指定搜索结果的界面语言和区域格式,采用 语言代码-国家/地区代码 格式(如 en-CA
),不区分大小写。
示例:
mkt=en-US
→ 英语(美国)
mkt=fr-CA
→ 法语(加拿大)
mkt=zh-CN
→ 中文(简体)
与 cc/gl
的关联
,mkt
优先控制界面语言,cc/gl
侧重内容地域化
建议组合使用(如 mkt=es-AR&cc=ar
获取阿根廷西语结果)
示例请求:
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxx" -d "{"url": "https://www.bing.com/search?q=pizza^&json=1^&mkt=en-ca"}"
地理位置
location,自选
该参数用于指定搜索请求的起始地理位置,需与 lat
(纬度)和 lon
(经度)参数配合使用,以模拟真实用户的本地化搜索行为。若未指定,Bing 可能自动分配默认位置(如 serpStarted.591)。
Bing 优先使用 location城市级粒度效果最佳(如 location=Tokyo
比 location=Japan
更精准)
示例请求:
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer ab4a6ab147570ba7c5ea6f59990a458a" -d "{"url": "https://www.bing.com/search?q=pizza^&json=1^&location=India^&uule=w+CAIQICIFSW5kaWE"}"
lat,自选
指定搜索请求的 GPS 纬度坐标,用于精准定位搜索结果的本地化内容(如商家、服务、新闻等)。
注意:
必须与 lon
(经度)搭配使用,单独使用无效
建议配合 location
参数(城市/地区名称),提升结果可读性
精度要求:
有效范围:-90.0(南极) 至 90.0(北极)
建议保留 4位小数(如 40.7128 纽约)
示例请求:
url https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxx" -d "{"url": "https://www.bing.com/search?q=pizza^&json=1^&lat=30"}"
lon,自选
指定搜索请求的 GPS 经度坐标,与 lat
(纬度)共同构成精准定位,用于获取本地化搜索结果(如商家、服务、新闻等)。
注意:
必须与 lat
(纬度)搭配使用,单独使用无效
建议配合 location
参数(城市/地区名称),提升结果可读性
精度要求:
有效范围:-180.0(西经)至 180.0(东经)
建议保留 4位小数(如 -74.0060 纽约)
示例请求:
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxx" -d "{"url": "https://www.bing.com/search?q=pizza^&json=1^&lon=32"}"
分页
first,自选
控制自然搜索结果的 偏移量,用于调整搜索结果的起始位置(类似分页功能)。示例请求:示例请求:
偏移量控制:默认值:1(从第1条结果开始显示)
设置 first=10
时,第10条结果将变为首条显示,后续结果依次顺延
代码示例:
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxx" -d "{\"url\": \"https://www.bing.com/search?q=pizza^&json=1^&first=10\"}"
count,自选
控制每页显示的 自然搜索结果数量(建议值),需配合 first 参数实现分页效果。
取值范围:最小值:1
,最大值:50
(超过自动截断)
需搭配 first 使用(如 first=11&count=10
获取第2页)
示例请求:
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxx" -d "{"url": "https://www.bing.com/search?q=pizza^&json=1^&count=10"}"
adlt,自选
控制搜索结果的 成人内容过滤级别,用于屏蔽或允许敏感内容显示。
可选值:
strict
→ 严格过滤(默认值,屏蔽成人内容)
off
→ 关闭过滤(允许显示成人内容)
代码示例:
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxxxxxxxxxx" -d "{\"url\": \"https://www.bing.com/search?q=pizza^&json=1^&adlt=strict\"}"
如果您需要更多帮助,请通过邮箱support@thordata.com联系我们。