---
name: apify-baidu-search-api
description: Get structured Baidu search results without an official API key or Chinese account using the Apify Baidu Search Scraper Actor (johnvc/Baidu-Search-Scraper). One query returns one dataset item per SERP page with nested organic_results (position, title, link, plus displayed_link, rich_snippet, and sitelinks when Baidu shows them), related_searches, people_also_search_for, and top_searches, filtered by device, Simplified or Traditional Chinese, and time period. Use when the user wants a baidu api, a baidu search api or baidu serp api, Baidu search results as JSON or CSV, to scrape Baidu, structured baidu data for research or AI agents, or to see what ranks on baidu.com for a query. Pay-per-page billing, MCP-ready for Claude and other AI agents.
author: John Cole
author_url: https://github.com/johnisanerd
license: MIT
metadata:
  version: "1.0"
---

# Baidu Search API: Chinese SERP Results as JSON

A Baidu search API without an official API key, a Chinese phone number, or a local account. One query returns the Baidu SERP as structured JSON: organic results with positions, plus related searches, people also search for, and top searches, filtered by device, language, and time period.

## When to use this skill

- The user wants a "Baidu API" or "Baidu search API" without a Chinese account or phone number.
- They want Baidu search results as JSON or CSV for a query.
- They want to see what ranks on baidu.com for a keyword.
- They need structured Baidu data for market research, content research, or an AI agent.

Not for: rank tracking over time (use the apify-baidu-rank-tracker skill), Google or Yandex SERPs, or Baidu Maps and other Baidu verticals.

## What you get (one dataset item per SERP page)

Each dataset item is one page of results with nested arrays. `organic_results` holds rows with `position`, `title`, and `link` on every row, plus `displayed_link`, `rich_snippet`, and `sitelinks` when Baidu shows them. The item also carries `related_searches` (`query`, `link`), `people_also_search_for` (`text`, `link`), `top_searches` (`position`, `tag`, `text`, `link`), and `answer_box` and `related_videos` arrays that populate only when Baidu shows those SERP features. Page metadata rides along: `query`, `device`, `localization`, `page`, `num_results`, `total_results_found`, `pages_processed`, `search_timestamp`, `search_metadata` (includes `pagination_limit_reached`), and `pagination_info` (`total_pages`, `current_page`).

## Prerequisites

- Apify account (sign up at https://apify.com?fpr=9n7kx3&fp_sid=skillrepo).
- Authentication via `apify login`, or an `APIFY_TOKEN` environment variable (Apify Console, Settings, Integrations).

## The Actor

- Store page: https://apify.com/johnvc/Baidu-Search-Scraper?fpr=9n7kx3&fp_sid=skillrepo
- Actor ID: `johnvc/Baidu-Search-Scraper`
- Pricing: a small per-run start fee plus a per-page fee (see `references/gotchas.md`).

## Run it with the Apify CLI

One page of Baidu results for a Chinese query:

```bash
apify actors call "johnvc/Baidu-Search-Scraper" -i '{"query":"机器学习","max_pagination":1}' \
  --json \
  --user-agent apify-awesome-skills/apify-baidu-search-api \
  2>/dev/null
```

A deeper read: Simplified Chinese results only, 20 per page, up to 3 pages:

```bash
apify actors call "johnvc/Baidu-Search-Scraper" -i '{"query":"crm software","localization":2,"num_results":20,"max_pagination":3}' \
  --json \
  --user-agent apify-awesome-skills/apify-baidu-search-api \
  2>/dev/null
```

Every call carries the three flags this repo expects: `--json`, `--user-agent apify-awesome-skills/apify-baidu-search-api`, and `2>/dev/null`.

## Run it from Claude or another AI agent (MCP)

The Actor is MCP-ready. Add the hosted server URL:

`https://mcp.apify.com/?tools=actors,docs,johnvc/Baidu-Search-Scraper`

Then ask, for example: "Search Baidu for 机器学习 and list the organic results with positions and links." MCP setup docs: https://docs.apify.com/platform/integrations/mcp

## Workflow

1. Build the query. `query` is the only required field. Chinese queries return the most natural Baidu results; English queries work too.
2. Localize. Set `localization` to 2 for Simplified Chinese only or 3 for Traditional Chinese only (1, the default, is all languages). Pick `device` (`desktop`, `mobile`, `tablet`) for the SERP variant you care about.
3. Bound the volume. `max_pagination` (default 3) is the cost driver; `num_results` (default 10, max 50) sets rows per page. For a quick look, `max_pagination` 1 is enough.
4. Narrow by date if needed. `time_period` takes `stf=START_UNIX,END_UNIX|stftype=1` with Unix timestamps; leave it blank for all dates.
5. Estimate cost, then confirm with the user if the run is large. See `references/gotchas.md`.
6. Run the Actor and read the dataset. Each item is one page; read the nested `organic_results` array and flatten client-side if the user wants CSV or one row per result.

## Inputs

- `query` (string, required): the search term
- `device` (enum: `desktop`, `mobile`, `tablet`; default `desktop`)
- `localization` (integer: 1 all languages, 2 Simplified Chinese, 3 Traditional Chinese; default 1)
- `page` (integer, default 1): starting page number
- `num_results` (integer, default 10, max 50): results per page
- `max_pagination` (integer, default 3): page cap, the cost driver
- `time_period` (string): `stf=START_UNIX,END_UNIX|stftype=1` date window

## Cost

Billing is a small one-time start fee per run plus a per-page fee, and pages are charged up front from `max_pagination`, so set it to what you actually need. A default 3-page run costs well under a dollar; live prices and thresholds are in `references/gotchas.md`.

## Honest limits

- Organic rows always carry `position`, `title`, and `link`; `displayed_link`, `rich_snippet`, and `sitelinks` appear only on rows where Baidu shows them. There is no flat snippet field on every row.
- `answer_box` and `related_videos` populate only when Baidu shows those features for the query.
- Baidu can return fewer rows than `num_results` on a page; `total_results_found` reflects what actually came back.
- Result links can be Baidu redirect URLs (baidu.com/link?url=...) rather than final destination URLs.

## Troubleshooting

- Empty `organic_results`: the query has no results on Baidu; try a broader term or a Chinese-language query.
- Results in the wrong script: set `localization` to 2 (Simplified) or 3 (Traditional) instead of the default 1.
- Fewer pages than `max_pagination`: Baidu ran out of results; check `pagination_limit_reached` in `search_metadata`.
- Run exits early with a budget warning: the run hit its spending limit; raise it or lower `max_pagination`.

See `references/gotchas.md` for cost guardrails and error recovery, and `references/actor-index.md` for the Actor routing table.

## Related international SERP Actors

- Yandex Search Scraper (Russia and the CIS): https://apify.com/johnvc/Scrape-Yandex?fpr=9n7kx3&fp_sid=skillrepo
- Naver Search API (Korea): https://apify.com/johnvc/naver-search-api?fpr=9n7kx3&fp_sid=skillrepo
- DuckDuckGo Scraper (privacy-focused Western markets): https://apify.com/johnvc/DuckDuckGo-Scraper-for-serp-rankings?fpr=9n7kx3&fp_sid=skillrepo
