# Baidu Search

Search Baidu Web via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by LiteScrape, pass parameters such as pn, q, rn, and retrieve structured data including organic result title, search snippet, source URL, and next result offset for source discovery, and search continuation, ready for production pipelines and AI agent automation.

Documentation: https://openany.si/baidu/baidu-search/e38288b7-b1a9-4056-8eb3-15c2968572e5/
API ID: e38288b7-b1a9-4056-8eb3-15c2968572e5
Provider: litescrape
Contract revision: 4
Method: POST
Endpoint: https://api.openany.si/v1/agent-apis/litescrape/api/baidu/search
Page update time: 2026-12-03T02:48:58.392Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: application/json
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.00015 / call
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:48:57.816Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "150",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Usage and limits
## Baidu Web Search API

POST q with optional pn and rn. organic\_results contains title, snippet, link and position; pn is a zero-based result offset, and next\_pn identifies the next offset when continuation is available.

## What You Can Build

- **Source discovery**: Build source-linked web lists from Unicode queries.
- **Search continuation**: Keep native offsets distinct from page numbers.

## Returned Data

| Field | Meaning |
| --- | --- |
| `organic_results[].title` | Organic result title. |
| `organic_results[].snippet` | Search snippet. |
| `organic_results[].link` | Source URL. |
| `organic_results[].position` | Position within the returned results. |
| `pagination.next_pn` | Next result offset when available. |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Baidu Search request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "timeout": {
          "type": "number",
          "description": "Total request execution budget in seconds, greater than 0 and at most 90. Supply in the query string for GET or POST. page_timeout cannot extend this budget.",
          "maximum": 90
        }
      }
    },
    "headers": {
      "type": "object",
      "properties": {}
    },
    "body": {
      "additionalProperties": false,
      "examples": [
        {
          "pn": 0,
          "q": "python documentation",
          "rn": 10
        }
      ],
      "properties": {
        "pn": {
          "default": 0,
          "description": "Zero-based result offset from 0 through 750, not a page number. Use pagination.next_pn or litescrape_pagination.next to continue.",
          "maximum": 750,
          "minimum": 0,
          "title": "Pn",
          "type": "integer",
          "x-litescrape": {
            "group": 1,
            "kind": "number",
            "label": "Result offset",
            "placeholder": "0",
            "summary": "Zero-based result offset from 0 through 750, not a page number. Use pagination.next_pn or litescrape_pagination.next to continue."
          }
        },
        "q": {
          "description": "Required search text, trimmed to 1 through 500 characters. Unicode queries are supported. Control characters are rejected.",
          "maxLength": 500,
          "minLength": 1,
          "title": "Q",
          "type": "string",
          "x-litescrape": {
            "group": 0,
            "label": "Query",
            "placeholder": "python documentation",
            "summary": "Required search text, trimmed to 1 through 500 characters. Unicode queries are supported. Control characters are rejected."
          }
        },
        "rn": {
          "default": 10,
          "description": "Requested result count: 10, 20, or 50. Defaults to 10. Baidu can return fewer web results when a page includes other result modules.",
          "enum": [
            10,
            20,
            50
          ],
          "title": "Rn",
          "type": "integer",
          "x-litescrape": {
            "group": 1,
            "kind": "select",
            "label": "Page size",
            "summary": "Requested result count: 10, 20, or 50. Defaults to 10. Baidu can return fewer web results when a page includes other result modules."
          }
        }
      },
      "required": [
        "q"
      ],
      "title": "Request",
      "type": "object",
      "description": "Get Baidu search results as JSON."
    }
  },
  "required": [
    "path",
    "query",
    "headers",
    "body"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "litescrape_pagination": {
      "type": "object",
      "properties": {
        "current": {
          "type": "integer"
        },
        "next": {
          "type": "string"
        },
        "next_pn": {
          "type": "integer"
        }
      }
    },
    "organic_results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "link": {
            "type": "string"
          },
          "position": {
            "type": "integer"
          },
          "snippet": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        }
      }
    },
    "pagination": {
      "type": "object",
      "properties": {
        "current": {
          "type": "integer"
        },
        "next": {
          "type": "string"
        },
        "next_pn": {
          "type": "integer"
        }
      }
    },
    "search_information": {
      "type": "object",
      "properties": {
        "organic_results_state": {
          "type": "string"
        }
      }
    },
    "search_metadata": {
      "type": "object",
      "properties": {
        "baidu_url": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "json_endpoint": {
          "type": "string"
        },
        "processed_at": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "total_time_taken": {
          "type": "number"
        }
      }
    },
    "search_parameters": {
      "type": "object",
      "properties": {
        "pn": {
          "type": "integer"
        },
        "q": {
          "type": "string"
        },
        "rn": {
          "type": "integer"
        }
      }
    },
    "submit_feedback_for_this_response_here": {
      "type": "string"
    }
  }
}
```

## Request example
Scenario: Official example
```bash
curl \
  'https://api.openany.si/v1/agent-apis/litescrape/api/baidu/search' \
  -X POST \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "pn": 0,
  "q": "python documentation",
  "rn": 10
}'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "litescrape_pagination": {
    "current": 1,
    "next": "https://api.litescrape.com/api/baidu/search?q=python+documentation&pn=10&rn=10",
    "next_pn": 10
  },
  "organic_results": [
    {
      "link": "https://docs.python.org/",
      "position": 1,
      "snippet": "Documentation, tutorials and reference for Python.",
      "title": "Python documentation"
    }
  ],
  "pagination": {
    "current": 1,
    "next": "https://www.baidu.com/s?wd=python+documentation&pn=10&rn=10",
    "next_pn": 10
  },
  "search_information": {
    "organic_results_state": "Results found"
  },
  "search_metadata": {
    "baidu_url": "https://www.baidu.com/s?wd=python+documentation&pn=0&rn=10&ie=utf-8",
    "created_at": "2026-10-09T00:00:00+00:00",
    "id": "example-baidu-search",
    "json_endpoint": "https://api.litescrape.com/api/baidu/search?q=python+documentation&pn=0&rn=10",
    "processed_at": "2026-10-09T00:00:01+00:00",
    "status": "Success",
    "total_time_taken": 1.0
  },
  "search_parameters": {
    "pn": 0,
    "q": "python documentation",
    "rn": 10
  },
  "submit_feedback_for_this_response_here": "https://ecll-litescrape-v3--site-api-web.modal.run/api/feedback/example-not-a-valid-token"
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Can I search using Chinese text?
q supports Unicode queries with 1–500 characters after trimming. Control characters are rejected; use the q field rather than a source-site wd parameter.

### Is pn a page number?
No. pn is a zero-based result offset from 0 to 750. Continue using returned next_pn while keeping the same query and count settings.

### Which result counts are supported?
rn accepts 10, 20 or 50 and defaults to 10. Baidu may return fewer web records when a page also includes other result modules.

### Does the response represent the full search index?
No exhaustive collection is promised. Keep returned source links and continuation context, and read the actual result count rather than multiplying the requested count by a page number.

### Where should I set the request timeout?
Set timeout in the query string, including for POST requests. It must be greater than 0 and at most 90 seconds; page_timeout cannot extend this total execution budget.

### Can I add arbitrary parameters to the JSON body?
Use the body fields exposed by this implementation. Its JSON schema rejects additional properties; query parameters such as timeout belong outside the JSON body.

## Available implementations
- litescrape: https://openany.si/baidu/baidu-search/e38288b7-b1a9-4056-8eb3-15c2968572e5/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
