Baidu API endpoint
Returns Baidu search-box autocomplete completions for a query prefix, in Baidu's own ranking order. Baidu never returns more than 10 suggestions per prefix; Chinese prefixes are supported.
/baidu/suggestMCP tool: baidu_suggest
Query parameters:
q: required. Search query prefix. Example: openai or 天气.count: optional. Suggestions to return. Defaults to 10, clamped to 1..10; Baidu never returns more than 10.Notable response behavior:
suggestions array, not an error.| Field | Filled in, of 10 checked | Values in the sample |
|---|---|---|
| position | 10 | 1 to 10, median 5 |
| query | 10 | “openai” and 9 other values |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| q | string | Yes | Search query prefix | openai | |
| count | integer | No | 10 | Suggestions to return; defaults to 10, clamped to 1..10 Minimum: 1. Maximum: 10. | 10 |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/baidu/suggest?q=openai&count=10" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"query": "天气",
"suggestions": [
{
"position": 1,
"query": "天气预报"
},
{
"position": 2,
"query": "天气预报云图"
},
{
"position": 3,
"query": "天气之子"
}
]
}
}Request schema
No body schema
Response schema
#/definitions/baidu.suggestResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | suggest.Response | No | ||||
| data.query | string | No | openai | |||
| data.suggestions | array | No | ||||
| data.suggestions[].position | integer | No | 1 | |||
| data.suggestions[].query | string | No | openai api key | |||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Missing or invalid parameters | #/definitions/app.Response |
| 429 | Rate limit exceeded | #/definitions/app.Response |
| 500 | Internal server error | #/definitions/app.Response |
| 503 | Baidu upstream request failed | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/baidu/suggest?q=openai&count=10" \
-H "x-api-key: $CRAWLORA_API_KEY"