Baidu Search API keyword research workflow
Chinese keyword research starts from the phrases people type, and Baidu autocomplete supplies them. Chain the suggestion and search operations like this:
- Send a seed phrase in
body.qtobaidu-suggestand keep thesuggestionsin the order returned. - Send the most promising completion to
baidu-searchand readrelated_searches, whose rows pair aquerywith alink. - Collect the
queryvalues that look relevant and send each one back tobaidu-suggestorbaidu-searchas a newbody.q. - Store each phrase with the call that produced it, so the keyword list can be rebuilt from the same seed.
Suggestions and related searches are separate lists, and related searches come only from baidu-search.
Track keyword rankings on Baidu
To follow where a domain appears for a keyword, request the same query repeatedly with a fixed page size and read the position and domain of each row in organic_results.
- Send the keyword in
body.qwithbody.numset to 50, the upper end of its range. - Record the
position,domainandurlof each row;urlis the real destination rather than Baidu's redirect. - Move to the next window with
body.pageorbody.offsetonly when the first page does not contain the domain. - Keep
body.numthe same between runs, because a page number refers to different rows whenbody.numchanges.
The pagination group reports results_per_page, so a stored run shows the page size it was taken with. A body.num above 50 is clamped to 50, and an invalid value is ignored so that the default of 10 applies, which makes runs with different page sizes hard to compare.
Monitor Baidu news coverage for a brand
News monitoring works best as a repeated query with the newest articles first:
- Send the brand name in
body.qtobaidu-newswithbody.sortset todate. - Store the
urlof each row innews_results; it is the real article address, so use it as the key when comparing runs. - On a later run, open only the rows whose
urlis new and read theirsource,dateandsnippet. - Raise
body.pagewhile the rows on a page are still new.
Baidu's operators help separate a brand from namesakes: a quoted phrase keeps the brand name together, and a leading minus sign removes an unrelated word from the query. A news page holds 10 articles and body.page stops at 76, so stop paging as soon as a page contains only rows you have already stored.
Resolve Baidu redirect links to real pages
Organic rows already carry the destination in url, while the redirect in link is what to resolve when only that value was stored. Two routes lead to the real address:
- Set
body.resolve_linksto true onbaidu-search, so results without a printed address, such as widget cards and top stories, are followed through Baidu's redirect during the same call. - Send a single redirect link in
body.urltobaidu-resolve-linkand readurlanddomainfrom the returned data.
The first route can add up to a second to a search call, whereas the second needs one extra call per link. Ad click links are not followed by either route.
Gather images and videos for a topic
Image and video searches take the same body.q and page through results with body.page, so one topic can feed both lists:
- Search
baidu-imagesfor the topic and keeporiginal,source_page,widthandheightfor each row. - Use
has_moreto decide whether to request the next page of 30 images. - Search
baidu-videoswith the same phrase and keep theurl,sourceanddurationof each row. - Show
thumbnailbeside either kind of row as its preview.
The original field is the image file itself and source_page is the page that shows it, so keep both when an image has to be traced back to its page. A page holds 30 images but about 10 videos, so the same page number points at a different number of rows in each operation.
Narrow a Baidu search to documents and date ranges
Several filters of baidu-search can be set in one call, which turns a broad query into a targeted document search such as PDF reports from one domain within a date window:
- Put the topic in
body.qand setbody.file_typetopdf. - Set
body.scopetotitlewhen the topic words must appear in the page title. - Add
body.siteto stay on one domain. - Use
body.date_fromandbody.date_tofor a fixed range, orbody.time_periodfor the pastweekormonth.
Use body.time_period for a window that ends today and the date pair for a range that stays fixed between runs.
Baidu Search in brief
Beyond web results, Baidu introduced a news search engine and a picture search engine in 2003, and Baidu Video is described as a YouTube-like search service for videos on Chinese websites. In 2019 Baidu added a news search option that lets users choose results from all media outlets or only from Baijiahao, its own news aggregation platform. Marketers researching Chinese keywords use Baidu autocomplete and related searches to see how Chinese users phrase queries instead of translating English keywords.
[
{
"body": {
"q": "笔记本"
}
},
{
"body": {
"q": "笔记本电脑",
"num": 20,
"time_period": "month"
}
}
]{
"body": {
"q": "数据安全 白皮书",
"file_type": "pdf",
"scope": "title",
"date_from": "2026-01-01",
"date_to": "2026-10-31",
"num": 20
}
}[
{
"body": {
"q": "比亚迪",
"sort": "date",
"page": 1
}
},
{
"body": {
"q": "比亚迪",
"sort": "date",
"page": 2
}
}
]Server-side request template
This server-side template shows authentication and request identity using the first operation of this API. Choose the operation for your use case and check its current availability and price on the API page. After a timeout, resend the unchanged request with the same Idempotency-Key.
The gateway request is always POST.
Use a JSON object with the documented path, query, headers and body locations; omit unused locations. input.headers is JSON data for the operation, not browser request headers. Do not put credentials here. Keep body arrays, scalar values and null as documented; omission is different from null.
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/baidu/baidu-images' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"q":"熊猫"}}'Integration checklist
- The API key is stored in a server-side secret manager and never sent to a browser.
- Each request carries its own Idempotency-Key, kept until the request has a final answer.
- The integration reads ok and error.code and handles each error code as the error table describes.
- An uncertain POST is inspected using its original identity, never blindly repeated with a new one.
- The operation’s current availability and price have been checked on its API page.
Baidu Search API overview and prices · Read the API reference · Try it in the playground