# Baidu Search Scraper (`searchapi/baidu-search-scraper`) Actor

Scrape organic search results from Baidu, China's leading search engine. Extracts page titles, URLs, snippets, source sites, dates, knowledge cards, and related searches. Supports configurable result limits with proxy support.

- **URL**: https://apify.com/searchapi/baidu-search-scraper.md
- **Developed by:** [Search API](https://apify.com/searchapi) (community)
- **Categories:** Developer tools, SEO tools, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.99 / 1,000 search results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Baidu Search Scraper

Scrape organic search results from Baidu, China's leading search engine. Extracts page titles, URLs, snippets, source sites, dates, knowledge cards, and related searches. Supports configurable result limits with proxy support.

### What this Actor collects

Each dataset item represents one source-backed Baidu organic, rich, paid, or related-search result allowed by the input flags.

- Uses the input limits and filters below to control the crawl.
- Stores source-backed fields defined by the 40-field dataset schema.
- Omits optional fields when the source does not expose a value instead of writing nulls or fabricated placeholders.

### Use cases

- Search and competitor research
- Ranking and visibility monitoring
- Dataset and workflow enrichment

### Input

Provide input in JSON. Fields marked required must be supplied; source-specific alternatives and constraints are described in the field text.

| Field | Type | Required | Default | Description |
| --- | --- | :---: | --- | --- |
| `query` | string | No | — | Keywords to enter in Baidu search. |
| `startUrls` | array | No | — | Optional Baidu search URLs. These take precedence over query. |
| `maxItems` | integer | No | `50` | Maximum unique organic/rich results to output. |
| `market` | string | No | `"zh-CN"` | Locale tag such as zh-CN or en-US. |
| `includeAds` | boolean | No | `false` | Include paid or sponsored results when available. |
| `includeRelated` | boolean | No | `true` | Include Baidu related-search suggestions as separate records. |
| `maxPages` | integer | No | `5` | Maximum number of Baidu result pages to inspect. |
| `proxyConfiguration` | object | No | — | Optional Apify Proxy or custom proxy configuration. |

#### Example input

```json
{
  "query": "人工智能",
  "maxItems": 20,
  "maxPages": 3,
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "market": "zh-CN",
  "includeAds": false,
  "includeRelated": true
}
```

### Output

The default dataset contains one item per search result or enabled related-search record. The following are the most useful fields; availability varies by result type.

| Field | Type | Description |
| --- | --- | --- |
| `position` | integer | Position |
| `title` | string | Title |
| `link` | string | Link |
| `snippet` | string | Snippet |
| `source` | string | Source |
| `date` | string | Date |
| `isAd` | boolean | Is Ad |
| `isOfficial` | boolean | Is Official |
| `market` | string | Market |
| `scrapedAt` | string | Scraped At |
| `type` | string | Type |
| `url` | string | URL |
| `query` | string | Query |
| `searchQuery` | string | Search Query |
| `resultType` | string | Result Type |
| `page` | integer | Page |

<details>
<summary>All 40 declared dataset fields</summary>

`position`, `title`, `link`, `snippet`, `source`, `date`, `isAd`, `isOfficial`, `market`, `scrapedAt`
`type`, `resultType`, `page`, `titleHtml`, `snippetHtml`, `url`, `displayUrl`, `domain`, `favicon`, `thumbnail`
`emphasis`, `siteLinks`, `breadcrumbs`, `richResultType`, `isSponsored`, `author`, `publishedAt`, `publishedAtRaw`, `relativeTime`, `rating`
`ratingCount`, `price`, `priceNumeric`, `currency`, `searchQuery`, `query`, `searchUrl`, `country`, `language`, `searchMetadata`

</details>

#### Example dataset item

This compact example is taken from local Actor storage. Long text and nested collections are shortened for documentation only.

```json
{
  "position": 1,
  "title": "人工智能(中国普通高等学校本科... - 百度百科",
  "link": "https://baike.baidu.com/item/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/24604211",
  "snippet": "人工智能（Artificial Intelligence），是一门普通高等学校本科专业，属于电子信息类专业，基本修业年限为四年，授予工学学士学位，2019年设立。人工智能专业是一个以计算机科学为基础，由计算机、心理学、哲学等多学科交叉融合的交叉专业、新兴专业，研究开发用于模拟延伸和...详情",
  "source": "百度百科",
  "isAd": false,
  "isOfficial": false,
  "market": "zh-CN",
  "scrapedAt": "2026-07-23T13:59:24.528Z",
  "type": "organic",
  "query": "人工智能",
  "searchQuery": "人工智能"
}
```

### Related Actors

- [Baidu Baike Scraper](https://apify.com/searchapi/baidu-baike-scraper)
- [Baidu Images Scraper](https://apify.com/searchapi/baidu-images-scraper)
- [Baidu Maps Scraper](https://apify.com/searchapi/baidu-maps-scraper)

# Actor input Schema

## `query` (type: `string`):

Keywords to enter in Baidu search.

## `startUrls` (type: `array`):

Optional Baidu search URLs. These take precedence over query.

## `maxItems` (type: `integer`):

Maximum unique organic/rich results to output.

## `market` (type: `string`):

Locale tag such as zh-CN or en-US.

## `includeAds` (type: `boolean`):

Include paid or sponsored results when available.

## `includeRelated` (type: `boolean`):

Include Baidu related-search suggestions as separate records.

## `maxPages` (type: `integer`):

Maximum number of Baidu result pages to inspect.

## `proxyConfiguration` (type: `object`):

Optional Apify Proxy or custom proxy configuration.

## Actor input object example

```json
{
  "query": "人工智能",
  "startUrls": [],
  "maxItems": 50,
  "market": "zh-CN",
  "includeAds": false,
  "includeRelated": true,
  "maxPages": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Canonical dataset schema for baidu-search-scraper

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": "人工智能",
    "startUrls": [],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("searchapi/baidu-search-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "query": "人工智能",
    "startUrls": [],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("searchapi/baidu-search-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "人工智能",
  "startUrls": [],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call searchapi/baidu-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=searchapi/baidu-search-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/CQ1kdiLQcGpiRtDA1/builds/dghEufvM6D5e4WjjJ/openapi.json
