Skip to content

Bing 实时 SERP HTML

POST /v3/serp/bing/v2/live/html

接口概述

该接口用于实时获取指定在 Bing 搜索结果页中的原始 HTML。你可以基于、搜索地区、语言、设备等条件发起查询,接口将返回搜索结果页对应的 HTML 源码,适合用于页面结构分析、结果复核、SERP 页面存档等场景。

  • 请求方式:POST
  • 接口地址:https://api.seermartech.cn/v3/serp/bing/v2/live/html

说明:

  • 本接口为实时接口,请求后直接返回结果;
  • 每次调用支持提交 1 个任务;
  • POST 请求体为 JSON 数组 [{ ... }]
  • 速率上限:每分钟最多 2000 次调用;
  • 实扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

计费说明

该接口按请求计费。

如果返回的 SERP 深度不 10 条结果,通常按基础档计费;当 depth 大于 10,且搜索引擎返回了更多结果时,可能产生额外费用。

参考价约 ¥0.0480 / 次 扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

请求参数

主要参数

字段名类型说明
keywordstring。最长支持 700 个字符。字段中的 %## 会被解码,字符 + 会被解码为空格。如果中需要保留 %,请写为 %25;如果需要保留 +,请写为 %2B
location_codeinteger搜索地区代码。当未指定 location_namelocation_coordinate。如果已使用该字段,则无需再传 location_namelocation_coordinate。可通过 /v3/serp/wp/locations 获取可用地区代码。例如:2840
language_codestring搜索语言代码。当未指定 language_name。如果已使用该字段,则无需再传 language_name。可通过 /v3/serp/wp/languages 获取可用语言代码。例如:en
depthinteger解析深度,可选。表示需要返回的 SERP 结果数量。默认值:10;最大值:200。当深度 10 时,若搜索引擎返回了更多结果,可能产生额外费用。
devicestring设备类型,可选。可选值:desktopmobile。默认值:desktop

附加参数

字段名类型说明
location_namestring搜索地区完整名称。当未指定 location_codelocation_coordinate。如果已使用该字段,则无需再传 location_codelocation_coordinate。可通过 /v3/serp/wp/locations 获取可用地区名称。例如:London,England,United Kingdom
language_namestring搜索语言完整名称。当未指定 language_code。如果已使用该字段,则无需再传 language_code。可通过 /v3/serp/wp/languages 获取可用语言名称。例如:English
osstring设备操作系统,可选。若 device=desktop,可选 windowsmacos,默认 windows;若 device=mobile,可选 androidios,默认 android
tagstring自定义任务标识,可选。最长 255 个字符。便于在响应中将结果与业务任务对应。设置后,可在响应的 data 对象中看到该值。
stop_crawl_on_matcharray命中目标即停止抓取的条件数组,可选。最多可传 10 个目标对象。若设置,接口将在返回结果中直到命中 match_value 为止的所有 SERP 结果。按抓取到满足条件前的页面计费。
match_typestring目标匹类型。在设置 stop_crawl_on_match 时填。可选值:domain(指定域名/子域名)、with_subdomains(主域名及子域名)、wildcard(通符模式)。
match_valuestring目标域名、子域名或通符值。在设置 stop_crawl_on_match 时填。注意:域名或子域名不要带请求协议。例如:"example.com""/blog/post-*"
max_crawl_pagesinteger抓取页数上限,可选。默认值:1,最大值:100。该参数与 depth合使用,用于控制最多抓取多少页搜索结果。
search_paramstring搜索附加参数,可选。用于透传搜索引擎查询参数。
urlstring直接指定搜索 URL,可选。接口会尝试从 URL 中解析出所需字段。但这种方式对 URL 的语言和地区参数要求较高,处理也更复杂,通常不建议优使用。示例:https://www.bing.com/search?q=rank%20checker&count=50&first=1&setlang=en&cc=US&safesearch=Moderate&FORM=SEPAGE
location_coordinatestring地理坐标,可选。当未指定 location_namelocation_code。格式为 "latitude,longitude",经纬度最多支持 7 位小数。例如:53.476225,-2.243572

stop_crawl_on_match 对象结构

字段名类型说明
match_typestring匹类型。可选:domainwith_subdomainswildcard
match_valuestring匹目标值,支持域名、子域名或通符表达式

响应结构

接口返回 JSON 数据,顶层 tasks 数组。

顶层字段

字段名类型说明
versionstring当前 API 版本
status_codeinteger通用状态码,完整错误码可参考 /v3/appendix/errors
status_messagestring通用状态信息
timestring执行耗时,单位秒
costfloat本次请求总费用,单位 USD
tasks_countintegertasks 数组中的任务数量
tasks_errorinteger返回错误的任务数量
tasksarray任务结果数组

tasks 数组中的字段

字段名类型说明
idstring任务唯一标识,UUID 格式
status_codeinteger任务状态码,通常在 10000-60000 范围
status_messagestring任务状态描述
timestring任务执行耗时,单位秒
costfloat该任务费用,单位 USD
result_countintegerresult 数组中的结果数
patharray请求路径
dataobject与请求体中提交参数一致的对象
resultarray获取结果数组

result 数组中的字段

字段名类型说明
keywordstring请求中的。返回时 %## 会被解码,+ 会被解码为空格
typestring请求中的搜索引擎类型
se_domainstring请求中的搜索引擎域名
location_codeinteger请求中的地区代码
language_codestring请求中的语言代码
datetimestring结果获取时间,UTC 格式,示例:2019-11-15 12:57:46 +00:00
items_countintegeritems 数组中的结果数量
itemsarraySERP 结果项数组
pageinteger返回的 HTML 页码序号
datestringHTML 页面抓取时间,格式示例:2019-11-15 12:57:46 +00:00
htmlstring搜索结果页原始 HTML

请求示例

cURL

bash
curl --location --request POST "https://api.seermartech.cn/v3/serp/bing/v2/live/html" \
--header "Authorization: Bearer smt_live_YOUR_KEY" \
--header "Content-Type: application/json" \
--data-raw '[
 {
 "language_code": "en",
 "location_code": 2840,
 "keyword": "albert einstein"
 }
]'

Python

python
import requests

url = "https://api.seermartech.cn/v3/serp/bing/v2/live/html"
headers = {
 "Authorization": "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json"
}
data = [
 {
 "language_code": "en",
 "location_code": 2840,
 "keyword": "albert einstein"
 }
]

response = requests.post(url, headers=headers, json=data)
print(response.json)

TypeScript

typescript
import axios from "axios";

async function fetchBingSerpHtml {
 const response = await axios.post(
 "https://api.seermartech.cn/v3/serp/bing/v2/live/html",
 [
 {
 language_code: "en",
 location_code: 2840,
 keyword: "albert einstein",
 },
 ],
 {
 headers: {
 Authorization: "Bearer smt_live_YOUR_KEY",
 "Content-Type": "application/json",
 },
 }
 );

 console.log(response.data);
}

fetchBingSerpHtml;

响应示例

json
{
 "version": "0.1.20200203",
 "status_code": 20000,
 "status_message": "Ok.",
 "time": "4.7397 sec.",
 "cost": 0.003,
 "tasks_count": 1,
 "tasks_error": 0,
 "tasks": [
 {
 "data": {
 "api": "serp",
 "function": "live",
 "se": "bing",
 "se_type": "v2",
 "language_code": "en",
 "location_code": "2840",
 "keyword": "albert einstein",
 "tag": "tag1",
 "device": "desktop",
 "os": "windows"
 },
 "result": [
 {
 }
 ]
 }
 ]
}

错误处理

建议对以下两层状态进行处理:

  1. 顶层状态:检查 status_codestatus_message,判断整个请求是否成功;
  2. 任务级状态:遍历 tasks 数组,检查每个任务的 status_codestatus_message

完整错误码与状态说明可参考:/v3/appendix/errors

常见处理建议:

  • status_code 非成功状态时,记录原始响应并重试或告警;
  • 当任务级别返回错误时对失败任务做补偿处理;
  • costtimetasks_error 建议纳监控,便于控制成本和稳定性;
  • 如果使用 stop_crawl_on_match 或较大的 depth / max_crawl_pages,应特别消耗。

使用说明

  • 若只需要获取页面 HTML,使用该接口即可;
  • 若你更结构化搜索结果,应考虑使用对应的结构化 SERP 接口;
  • url 方式虽然可用,但更推荐直接传 keywordlocation_codelanguage_code 等标准字段;
  • depthmax_crawl_pages 决定抓取范围,建议按需求控制,不的成本增长。

实用场景

  • 抓取搜索结果页原始源码:获取 Bing SERP 的完整 HTML,用于前端结构分析、样式变化监测和页面归档。
  • 复核排名采集结果:结合结构化排名数据,对指定的真实展示页面进行人工或程序化复核,提升 SEO 监测准确性。
  • 监控 SERP 页面改版:定期保存同一在不同地区或设备下的 HTML,及时发现搜索结果模块布局变化。
  • 定位品牌或竞品:合 stop_crawl_on_match,在搜索结果中命中目标域名后停止抓取,降低成本并快速确认位置。
  • 分析多设备差异:分别以 desktopmobile 请求同一,比较不同终端下的 Bing 结果页 HTML 结构差异。

统一入口:官网 · LLM API · 控制台