qstringจำเป็น
Parameter defines the search query, including all Baidu search operators. (e.g., `inurl:`, `site:`, `intitle:`, etc.).
https://api.sandbase.ai/v1/api/baidu/searchGet Baidu web results for a query with organic results, answer boxes, related searches and pagination.
เอาต์พุตของคุณจะแสดงที่นี่
กรอกอินพุตให้ครบ แล้วคลิก Run
Get Baidu web results for a query with organic results, answer boxes, related searches and pagination.
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.
| Name | Type | Required | Description |
|---|---|---|---|
q | string | Yes | Parameter defines the search query, including all Baidu search operators. (e.g., inurl:, site:, intitle:, etc.). |
ct | string | No | Parameter defines which language to restrict results. Available options: 1 - All languages 2 - Simplified Chinese 3 - Traditional Chinese |
pn | string | No | 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.). |
rn | string | No | 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. |
gpc | string | No | 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,`1794523 |
q5 | string | No | Similar to using inurl: or intitle:. (e.g., 1 to search by page title, 2 to search by web address.). |
q6 | string | No | Similar to using site:. (e.g., q6=the API.com to search for results only from the domain the API.com). |
bs | string | No | Defines the previous search query. |
oq | string | No | Defines the original search query when navigated from a related search. |
f | string | No | Defines the originating search type. (e.g., 8 is a normal search, 3 is from the suggestion list, and 1 is a related search. |
device | string | No | 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. |
json_restrictor | string | No | 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. |
$0.010 per successful call. Failed calls are not charged.
เริ่มสร้าง
เอ็นด์พอยต์ของ Platform API ที่มีการยืนยันตัวตนและการติดตามการใช้งานแบบรวมศูนย์
curl -X POST "https://api.sandbase.ai/v1/api/baidu/search" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"q": "人工智能"
}'ตั้งค่า SandBase API key ของคุณในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอจะใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์
qstringจำเป็นParameter defines the search query, including all Baidu search operators. (e.g., `inurl:`, `site:`, `intitle:`, etc.).
ctstringParameter defines which language to restrict results. Available options: `1` - All languages `2` - Simplified Chinese `3` - Traditional Chinese
pnstringParameter 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.).
rnstringParameter 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.
gpcstringParameter 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.).
q5stringSimilar to using `inurl:` or `intitle:`. (e.g., `1` to search by page title, `2` to search by web address.).
q6stringSimilar to using `site:`. (e.g., `q6=the API.com` to search for results only from the domain `the API.com`).
bsstringDefines the previous search query.
oqstringDefines the original search query when navigated from a related search.
fstringDefines the originating search type. (e.g., `8` is a normal search, `3` is from the suggestion list, and `1` is a related search.
devicestringParameter 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_restrictorstringParameter defines the fields you want to include in the output, reducing payload size for faster response. See the JSON Restrictor documentation for more details.
บันทึกตัวอย่างการตอบกลับสำหรับ API นี้; จะไม่มีการส่งคำขอจริงเมื่อเปิดดู
ยังไม่มีการเผยแพร่การตอบกลับที่บันทึกไว้ ให้รัน API ใน Playground เพื่อดูการตอบกลับ
สำรวจเพิ่มเติม
| API | ราคา | การตอบกลับ |
|---|---|---|
Baidu SearchAPI นี้ Baidu | $0.01 ต่อการเรียก | JSON |
Baidu | $0.03 ต่อการเรียก | JSON |
Baidu | $0.03 ต่อการเรียก | JSON |
Baidu | $0.01 ต่อการเรียก | JSON |
Baidu | $0.03 ต่อการเรียก | JSON |
Baidu | $0.015 ต่อการเรียก | JSON |
คำถาม
ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/baidu/search โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด
$0.01 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน
ที่ต้องระบุ: q (string). ตัวเลือก: ct (string), pn (string), rn (string), gpc (string), q5 (string) และ q6 (string) และอีก 5 รายการ ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์
การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส)
ไม่จำเป็น Baidu Search ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง Baidu API แยกต่างหาก