# Baidu Baike Scraper (`searchapi/baidu-baike-scraper`) Actor

Scrape encyclopedia entries from Baidu Baike (baike.baidu.com), China's largest online encyclopedia. Extracts entry titles, summaries, content sections, infobox data, references, and images. Supports search and direct entry URLs.

- **URL**: https://apify.com/searchapi/baidu-baike-scraper.md
- **Developed by:** [Search API](https://apify.com/searchapi) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 42.9% 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 Baike Scraper

Scrape encyclopedia entries from Baidu Baike (baike.baidu.com), China's largest online encyclopedia. Extracts entry titles, summaries, content sections, infobox data, references, and images. Supports search and direct entry URLs.

### What this Actor collects

Each dataset item represents one Baidu Baike entry, with source-backed article text, structured sections, infobox values, images, references, and entry identifiers.

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

### Use cases

- Encyclopedia and background research
- Entity-profile and knowledge-base enrichment
- Monitoring changes to public reference entries

### 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 Baike search. |
| `entryUrls` | array | No | — | Direct Baidu Baike entry URLs. When provided, query search is skipped. |
| `maxItems` | integer | No | `20` | Maximum number of unique encyclopedia entries to output. |
| `maxPages` | integer | No | `5` | Maximum result pages to inspect for a search query. |
| `proxyConfiguration` | object | No | — | Optional Apify Proxy or custom proxy configuration. |

#### Example input

```json
{
  "query": "人工智能",
  "maxItems": 3,
  "maxPages": 2,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

### Output

The default dataset contains one item per encyclopedia entry. The following are the most useful fields; availability varies with the source page.

| Field | Type | Description |
| --- | --- | --- |
| `position` | integer | Output position |
| `title` | string | Entry title |
| `subtitle` | string | Entry subtitle |
| `summary` | string | Summary |
| `category` | string | Category |
| `url` | string | Entry URL |
| `scrapedAt` | string | Scrape timestamp |
| `type` | string | Record type |
| `description` | string | Meta description |
| `source` | string | Source |
| `query` | string | Input query |
| `searchQuery` | string | Search query |
| `contentText` | string | Full article text |
| `wordCount` | integer | Article word count |
| `categories` | array | Categories |
| `keywords` | array | Keywords |

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

`position`, `title`, `subtitle`, `summary`, `description`, `contentText`, `wordCount`, `category`, `categories`, `keywords`
`sections`, `infobox`, `images`, `coverImage`, `references`, `tags`, `editCount`, `lastEditedAt`, `lemmaId`, `entryId`
`canonicalUrl`, `url`, `entryUrl`, `searchResultTitle`, `searchResultSnippet`, `searchResultUrl`, `type`, `recordType`, `source`, `sourceDomain`
`siteName`, `language`, `ogTitle`, `ogDescription`, `ogImage`, `query`, `searchQuery`, `searchUrl`, `scrapedAt`

</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": "人工智能",
  "subtitle": "智能科学与技术专业术语展开42个同名词条",
  "summary": "人工智能（Artificial Intelligence），英文缩写为AI。是研究、开发用于模拟、延伸和扩展人的智能的理论、方法、技术及应用系统的一门新技术科学。人工智能是计算机科学的一个分支，它企图了解智能的实质，并生产出一种新的能以人类智能相似的方式做出反应的智能机器，该领域的研究包括机器人、语言识别、图像识别、自然语言处理和专家系统等 [128]。人…",
  "category": "定义详解",
  "url": "https://baike.baidu.com/item/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/9180",
  "scrapedAt": "2026-07-23T12:57:48.110Z",
  "type": "encyclopedia",
  "description": "人工智能（Artificial Intelligence），英文缩写为AI。是研究、开发用于模拟、延伸和扩展人的智能的理论、方法、技术及应用系统的一门新技术科学。人工智能是计算机科学的一个分支，它企图了解智能的实质，并生产出一种新的能以人类智能相似的方式做出反应的智能机器，该领域的研究包括机器人、语言识别、图像识别、自然语言处理和专家系统等。人工智能大模型…",
  "source": "baidu-baike",
  "query": "人工智能",
  "searchQuery": "人工智能"
}
```

### Related Actors

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

# Actor input Schema

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

Keywords to enter in Baidu Baike search.

## `entryUrls` (type: `array`):

Direct Baidu Baike entry URLs. When provided, query search is skipped.

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

Maximum number of unique encyclopedia entries to output.

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

Maximum result pages to inspect for a search query.

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

Optional Apify Proxy or custom proxy configuration.

## Actor input object example

```json
{
  "query": "人工智能",
  "entryUrls": [],
  "maxItems": 20,
  "maxPages": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Rich, normalized Baidu Baike encyclopedia entry records.

# 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": "人工智能",
    "entryUrls": [],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("searchapi/baidu-baike-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": "人工智能",
    "entryUrls": [],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("searchapi/baidu-baike-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 '{
  "query": "人工智能",
  "entryUrls": [],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call searchapi/baidu-baike-scraper --silent --output-dataset

```

## MCP server setup

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