Sand AISand AI MAGI-2MAGI-2 hiện đã có trên SandBase: video 1080p với âm thanh gốcDùng thử ngay

Baidu Search

Tài liệu API
https://api.sandbase.ai/v1/api/baidu/search

Get Baidu web results for a query with organic results, answer boxes, related searches and pagination.

Giá
$0.01USD / lượt gọi
Phương thức
POST
Phản hồi
JSON
Tham số
1 bắt buộc · 11 tùy chọn

Phòng thử nghiệm

Đầu vào
Parameter defines the search query, including all Baidu search operators. (e.g., `inurl:`, `site:`, `intitle:`, etc.).
Parameter defines which language to restrict results. Available options: `1` - All languages `2` - Simplified Chinese `3` - Traditional Chinese
Parameter defines the result offset. It skips the given number of results. It's used for pagination. (e.g., `0` (default) is the first page of results, `10` is the 2nd page of results, `20` is the 3rd page of results, etc.).
Parameter defines the maximum number of results to return, limited to 50. (e.g., `10` (default) returns 10 results, `30` returns 30 results, and `50` returns 50 results). This parameter is only available for **desktop and tablet** searches.
Parameter defines the time period for results. (e.g., `stf=1793918685,1794523485|stftype=1` only returns results from the past 7 days. First integer within the parameter,`1793918685` is Unix Timestamp for 7 days ago. Second integer,`1794523485` is Unix Timestamp for now.).
Similar to using `inurl:` or `intitle:`. (e.g., `1` to search by page title, `2` to search by web address.).
Similar to using `site:`. (e.g., `q6=the API.com` to search for results only from the domain `the API.com`).
Defines the previous search query.
Defines the original search query when navigated from a related search.
Defines the originating search type. (e.g., `8` is a normal search, `3` is from the suggestion list, and `1` is a related search.
Parameter defines the device to use to get the results. It can be set to `desktop` (default) to use a regular browser, `tablet` to use a tablet browser (currently using iPads), or `mobile` to use a mobile browser.
Parameter defines the fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details.
Đầu raSẵn sàng

Đầu ra của bạn sẽ xuất hiện ở đây

Hoàn tất đầu vào, rồi nhấp Run.

README API

Baidu Search

Get Baidu web results for a query with organic results, answer boxes, related searches and pagination.

Request

curl -X POST "https://api.sandbase.ai/v1/api/baidu/search" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"q": "人工智能"}'

The result is returned in outputs[0].data as structured JSON.

Parameters

NameTypeRequiredDescription
qstringYesParameter defines the search query, including all Baidu search operators. (e.g., inurl:, site:, intitle:, etc.).
ctstringNoParameter defines which language to restrict results. Available options: 1 - All languages 2 - Simplified Chinese 3 - Traditional Chinese
pnstringNoParameter defines the result offset. It skips the given number of results. It's used for pagination. (e.g., 0 (default) is the first page of results, 10 is the 2nd page of results, 20 is the 3rd page of results, etc.).
rnstringNoParameter defines the maximum number of results to return, limited to 50. (e.g., 10 (default) returns 10 results, 30 returns 30 results, and 50 returns 50 results). This parameter is only available for desktop and tablet searches.
gpcstringNoParameter defines the time period for results. (e.g., stf=1793918685,1794523485/stftype=1 only returns results from the past 7 days. First integer within the parameter,1793918685 is Unix Timestamp for 7 days ago. Second integer,`1794523
q5stringNoSimilar to using inurl: or intitle:. (e.g., 1 to search by page title, 2 to search by web address.).
q6stringNoSimilar to using site:. (e.g., q6=the API.com to search for results only from the domain the API.com).
bsstringNoDefines the previous search query.
oqstringNoDefines the original search query when navigated from a related search.
fstringNoDefines the originating search type. (e.g., 8 is a normal search, 3 is from the suggestion list, and 1 is a related search.
devicestringNoParameter defines the device to use to get the results. It can be set to desktop (default) to use a regular browser, tablet to use a tablet browser (currently using iPads), or mobile to use a mobile browser.
json_restrictorstringNoParameter defines the fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details.

Pricing

$0.010 per successful call. Failed calls are not charged.

Khám phá thêm

APIs liên quan

Tất cả APIs
APIGiáPhản hồi
Baidu SearchAPI này
Baidu
$0.01 mỗi lần gọiJSON
Baidu$0.03 mỗi lần gọiJSON
Baidu$0.03 mỗi lần gọiJSON
Baidu$0.01 mỗi lần gọiJSON
Baidu$0.03 mỗi lần gọiJSON
Baidu$0.015 mỗi lần gọiJSON

Câu hỏi

FAQ

Làm thế nào để dùng API Baidu Search?

Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/baidu/search với khóa API SandBase của bạn trong tiêu đề Authorization (Bearer) và các tham số trong phần thân JSON. Bạn cũng có thể thử trực tiếp trong Playground trên trang này mà không cần viết code.

API Baidu Search có giá bao nhiêu?

$0.01 mỗi lần gọi, được tính từ số dư SandBase của bạn. Bạn chỉ bị tính phí cho các lần gọi bạn thực hiện; không có gói đăng ký.

API Baidu Search chấp nhận những tham số nào?

Bắt buộc: q (string). Tùy chọn: ct (string), pn (string), rn (string), gpc (string), q5 (string) và q6 (string) và 5 mục khác. Bảng Parameters và Playground trên trang này liệt kê mọi trường.

API Baidu Search trả về gì?

Phản hồi JSON được trả về trong cùng một yêu cầu HTTP (đồng bộ).

Tôi có cần tài khoản nhà phát triển hoặc API key của Baidu không?

Không. Baidu Search chạy thông qua SandBase, nên chỉ cần một API key SandBase là đủ cho endpoint này và mọi API cùng model khác trong danh mục. Bạn không cần đăng ký riêng để có quyền truy cập API của Baidu.