# Baidu Zhidao Scraper (`searchapi/baidu-zhidao-scraper`) Actor

Scrape Q\&A content from Baidu Zhidao (zhidao.baidu.com), China's largest online Q\&A platform. Extracts question titles, descriptions, best answers, related answers, categories, and metadata.

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

### What does Baidu Zhidao Scraper do?

**Baidu Zhidao Scraper** is a public Baidu Zhidao API alternative that extracts questions, accepted/best answers, answer details, categories, related questions, and source metadata from [Baidu Zhidao](https://zhidao.baidu.com/). It does not access private profiles, logins, or CAPTCHA-protected content.

### Why use Baidu Zhidao Scraper?

Use it for audience research, question monitoring, community-content analysis, or Q\&A dataset enrichment. Apify provides scheduling, monitored runs, API access, integrations, datasets, and optional authorized proxy rotation.

### What data can Baidu Zhidao Scraper extract?

Each dataset item represents one Baidu Zhidao question, with the best answer, deduplicated answer details, counts, related questions, and source metadata exposed by the page.

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

Optional values are omitted when a public page does not expose them. Required identifiers and source context are always present on accepted records.

### How to scrape Baidu Zhidao

1. Open the Actor input tab.
2. Enter a query, or add one or more public `zhidao.baidu.com/question/<id>.html` URLs.
3. Set `maxItems` and `maxPages` to bound the run.
4. Start without a proxy; enable an authorized Apify Proxy only after a confirmed block.
5. Run the Actor and download the dataset as JSON, CSV, Excel, XML, or another supported format.

### How much will it cost to scrape Baidu Zhidao?

Cost depends on the Actor's current pricing, browser time, number of question pages, and proxy use. Review the pricing tab, start with a small sample, and keep item/page limits bounded.

### 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 | — | Search query to find Q\&A on Baidu Zhidao (Chinese queries recommended) |
| `questionUrls` | array | No | — | Direct URLs to specific Zhidao questions. Takes precedence over 'query'. |
| `maxItems` | integer | No | `20` | Maximum number of questions to scrape |
| `maxPages` | integer | No | `3` | Maximum number of Zhidao search-result pages to follow when questionUrls is not supplied. |
| `maxRequestRetries` | integer | No | `4` | Rotate through fresh browser and proxy identities after temporary blocks or challenges. |
| `proxyConfiguration` | object | No | — | Proxy configuration for the scraper |

#### Example input

```json
{
  "query": "人工智能",
  "questionUrls": [
    {
      "url": "https://zhidao.baidu.com/question/2016994450164093388.html"
    }
  ],
  "maxItems": 10,
  "maxPages": 2,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "maxRequestRetries": 4
}
```

### Output

The default dataset contains one item per Q\&A question page. The following are the most useful fields; optional asker, category, and answer metadata appear only when exposed by the page.

| Field | Type | Description |
| --- | --- | --- |
| `position` | integer | Position |
| `title` | string | Question Title |
| `question` | string | Question Detail |
| `bestAnswer` | string | Best Answer |
| `answerCount` | integer | Answer Count |
| `url` | string | URL |
| `scrapedAt` | string | Scraped At |
| `type` | string | Record Type |
| `source` | string | Source |
| `searchQuery` | string | Search Query |
| `category` | string | Category |
| `subcategory` | string | Subcategory |
| `bestAnswerId` | string | Best Answer ID |
| `bestAnswerAuthor` | string | Best Answer Author |
| `bestAnswerAuthorUrl` | string | Best Answer Author URL |
| `bestAnswerUpvoteCount` | integer | Best Answer Upvotes |

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

`position`, `type`, `source`, `title`, `question`, `category`, `subcategory`, `bestAnswer`, `bestAnswerId`, `bestAnswerAuthor`
`bestAnswerAuthorUrl`, `bestAnswerUpvoteCount`, `answers`, `answerDetails`, `answerCount`, `extractedAnswerCount`, `totalExtractedAnswerCharacters`, `isResolved`, `viewCount`, `asker`
`askerUrl`, `answeredAt`, `url`, `canonicalUrl`, `questionId`, `tags`, `relatedQuestions`, `relatedQuestionCount`, `searchQuery`, `searchUrl`
`titleLength`, `questionLength`, `bestAnswerLength`, `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": "人工智能的定义是什么？",
  "bestAnswer": "人工智能（Artificial Intelligence），英文缩写为AI。它是研究、开发用于模拟、延伸和扩展人的智能的理论、方法、技术及应用系统的一门新的技术科学。人工智能是计算机科学的一个分支，它企图了解智能的实质，并生产出一种新的能以人类智能相似的方式做出反.",
  "answerCount": 12,
  "url": "https://zhidao.baidu.com/question/2016994450164093388.html",
  "scrapedAt": "2026-07-26T07:46:40.231Z",
  "type": "qa",
  "source": "baidu-zhidao",
  "searchQuery": "人工智能",
  "answerDetails": [
    {
      "position": 1,
      "content": "人工智能（Artificial Intelligence），英文缩写为AI。它是研究、开发用于模拟、延伸和扩展人的智能的理论、方法、技术及应用系统的一门新的技术科学。人工智能是计算机科学的一个分支，它企图了解智能的实质，并生产出一种新的能以人类智能相似的方式做出反.",
      "isBest": true,
      "isAccepted": false
    },
    {
      "position": 2,
      "content": "人工智能从表面上来看就是让代替人工的机器拥有和人类相似的智力bai，而在百度百科中对人工智能的定义为开发用于模拟、延伸和扩展人的智能的理论、方法、技术及应用系统的一门新的技术科学。…",
      "isBest": false,
      "isAccepted": false
    }
  ],
  "answeredAt": "2020-11-24",
  "relatedQuestions": [
    {
      "title": "人工智能的定义是?",
      "url": "https://zhidao.baidu.com/question/1902228709023693220.html"
    },
    {
      "title": "简述什么是人工智能",
      "url": "https://zhidao.baidu.com/question/1762439017513812268.html"
    }
  ]
}
```

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

### Tips and advanced options

- Direct-question mode avoids search discovery when you already know the public URLs.
- Duplicate input URLs and tracking parameters are normalized before crawling.
- Challenge pages and malformed question pages fail explicitly and are never stored as records.

### FAQ, disclaimer, and support

#### Why did a run report a verification challenge?

Baidu may challenge automated traffic based on network reputation or region. Retry later or use an authorized proxy group available to your account. The Actor does not solve CAPTCHAs or bypass access controls.

#### Can I use the Actor through an API?

Yes. Use the Actor's API tab or an Apify client library with the same JSON input. Report reproducible issues through the Issues tab.

Our Actors are ethical and do not intentionally extract private user data. They collect public page content only. Results may still contain personal data protected by the GDPR or similar laws. Scrape personal data only with a legitimate reason and consult legal counsel when unsure.

# Actor input Schema

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

Search query to find Q\&A on Baidu Zhidao (Chinese queries recommended)

## `questionUrls` (type: `array`):

Direct URLs to specific Zhidao questions. Takes precedence over 'query'.

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

Maximum number of questions to scrape

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

Maximum number of Zhidao search-result pages to follow when questionUrls is not supplied.

## `maxRequestRetries` (type: `integer`):

Rotate through fresh browser and proxy identities after temporary blocks or challenges.

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

Proxy configuration for the scraper

## Actor input object example

```json
{
  "query": "人工智能",
  "questionUrls": [],
  "maxItems": 20,
  "maxPages": 3,
  "maxRequestRetries": 4,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Canonical dataset schema for baidu-zhidao-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": "人工智能",
    "questionUrls": [],
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

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

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

```

## MCP server setup

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