# Baidu Search Results Scraper (`automation-lab/baidu-search-results-scraper`) Actor

Search Baidu by keyword and export ranked titles, snippets, destination URLs, displayed domains, positions, and result features for Chinese SEO monitoring.

- **URL**: https://apify.com/automation-lab/baidu-search-results-scraper.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** SEO tools
- **Stats:** 2 total users, 1 monthly users, 50.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.08 / 1,000 result extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#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 Results Scraper

Search Baidu by keyword and export ranked result titles, snippets, destination URLs, displayed domains, positions, and supported result features.

This Actor is built for recurring Chinese SEO monitoring, brand research, content discovery, and market analysis.
It accepts Chinese or international queries and returns integration-ready JSON from Baidu Search.

A query such as `百度地图` can help you study how Baidu Maps pages and competing pages appear in Baidu search results.
The Actor does **not** scrape Baidu Maps place listings; it extracts Baidu web search result cards.

### What does Baidu Search Results Scraper do?

For each supplied query, the Actor:

1. Opens a coherent mobile browser session.
2. Bootstraps Baidu cookies before searching.
3. Loads one or more ranked result pages.
4. Detects verification pages instead of treating them as empty results.
5. Retries with a fresh browser and cookie session.
6. Extracts useful result cards with titles and destinations.
7. Removes duplicate rows within each query.
8. Charges only for accepted result rows.
9. Writes normalized records to the default Apify dataset.

The output keeps the original query, absolute position, page number, search URL, and fetch time.
That makes repeated datasets suitable for comparing rank changes outside the Actor.

### Who is it for?

#### SEO teams

Track Chinese keyword visibility and export result positions into a warehouse, spreadsheet, or dashboard.

#### Brand and communications teams

Review which pages appear for a company, product, executive, or campaign query.

#### Market researchers

Collect ranked sources and snippets for products, industries, technologies, and competitors in China.

#### Developers and data engineers

Use the Apify API, webhooks, schedules, and integrations to build a repeatable Baidu SERP pipeline.

#### Content teams

Inspect result titles, snippets, domains, and enhanced features before planning Chinese-language content.

### Why use this Actor?

- **Rank-aware records** — every row includes its query, absolute position, and page.
- **Destination evidence** — canonical destinations are used when Baidu exposes them.
- **Redirect traceability** — Baidu redirect URLs are preserved separately when available.
- **Result features** — template identifiers distinguish ordinary and enhanced result cards.
- **Chinese-ready browser context** — mobile Baidu is opened with a Chinese locale.
- **Bounded recovery** — challenge pages trigger fresh sessions, not false empty success.
- **Spend controls** — per-query and run-wide limits are enforced before saving rows.
- **Standard Apify output** — results work with datasets, API clients, schedules, and webhooks.

### What Baidu data can I extract?

| Field | Meaning |
| --- | --- |
| `query` | Search term that produced the record |
| `title` | Result title displayed by Baidu |
| `snippet` | Displayed result summary, or `null` |
| `destinationUrl` | Canonical destination when exposed; otherwise the Baidu redirect |
| `displayedDomain` | Domain associated with the destination |
| `position` | Absolute result-card position reported by Baidu |
| `page` | One-based search result page |
| `resultType` | `organic` or `enhanced` |
| `resultFeature` | Baidu template identifier such as `www_index` |
| `baiduRedirectUrl` | Baidu tracking redirect, or `null` |
| `searchUrl` | Exact Baidu page used for extraction |
| `fetchedAt` | ISO 8601 fetch timestamp |

Baidu may omit a snippet or canonical URL for some card types.
The schema therefore documents fields that may be unavailable on individual records.

### How to scrape Baidu search results

1. Open the Actor in Apify Console.
2. Enter one or more real queries in **Search queries**.
3. Choose **Maximum results per query**.
4. Set **Maximum total results** as a run-wide spending cap.
5. Click **Start**.
6. Open the **Baidu search results** dataset view.
7. Export JSON, CSV, Excel, XML, or another Apify-supported format.

A useful first run is:

```json
{
  "queries": ["百度搜索 API"],
  "maxResultsPerQuery": 10,
  "maxItems": 10
}
```

### Input parameters

#### `queries`

Required array of 1–50 non-empty search terms.
Each term can contain up to 200 characters.
Duplicate terms are processed once.

Examples:

- `百度地图`
- `百度搜索 API`
- `百度智能云`
- `人工智能`
- `新能源汽车`

#### `maxResultsPerQuery`

Maximum accepted records for each query.
Allowed range: 1–50.
Default: 20.

#### `maxItems`

Maximum accepted records across the entire run.
Allowed range: 1–1,000.
Default: the smaller of 1,000 or the requested per-query total.

### Output example

The following shape comes from the current implementation; long tracking values are shortened for readability:

```json
{
  "query": "百度智能云",
  "title": "官方百度智能云-“芯云模体”新全栈AI云",
  "snippet": "百度智能云致力于为企业和开发者提供人工智能、大数据和云计算服务...",
  "destinationUrl": "https://cloud.baidu.com/",
  "displayedDomain": "cloud.baidu.com",
  "position": 1,
  "page": 1,
  "resultType": "organic",
  "resultFeature": "www_index",
  "baiduRedirectUrl": "https://m.baidu.com/.../tc?...",
  "searchUrl": "https://m.baidu.com/s?word=...&rn=10&pn=0",
  "fetchedAt": "2026-09-01T20:19:53.649Z"
}
```

Each accepted row is written to the default dataset.
No screenshots, raw HTML, cookies, or browser debug objects are included in product output.

### How much does it cost to scrape Baidu search results?

The Actor uses pay-per-event pricing:

- **Start:** $0.005 once per run.
- **Search result:** tiered by your Apify plan; BRONZE is $0.003464 per accepted row.

At BRONZE pricing, estimate a run as **one start event plus the accepted result count multiplied by the BRONZE result price**.
For example, a 10-row run charges one start event and 10 result events; a 100-row run charges one start event and 100 result events.

The Actor does not charge the result event for rejected, duplicate, empty, or failed cards.
Apify platform compute and storage usage may be billed separately according to your Apify plan.
Actual output volume depends on the query, result features, and Baidu response.
Check the current pricing panel before large runs.

### Recurring Baidu SEO monitoring workflow

A practical monitoring workflow is:

1. Create one query list for a product, category, and competitor set.
2. Run the same input on a daily or weekly Apify schedule.
3. Send dataset completion webhooks to your warehouse or automation platform.
4. Compare rows by `query`, `destinationUrl`, and `position`.
5. Flag newly appearing URLs, disappeared URLs, and material position changes.
6. Keep `fetchedAt` and the run ID as observation evidence.

The Actor returns observations, not a built-in historical rank database.
Store or compare prior datasets in your own workflow.

### Integration ideas

#### Google Sheets

Use the Apify Google Sheets integration to append each completed dataset to a monitoring workbook.

#### Make or Zapier

Trigger a scenario when a run succeeds, then route new rows by query or domain.

#### Webhooks

Send run success and failure events to your ingestion endpoint.

#### Data warehouse

Fetch dataset JSON through the API and upsert records keyed by query, date, and destination URL.

#### Alerts

Compare the newest dataset with the previous run and notify your team when a tracked domain changes position.

### Run with the Apify API using cURL

Replace `YOUR_APIFY_TOKEN` with a secure token and keep it outside source control:

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~baidu-search-results-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "queries": ["百度搜索 API"],
    "maxResultsPerQuery": 10,
    "maxItems": 10
  }'
```

For production, prefer an `Authorization` header so the token does not appear in URLs or access logs.

### Run with JavaScript

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/baidu-search-results-scraper').call({
  queries: ['百度智能云'],
  maxResultsPerQuery: 10,
  maxItems: 10,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

Install the client with `npm install apify-client`.

### Run with Python

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("automation-lab/baidu-search-results-scraper").call(
    run_input={
        "queries": ["百度地图"],
        "maxResultsPerQuery": 10,
        "maxItems": 10,
    }
)
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

Install the client with `pip install apify-client`.

### Use Baidu Search Results Scraper with MCP

Add this Actor to Claude Code:

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/baidu-search-results-scraper"
```

#### Claude Desktop, Cursor, and VS Code setup

Use this equivalent MCP configuration in Claude Desktop, Cursor, or VS Code:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/baidu-search-results-scraper"
    }
  }
}
```

Example prompts:

- “Run Baidu Search Results Scraper for `百度智能云` and return the top domains.”
- “Collect Baidu positions for `人工智能` and `新能源汽车`, then group results by query.”
- “Export the Baidu results to a dataset and summarize enhanced result features.”

Your MCP client still needs access to your Apify account and appropriate Actor permissions.

### Tips for reliable Baidu extraction

- Start with 7–10 results per query before requesting deeper pages.
- Use Chinese queries when monitoring Chinese-language discovery.
- Keep query batches bounded so one run remains easy to inspect and retry.
- Avoid repeatedly launching identical runs after a verification challenge.
- Compare exact inputs across scheduled runs for meaningful rank changes.
- Use `maxItems` as a hard dataset and spending cap.

The implementation creates a fresh coherent browser context when a page is challenged.
It performs at most four session attempts per page and then fails clearly.

### Limits and failure behavior

Baidu is a live search service and can change markup, rankings, templates, and anti-automation behavior.
Results can vary by time, session, location, device surface, and Baidu experiments.

The Actor supports up to:

- 50 queries per run;
- 50 accepted results per query;
- 1,000 accepted results per run;
- five requested pages per query;
- four browser-session attempts per page.

Verification pages and unrecognized response shapes are errors, not valid zero-result pages.
If retries are exhausted, the run fails so monitoring systems can alert rather than ingest false emptiness.
Rows saved before a later failure can remain in the dataset; always check run status.

Some enhanced cards do not expose an independent canonical destination.
In that case, `destinationUrl` can contain the Baidu redirect URL and `displayedDomain` can be a Baidu domain.

### Data quality and rank interpretation

`position` is the result-card order exposed by Baidu.
Enhanced cards can occupy positions between ordinary web results.
Use `resultType` and `resultFeature` when comparing like-for-like rankings.

The Actor excludes cards without a usable title and link, obvious related-search modules, and visible advertising labels.
Because the product filters non-result modules, the number of accepted rows can be smaller than the number of visible cards.

Do not treat a single run as a universal ranking for every Baidu user.
For monitoring, compare repeated observations produced with the same input and schedule.

### Responsible use and legality

Use this Actor only for lawful purposes and public search information.
Follow Baidu's terms, applicable laws, intellectual-property rules, privacy requirements, and your organization's policies.

Do not use the Actor to collect sensitive personal data, evade access controls, overload Baidu, or make automated high-impact decisions about people.
Set conservative limits and schedules.
You are responsible for your inputs, downstream storage, retention, and use of results.

This documentation is operational guidance, not legal advice.

### Troubleshooting

#### Why did the run fail with a verification challenge?

Baidu can challenge a browser or cookie session.
The Actor retires the challenged context and retries with a fresh browser session up to the configured bound.
If all attempts fail, wait before retrying rather than launching identical runs repeatedly.
Do not interpret the failed run as proof that the query has no results.

#### Why are there fewer than ten rows?

A Baidu page can contain ads, related searches, answer modules without usable links, and other non-result cards.
The Actor saves only cards that satisfy the output contract.
Natural query volume and Baidu experiments also vary.

#### Why is a destination still a Baidu URL?

Some result features expose only a Baidu tracking redirect.
The Actor uses the canonical destination from card metadata when available and otherwise preserves the redirect as the usable destination.

#### Can this Actor scrape Baidu Maps places?

No.
It can search a phrase such as `百度地图`, but it does not extract map places, coordinates, reviews, or navigation data.

#### Does the Actor store rank history?

No.
Schedule repeated runs and compare their datasets in a sheet, database, or automation workflow.

### FAQ

#### Does it support English queries?

Yes.
Queries may be Chinese or international text, although Baidu's returned content and ranking behavior remain source-controlled.

#### Can I search multiple keywords in one run?

Yes, up to 50 queries, subject to `maxItems` and per-query limits.

#### Does it resolve every Baidu redirect?

No network request is made solely to follow each result link.
The Actor prefers canonical card metadata and preserves the redirect for traceability.

#### Are enhanced result features included?

Yes, when a feature card has a useful title and destination.
Use `resultType: "enhanced"` and `resultFeature` to identify it.

#### Can I use Apify schedules?

Yes.
Schedules are a good fit for recurring keyword checks, provided your downstream workflow compares datasets and checks run status.

#### Can I export CSV or Excel?

Yes.
Use the dataset export controls or API formats provided by Apify.

### Related automation-lab Actors

- [Yandex Search Results Scraper](https://apify.com/automation-lab/yandex-search-results-scraper) for ranked Yandex SERP records.
- [Google Search Results Scraper](https://apify.com/automation-lab/google-search-results-scraper) when your workflow also monitors Google.

Use related Actors only when their source and output contract match your research job.
Baidu-specific positions from this Actor should not be treated as interchangeable with rankings from another search engine.

### Support

When reporting a problem, include:

- the run URL;
- a sanitized input;
- the expected result behavior;
- the observed error or missing field;
- whether the problem is query-specific or affects several queries.

Do not include your Apify token, cookies, or other credentials.

# Actor input Schema

## `queries` (type: `array`):

Keywords or phrases to search on Baidu. Each output row keeps its query and position for recurring SEO comparisons.

## `maxResultsPerQuery` (type: `integer`):

Maximum ranked Baidu results to collect for each query across result pages.

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

Run-wide result cap across all queries. Use it to control dataset size and spend.

## Actor input object example

```json
{
  "queries": [
    "百度地图"
  ],
  "maxResultsPerQuery": 20,
  "maxItems": 20
}
```

# Actor output Schema

## `dataset` (type: `string`):

Default dataset containing every accepted result row.

# 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 = {
    "queries": [
        "百度地图"
    ],
    "maxResultsPerQuery": 20,
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/baidu-search-results-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 = {
    "queries": ["百度地图"],
    "maxResultsPerQuery": 20,
    "maxItems": 20,
}

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

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

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

```

## CLI example

```bash
echo '{
  "queries": [
    "百度地图"
  ],
  "maxResultsPerQuery": 20,
  "maxItems": 20
}' |
apify call automation-lab/baidu-search-results-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/baidu-search-results-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/SB8FsRMs2WXCBe4VR/builds/S8oqhEEnvr5xkZ1Kh/openapi.json
