> ## Documentation Index
> Fetch the complete documentation index at: https://docs.querying.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 百度 AI 搜索 Baidu AI Search API：百度搜索结果顶部的 AI 回答

> 从中国大陆搜索百度，获取结果顶部的 AI 回答及其引用的网页，以及结果页的其余内容。

`BAIDU_AI_SEARCH` 搜索百度（baidu.com），返回结果页顶部的 AI 回答卡片（百度AI+）和回答引用的网页，以及同一页面上的搜索结果、广告、相关搜索、资讯、视频、商品、图片、地点和百度的其他卡片。不使用任何账号或登录。

| | |
| - | - |
| taskType | `BAIDU_AI_SEARCH` |
| 读取 | `query`（回退到 `prompt`） |
| 积分 | 1.25 |
| 国家 | **忽略。** 每个任务都从中国大陆搜索。 |

## 请求

每个任务都从中国大陆出口读取结果页，`country` 不会改变这一点，可以省略。

```bash theme={"theme":"css-variables"}
curl -X POST https://api.querying.ai/v1/async/task \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "taskType": "BAIDU_AI_SEARCH", "payload": { "query": "降噪耳机哪个牌子好" } }'
```

## 响应

| 字段 | 类型 | 说明 |
| - | - | - |
| `card` | string 或 null | 百度显示的 AI 卡片：`general` 或 `health`（百度健康）。结果页没有 AI 回答时为 `null`。 |
| `text` | string | 回答。`card` 为 `null` 时为空。 |
| `markdown` | string | Markdown 格式的回答，`[2]` 这类引用编号与 `sources` 对应。无需任何标志即返回。 |
| `sources` | array | 回答引用的网页：`position`、`url`、`label`、`source`（网站名），百度提供时还有 `publishedAt`。健康卡片没有。 |
| `reviewedBy` | string | 健康卡片上百度注明的审阅者。 |
| `searchQueries` | array | 页面加载后才生成的回答中，百度执行的搜索词。 |
| `organicResults` | array | 各自指向一个网页的搜索结果，按页面顺序：`position`、`title`、`link`、`snippet`、`date`、`source`（百度标注的网站或作者）、`page`。百度百科、贴吧、文库、爱企查条目也计入。 |
| `ads` | array | 广告：`position`、`title`、`link`（落地页）、`displayedLink`、`description`、`blockPosition`（在结果上方为 `top`，下方为 `bottom`）。 |
| `relatedSearches` | array | 大家还在搜和相关搜索，去重后返回：`query`、`link`。 |
| `contentResults` | array | 资讯、视频和精选笔记条目，按页面顺序：`position`、`type`（`news`、`video`、`note`）、`title`、`link`、`snippet`、`source`、`date`、`thumbnail`。 |
| `shoppingResults` | array | 商品卡片中的商品：`position`、`title`、`link`（店铺页面）、`price`（元）、`mallName`、`sales`、`thumbnail`。 |
| `images` | array | 百度图片网格：`position`、`link`（百度图片页面）、`image`、`thumbnail`、`width`、`height`。 |
| `map` | array | 百度地图卡片中的地点：`position`、`name`、`placeId`、`location.address`、`phoneNumber`、`category`、`openState`、`reviews`、`mapsUrl`、`image`。列表卡片显示搜索所在城市的地点，城市随任务变化。 |
| `otherCards` | array | 页面上的其余所有卡片，如品牌、人物、药品面板、行情和天气：`position`、`type`（百度的模板名）、`column`（`main` 或 `right`）、`title`、`link`、`text`（卡片显示的内容）。 |
| `rawResponse` | object | 卡片的原始数据；页面加载后生成的回答还包含流事件。仅在 `include.rawResponse` 时返回。 |

每个任务无论有无 AI 卡片都会返回结果页，结果页字段在页面出现相应模块时返回。同一查询在不同请求中会出现不同的 AI 卡片，没有卡片的查询以 `card: null` 完成。页面加载后才生成的回答也和其他卡片一样，附带引用来源和百度执行的搜索词返回。

示例：

```json theme={"theme":"css-variables"}
{
  "card": "general",
  "text": "索尼、Bose、苹果是降噪耳机第一梯队品牌 ...",
  "markdown": "**索尼、Bose、苹果是降噪耳机第一梯队品牌** ... [1][2]",
  "sources": [{ "position": 1, "url": "https://baijiahao.baidu.com/s?id=1879822093449478141", "label": "最值得买的十款降噪蓝牙耳机推荐", "source": "Geeks小树" }],
  "organicResults": [{ "position": 1, "title": "降噪耳机哪个牌子好?深度解析这6款口碑佳、音质优的热门型号", "link": "https://baijiahao.baidu.com/s?id=1879807124356797809&wfr=spider&for=pc", "date": "2026年10月23日", "source": "晓雪购物笔记", "page": 1 }],
  "relatedSearches": [{ "query": "适合老年人的耳机", "link": "https://www.baidu.com/s?ie=utf-8&wd=%E9%80%82%E5%90%88%E8%80%81%E5%B9%B4%E4%BA%BA%E7%9A%84%E8%80%B3%E6%9C%BA" }]
}
```

## include 标志

| 标志 | 效果 |
| - | - |
| `rawResponse` | 添加 `rawResponse`。 |

`markdown` 无需标志。参见 [Markdown 与原始响应](https://docs.querying.ai/zh/engines/response-options.md)。

## 相关文档

* [百度 AI 搜索产品页](https://querying.ai/zh/engines/baidu-ai-search)
* [Baidu Wenxin](https://docs.querying.ai/zh/engines/baidu-wenxin.md)
* [引擎概览](https://docs.querying.ai/zh/engines/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.