SERP
Baidu SERP
Baidu search results — organic rankings on China's dominant search engine.
POST
$0.01/call/v1/serp/baiduUsage
const res = await fetch('https://api.yepapi.com/v1/serp/baidu', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ query: 'cloud computing services', depth: 10 }),
});
const { data } = await res.json();
console.log(data);curl -X POST https://api.yepapi.com/v1/serp/baidu \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "cloud computing services", "depth": 10}'Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
query | string | Yes | Search query to look up on Baidu | — |
depth | number | No | Number of results to return | 10 |
location_code | number | No | Target country code (e.g., 2840 for US). See Location Codes. | 2840 |
language | string | No | ISO language code (e.g., en, es) | "en" |
Response
{
"ok": true,
"data": {
"query": "cloud computing",
"totalResults": 0,
"results": []
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.query | string | The search query that was executed on Baidu |
data.totalResults | number | Total number of Baidu results for the query |
data.results | object[] | Array of search result items (may be empty for some queries) |
data.results[].position | number | Position in search results (1-indexed) |
data.results[].type | string | Result type (e.g., organic) |
data.results[].title | string | Title of the search result |
data.results[].url | string | URL of the search result page |
data.results[].description | string | Snippet or description shown in Baidu results |
data.results[].domain | string | Domain of the result URL |
Under the Hood
Under the hood, this queries our SERP engine. We normalize the response format and flatten nested structures for consistency.