Skip to main content

Overview

The ScrapeBadger Baidu API turns baidu.com into a clean JSON feed: the web SERP (with language and publish-date filters), the news vertical, image search with full-size image URLs and pixel dimensions, and search-box autocomplete. Baidu is China’s #1 search engine at roughly 60% market share — the single largest search surface outside Google, and the one that decides visibility for the Chinese-language web. It is also the search engine most Western SEO and market-research tooling simply skips.
All endpoints are GET, live under https://scrapebadger.com/v1/baidu/*, and authenticate with the X-API-Key header. Credits are charged per request (see the table below) and reported on the X-Credits-Used response header.

The real URL, not the redirect

Baidu does not link straight to a result. Every organic link is a baidu.com/link?url=... tracking redirect that only resolves to the destination when followed — which is why competing Baidu APIs hand you a baidu.com URL and leave you to make one extra HTTP request per result to learn where it actually goes. ScrapeBadger returns both, on every result:
So a rank-tracking or domain-visibility job needs one call, not 1 + N — you can group results by real hostname straight out of the response.

Global access, no China proxy

Baidu is reachable from outside China but rate-limits and challenges foreign traffic aggressively. ScrapeBadger absorbs that: requests are served through its own exit pool with session reuse and challenge handling, so you do not need a China-based proxy, a mainland VPS, or an ICP filing. Call the API from anywhere.

Features

  • Web search — organic results with title, real url, snippet, source (the site name Baidu shows), date/date_at, thumbnail and Baidu’s own tpl template id. Up to 50 results per page.
  • Language filter — restrict to simplified (zh-cn) or traditional (zh-tw) Chinese, or leave it open with all.
  • Publish-date windowtime_from / time_to as Unix timestamps, mapped onto Baidu’s own gpc date filter.
  • Related searches — Baidu’s query suggestions from the foot of the SERP, with their SERP URLs, for keyword expansion.
  • News vertical — articles with publisher, publish date and real article URLs, ordered by relevance or recency.
  • Image search — full-size image_url (Baidu’s decoded objURL), three Baidu-hosted copies (thumbnail_url, middle_url, hover_url), pixel width/height, format, and the source page (from_url, from_title).
  • Autocomplete — Baidu’s search-box suggestions for 1 credit, the cheapest way to expand a seed term into real Chinese queries.

Dates

Every dated result ships two fields:
There is deliberately no timestamp field. Baidu’s SERP carries no time-of-day, so a midnight epoch would be fabricated precision. Sort on date_at and keep date for display.

Credits

Quickstart

Pagination limits

total_results is Baidu’s own claim (parsed from 百度为您找到相关结果约N个), not a reachable count. Baidu’s SERP stops serving results past roughly page 76 regardless of the total it reports, so page is clamped to 176 — a request beyond the wall is rejected rather than billed for a structurally empty page.
  • num controls page size, 150 (Baidu’s own cap). Fewer, bigger pages is the cheaper way to depth: num=50 reaches 500 results in 10 calls.
  • Page offset is (page - 1) * num, so changing num between pages shifts the window. Keep num fixed for the whole crawl of one query.
  • Images are a fixed 30 per page, page 150.
To go wider than one query’s page wall, expand the seed instead of paging deeper: run /autocomplete (1 credit) and the related_searches off the first SERP, then search each term and merge on url. Cheaper coverage than paging to 76.

Character encoding

Queries are Chinese in practice, so URL-encode the query as UTF-8 and let your HTTP client do it (URLSearchParams, requests params=, the SDKs). Every response is UTF-8; snippet and title come back with Baidu’s own punctuation (,, ) intact rather than transliterated. Latin queries work too — Baidu serves a mixed SERP for coffee machine — but Chinese terms return meaningfully richer results.

Errors

Baidu serves a challenge page with HTTP 200. Those are detected by result- container marker, not status code, and surfaced as 422 so a challenge is never billed or mistaken for a genuinely empty SERP.