# Baidu Search Scraper - Web & News SERP Results (`scrapesage/baidu-search-scraper`) Actor

Scrape Baidu web and news search results with the real destination URL, title, snippet, source, publish date and rank. No redirect resolving, no login, no cookies.

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

## Pricing

$2.00 / 1,000 result scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 - Web & News SERP Results

Scrape **Baidu** search results at scale - web search and Baidu News - and get back clean rows with the **real destination URL**, title, snippet, source, publish date and ranking position. **No login, no cookies, no redirect-resolving.**

Built for China market research, Baidu SEO tracking, competitor monitoring and feeding Chinese-language search results to an AI agent.

***

### The thing that makes this different: real URLs

Baidu's visible result links are `www.baidu.com/link?url=...` redirects. They expire, and resolving them costs you an extra HTTP request **per result**.

This actor reads Baidu's own destination attribute, so **every row already carries the final URL** - ready to crawl, dedupe or feed to an agent. You also get the redirect link in `redirectUrl` if you want it.

### What you get

One row per result, every row carrying the same fields:

| Field | What it is |
|---|---|
| `title` | Result title, highlight markup stripped |
| `url` | **Real destination URL** |
| `redirectUrl` | Baidu's own `/link?url=` form |
| `description` | Result snippet |
| `sourceName`, `sourceDomain` | Publisher name and domain |
| `publishedText`, `publishedAt` | Date as Baidu shows it, plus ISO 8601 when unambiguous |
| `rank`, `rankOnPage`, `page` | Position overall and within the page |
| `resultKind` | `organic` or `featured` (Baidu's rich blocks) |
| `queryMatched` | Whether the result actually mentions your query |
| `searchType` | `web` or `news` |
| `query`, `resultKey` | Which query found it; a stable unique key |

### Search modes

- **Web** - the main Baidu index
- **News** - Baidu News results, with publisher and date
- **Both** - a page can rank in both indexes; you get both rows, each with its own ranking

Plus optional **related searches** (`相关搜索`) - the query suggestions Baidu prints under the results, which are useful keyword-research seeds.

### Filters

`onlyOrganic` · `excludeBaiduModules` · `maxPagesPerQuery` · `resultsPerPage` · `maxResults`

***

### Example input

```json
{
  "queries": ["人工智能", "电动汽车"],
  "searchType": "both",
  "maxPagesPerQuery": 3,
  "maxResults": 100,
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

### Example output

```json
{
  "type": "result",
  "query": "人工智能",
  "searchType": "web",
  "page": 1,
  "rank": 1,
  "rankOnPage": 1,
  "title": "人工智能(中国普通高等学校本科专业) - 百度百科",
  "url": "https://baike.baidu.com/item/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/24604211",
  "description": "人工智能（Artificial Intelligence），是一门普通高等学校本科专业...",
  "sourceName": "百度百科",
  "sourceDomain": "baike.baidu.com",
  "resultKind": "featured",
  "queryMatched": true
}
```

***

### Pricing

**$0.002 per result.** You are charged only for rows actually delivered to your dataset.

### You are not billed for junk results

Baidu never returns an empty page. Give it a term it cannot match and it serves a page of **unrelated filler** - we measured three nonsense queries returning 3-10 results each, none of which mentioned the term.

By default (`requireQueryMatch`) this actor recognises that: if a query's first page contains no result mentioning your term, nothing is stored and **nothing is billed**, and the run tells you so. Turn it off if you want everything Baidu returns.

### Honest limits

- **Baidu's index is overwhelmingly Chinese.** English queries return far fewer, weaker results. Query in Chinese for real coverage.
- **Dates are sparse on web results** (~40%) because Baidu only prints a date when it has one; news results carry them far more often. `publishedAt` is filled only when the date is unambiguous - a bare "8月5日" with no year is returned in `publishedText` rather than guessed into a year.
- Use the **residential proxy** (the default). Baidu throttles per IP.

### Tips

- Set `searchType: "both"` and dedupe on `resultKey` to track a page's web *and* news ranking in one job.
- `rank` is the position across all pages for that query - chart it over scheduled runs to track ranking movement.
- Turn on `includeRelatedSearches` for keyword research; the terms come back as rows with `type: "relatedSearch"`.

### Related actors

- **Naver Scraper** - the same job for Korea (places, blogs, news, cafe)

# Actor input Schema

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

What to search for on Baidu. Chinese queries return far more results than English ones - Baidu's index is overwhelmingly Chinese.

## `searchType` (type: `string`):

Web results, Baidu News results, or both.

## `maxPagesPerQuery` (type: `integer`):

How deep to page for each query. Baidu returns about 10 results per page.

## `resultsPerPage` (type: `integer`):

Ask Baidu for more results per request (10-50). Higher values mean fewer requests, but Baidu sometimes trims the page.

## `onlyOrganic` (type: `boolean`):

Drop Baidu's rich 'featured' blocks and keep plain organic web results only.

## `excludeBaiduModules` (type: `boolean`):

Drop recommendation strips and other blocks that point back into baidu.com rather than a real destination site.

## `requireQueryMatch` (type: `boolean`):

Baidu answers a term it cannot match with a page of unrelated filler instead of an empty page. With this on, a query whose first page contains no result mentioning the term is treated as having no genuine matches - nothing is stored and nothing is billed. Turn off to keep whatever Baidu returns.

## `includeRelatedSearches` (type: `boolean`):

Also output the 'related searches' terms Baidu suggests for each query, as rows with type = relatedSearch.

## `maxResults` (type: `integer`):

Total cap across every query and page. Set 0 for no limit (explicit opt-in).

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

Baidu throttles per IP, so a residential proxy is strongly recommended.

## Actor input object example

```json
{
  "queries": [
    "人工智能",
    "apify"
  ],
  "searchType": "web",
  "maxPagesPerQuery": 3,
  "resultsPerPage": 10,
  "onlyOrganic": false,
  "excludeBaiduModules": true,
  "requireQueryMatch": true,
  "includeRelatedSearches": false,
  "maxResults": 100,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Every scraped Baidu result as a JSON item in the default dataset.

# 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": [
        "apify"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapesage/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 = { "queries": ["apify"] }

# Run the Actor and wait for it to finish
run = client.actor("scrapesage/baidu-search-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": [
    "apify"
  ]
}' |
apify call scrapesage/baidu-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapesage/baidu-search-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/fS0ilddE6kTvPKIDO/builds/cHnu3ywyfxz5i8NL6/openapi.json
