Baidu Search
Search the web via Baidu AI Search API.
Usage
CODEBLOCK0
Request Parameters
| Param | Type | Required | Default | Description |
|---|
| query | str | yes | - | Search query |
| count |
int | no | 10 | Number of results to return, range 1-50 |
| freshness | str | no | Null | Time range, two formats: format one is ”YYYY-MM-DDtoYYYY-MM-DD“, and format two includes pd, pw, pm, and py, representing the past 24 hours, past 7 days, past 31 days, and past 365 days respectively |
Examples
CODEBLOCK1
Current Status
Fully functional.
百度搜索
通过百度AI搜索API进行网络搜索。
使用方法
bash
python3 skills/baidu-search/scripts/search.py
请求参数
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|
| query | 字符串 | 是 | - | 搜索查询 |
| count |
整数 | 否 | 10 | 返回结果数量,范围1-50 |
| freshness | 字符串 | 否 | Null | 时间范围,两种格式:格式一为YYYY-MM-DDtoYYYY-MM-DD,格式二包括pd、pw、pm、py,分别表示过去24小时、过去7天、过去31天、过去365天 |
示例
bash
基础搜索
python3 scripts/search.py {query:人工智能}
新鲜度第一种格式YYYY-MM-DDtoYYYY-MM-DD示例
python3 scripts/search.py {
query:最新新闻,
freshness:2025-09-01to2025-09-08
}
新鲜度第二种格式pd、pw、pm、py示例
python3 scripts/search.py {
query:最新新闻,
freshness:pd
}
设置返回结果数量
python3 scripts/search.py {
query:旅游景点,
count: 20,
}
当前状态
功能完整可用。