> ## 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.

# Baidu AI Search API — the AI answer at the top of Baidu's results

> Search Baidu from mainland China and get the AI answer at the top of the results with the pages it cites, plus the rest of the results page.

`BAIDU_AI_SEARCH` searches Baidu (baidu.com) and returns the AI answer card (百度AI+) at the top of the results page with the pages the answer cites, along with the rest of that page: results, ads, related searches, news, videos, products, images, places and Baidu's other cards. No account or login is involved.

| | |
| - | - |
| taskType | `BAIDU_AI_SEARCH` |
| Reads | `query` (falls back to `prompt`) |
| Credits | 1.25 |
| Country | **Ignored.** Every task searches from mainland China. |

## Request

Every task reads the results page from a mainland exit, so `country` does not change it. You can omit it.

```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": "降噪耳机哪个牌子好" } }'
```

## Response

| Field | Type | Description |
| - | - | - |
| `card` | string or null | The AI card Baidu showed: `general` or `health` (百度健康). `null` when the results page had no AI answer. |
| `text` | string | The answer. Empty when `card` is `null`. |
| `markdown` | string | The answer as Markdown, with citation numbers such as `[2]` that match `sources`. Returned without any flag. |
| `sources` | array | The pages the answer cites: `position`, `url`, `label`, `source` (the site name) and `publishedAt` when Baidu gives it. Health cards have none. |
| `reviewedBy` | string | On health cards, the reviewers Baidu names. |
| `searchQueries` | array | The searches Baidu ran for an answer it writes after the page loads. |
| `organicResults` | array | The results that each lead to one page, in page order: `position`, `title`, `link`, `snippet`, `date`, `source` (the site or author Baidu names) and `page`. Baidu Baike, Tieba, Wenku and Aiqicha entries count. |
| `ads` | array | Paid results: `position`, `title`, `link` (the landing page), `displayedLink`, `description` and `blockPosition` (`top` above the results, `bottom` below them). |
| `relatedSearches` | array | 大家还在搜 and 相关搜索, each once: `query`, `link`. |
| `contentResults` | array | News, video and 精选笔记 note items in page order: `position`, `type` (`news`, `video` or `note`), `title`, `link`, `snippet`, `source`, `date`, `thumbnail`. |
| `shoppingResults` | array | Products on the 商品 card: `position`, `title`, `link` (the store's page), `price` (yuan), `mallName`, `sales`, `thumbnail`. |
| `images` | array | The 百度图片 grid: `position`, `link` (Baidu Images' page), `image`, `thumbnail`, `width`, `height`. |
| `map` | array | Places on 百度地图 cards: `position`, `name`, `placeId`, `location.address`, `phoneNumber`, `category`, `openState`, `reviews`, `mapsUrl`, `image`. A list card shows places in the city the search ran from, which changes between tasks. |
| `otherCards` | array | Every other card on the page, such as brand, person and drug panels, quotes and weather: `position`, `type` (Baidu's template name), `column` (`main` or `right`), `title`, `link`, `text` (what the card shows). |
| `rawResponse` | object | The card's own data, plus the stream's events for an answer Baidu writes after the page loads. Only with `include.rawResponse`. |

Every task returns the results page, with or without an AI card, and each results-page field is present when the page shows that block. The AI card changes between requests for the same query, and a query that shows no card completes with `card: null`. Answers Baidu writes after the page loads arrive like any other card, with their sources and the searches Baidu ran.

For example:

```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 flags

| Flag | Effect |
| - | - |
| `rawResponse` | Adds `rawResponse`. |

`markdown` needs no flag. See [Markdown and raw responses](https://docs.querying.ai/engines/response-options.md).

## Related

* [Baidu AI Search product page](https://querying.ai/en/engines/baidu-ai-search)
* [Baidu Wenxin](https://docs.querying.ai/engines/baidu-wenxin.md)
* [Engine overview](https://docs.querying.ai/engines/overview.md)


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