跳到正文
更新日志改进

Bing 搜索单次请求最多返回 10 页结果

API
在 POST /v1/serp/bing/search 中以 pages 2、device mobile、state IL 搜索 heat pump installers 的请求及其第 1、2 页结果,旁边是 device 的取值 desktop、mobile、ios、tablet、ipad,以及芝加哥的 location 地点

一次请求读取最多 10 页 Bing 搜索结果,并可按手机或平板、美国某个州或精确坐标进行搜索。

更新内容

  • pages 让一个任务从 page 起读取 1 到 10 页结果。organicResults 按排名包含所有页面的结果,每个结果带有所在页码 page。
  • device 以 mobile、android、ios、tablet 或 ipad 搜索,返回手机或平板看到的页面和排名。默认仍为 desktop。
  • state 从美国某个州搜索,location 从精确坐标搜索。Bing 会返回针对该地点的搜索结果和地图结果,响应中原样带回你发送的 state 或 location。
  • include.rawHtml 返回 Bing 发送的原始 HTML 的链接,使用 pages 时每页一个,不额外收费。

工作原理

一个浏览器会话打开第 1 页,再沿着 Bing 自己的下一页链接继续,所以所有页面都来自同一次搜索。Bing 在后面页面重复的结果只返回一次。Bing 的结果在请求的页数之前结束时,任务就此停止,response.pages 显示实际读取的页数,未读取页面的积分会退还。

/v1/serp/bing/search 最多等待 290 秒并以 200 返回结果,届时仍在运行的任务返回 202。也可以把相同字段放进 payload,以 taskType BING_SEARCH 发送到 POST /v1/async/task。

应用场景

  • 在第 1 页之外追踪你的页面在 Bing 的排名:把 pages 设为最多 10,在 organicResults 中查找你的域名的 position。
  • 比较同一城市不同区域的结果:用市中心和郊区的 location 发送同一搜索词,对比 organicResults 和 map。
  • 把移动端排名与桌面端对比:用 device mobile 和 desktop 发送同一搜索词,对照同一链接的排名。

发送请求

在 Authorization 请求头中带上 API 密钥发送请求。

curl -X POST https://api.querying.ai/v1/serp/bing/search \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "heat pump installers",
    "country": "US",
    "pages": 2,
    "device": "mobile",
    "state": "IL"
  }'

请求字段

querystring必填
搜索词,最多 4,000 个字符。
countrystring
要搜索的市场,两位国家代码。默认 US。
pageinteger
起始结果页,1 到 10,默认 1。
pagesinteger
从 page 起读取的结果页数,1 到 10,默认 1。不能与 include.rawResponse 同时使用。
devicestring
desktop(默认)、mobile 或 android(Android 上的 Chrome)、ios(iPhone Safari)、tablet(Android 平板 Chrome)或 ipad(iPad Safari)。
statestring
美国州的两位代码,例如 IL,需配合 country US。从该州最大的城市搜索。加收 1 积分,不能与 location 同时使用。
locationobject
以十进制度数填写的精确地点,例如 {"latitude": 41.8781, "longitude": -87.6298}。Bing 会返回针对该地点的搜索结果和地图结果。加收 1 积分,不能与 state 同时使用。
include.rawHtmlboolean
设为 true 会附带 rawHtml:Bing 发送的原始 HTML 的链接。pages 大于 1 时,每页的 HTML 在 pageResults[].rawHtml 中。不额外收费。

响应

响应如下,已截取部分内容。

JSON
{
  "success": true,
  "task": {
    "id": "…",
    "taskType": "BING_SEARCH",
    "status": "COMPLETED",
    "createdAt": "…"
  },
  "credits": { "creditsToCharge": 3, "creditsCharged": 3 },
  "response": {
    "surface": "bing_search",
    "page": 1,
    "pages": 2,
    "state": "IL",
    "organicResults": [
      {
        "position": 1,
        "title": "TOP 10 BEST Heat Pump Installation in Chicago, IL - (2026 Guide ... - Yelp",
        "link": "https://www.yelp.com/search?find_desc=heat+pump+installation&find_loc=Chicago%2C+IL",
        "page": 1
      },
      {
        "position": 2,
        "title": "TOP 10 BEST Heat Pump Installations in Chicago, IL - (2026 Guide ... - Yelp",
        "link": "https://www.yelp.com/search?find_desc=heat+pump+installations&find_loc=Chicago%2C+IL",
        "page": 1
      },
      {
        "position": 3,
        "title": "Heat Pump Installation Chicago, IL - alltemp.com",
        "link": "https://alltemp.com/chicago-il/chicago-hvac-services/heat-pump-installation-chicago-il/",
        "page": 1
      },
      {
        "position": 4,
        "title": "Find the Right Installer for Your Project - ENERGY STAR",
        "link": "https://www.energystar.gov/products/installer-finder",
        "page": 2
      },
      "…"
    ],
    "ads": ["…"],
    "map": ["…"],
    "relatedSearches": ["…"]
  }
}
response.organicResultsarray
读取的所有页面上的自然结果,按排名排列且去重:position、title、link、displayedLink、snippet,以及该结果所在的页码 page。
response.pagesinteger
实际读取的页数。Bing 的结果提前结束时会少于请求的数量。response.page 是读取的第一页。
response.statestring
你发送的 state。发送 location 的请求会以同样方式返回 response.location。
response.pageResultsarray
开启 include.rawHtml 且 pages 大于 1 时,每读取一页对应一项,含 page、该页的 rawHtml,以及该页显示的广告、相关搜索和模块。

价格

每读取一页结果 1 积分,使用 state 或 location 时每个任务加收 1 积分。上面的请求从伊利诺伊州读取 2 页,共 3 积分。Bing 的结果提前结束时,未读取页面的积分会退还。include.rawHtml 免费。套餐与积分:https://querying.ai/pricing

更多更新

接收最新消息

通过邮件接收产品更新。

RSS 订阅