Zhihu Column Article Details API
通过 JustOneAPI 获取知乎专栏文章详情,支持内容研究与归档。
基于DuckDuckGo API的多类型网络搜索技能,支持文本、新闻、图片和视频检索。
openclaw skills install @billyutw/web-search命令、参数、文件名以原文为准
使用 DuckDuckGo 的 API 搜索网页,获取跨网页、新闻文章、图片和视频的信息。支持多种返回格式(文本、Markdown、JSON),并提供时间范围、地区和安全搜索等筛选选项。
当用户提出以下请求时,请使用此技能:
安装所需依赖:
pip install duckduckgo-search该库提供了对 DuckDuckGo 搜索 API 的简单 Python 接口,无需 API 密钥或身份验证。
搜索网页和相关信息:
python scripts/search.py "<查询>"示例:
python scripts/search.py "python asyncio 教程"返回前 10 个网页结果,包含标题、URL 和描述,以清晰的文本格式呈现。
控制返回的结果数量:
python scripts/search.py "<查询>" --max-results <N>示例:
python scripts/search.py "机器学习框架" --max-results 20适用场景:
按时效性过滤结果:
python scripts/search.py "<查询>" --time-range <d|w|m|y>时间范围选项:
d - 近一天w - 近一周m - 近一月y - 近一年示例:
python scripts/search.py "人工智能新闻" --time-range w适用于:
专门搜索新闻文章:
python scripts/search.py "<查询>" --type news示例:
python scripts/search.py "气候变化" --type news --time-range w --max-results 15新闻结果包含:
搜索图片:
python scripts/search.py "<查询>" --type images示例:
python scripts/search.py "山间日落" --type images --max-results 20图片筛选选项:
尺寸筛选:
python scripts/search.py "风景照片" --type images --image-size Large选项:Small、Medium、Large、Wallpaper
颜色筛选:
python scripts/search.py "抽象艺术" --type images --image-color Blue选项:color、Monochrome、Red、Orange、Yellow、Green、Blue、Purple、Pink、Brown、Black、Gray、Teal、White
类型筛选:
python scripts/search.py "图标" --type images --image-type transparent选项:photo、clipart、gif、transparent、line
布局筛选:
python scripts/search.py "壁纸" --type images --image-layout Wide选项:Square、Tall、Wide
图片结果包含:
搜索视频:
python scripts/search.py "<查询>" --type videos示例:
python scripts/search.py "python 教程" --type videos --max-results 15视频筛选选项:
时长筛选:
python scripts/search.py "烹饪食谱" --type videos --video-duration short选项:short、medium、long
分辨率筛选:
python scripts/search.py "纪录片" --type videos --video-resolution high选项:high、standard
视频结果包含:
进行区域化搜索结果:
python scripts/search.py "<查询>" --region <地区代码>常见地区代码:
us-en - 美国(英语)uk-en - 英国(英语)ca-en - 加拿大(英语)au-en - 澳大利亚(英语)de-de - 德国(德语)fr-fr - 法国(法语)wt-wt - 全球(默认)示例:
python scripts/search.py "本地新闻" --region us-en --type news控制安全搜索过滤:
python scripts/search.py "<查询>" --safe-search <on|moderate|off>选项:
on - 严格过滤moderate - 平衡过滤(默认)off - 不过滤示例:
python scripts/search.py "医学信息" --safe-search on选择结果的输出格式:
文本格式(默认):
python scripts/search.py "量子计算"以编号列表形式展示的干净可读纯文本。
Markdown 格式:
python scripts/search.py "量子计算" --format markdown带标题、加粗和链接的格式化 Markdown。
JSON 格式:
python scripts/search.py "量子计算" --format json结构化的 JSON 数据,便于程序处理。
将搜索结果保存到文件中:
python scripts/search.py "<查询>" --output <文件路径>示例:
python scripts/search.py "人工智能" --output ai_results.txt
python scripts/search.py "AI 新闻" --type news --format markdown --output ai_news.md
python scripts/search.py "AI 研究" --format json --output ai_data.json文件格式由 --format 参数决定,而非文件扩展名。
1. 页面标题示例
URL: https://example.com/page
页面内容的简要描述...
2. 另一个结果
URL: https://example.com/another
另一个描述...## 1. 页面标题示例
**URL:** https://example.com/page
页面内容的简要描述...
## 2. 另一个结果
**URL:** https://example.com/another
另一个描述...[
{
"title": "页面标题示例",
"href": "https://example.com/page",
"body": "页面内容的简要描述..."
},
{
"title": "另一个结果",
"href": "https://example.com/another",
"body": "另一个描述..."
}
]获取某个主题的全面信息:
# 从网页获取概览
python scripts/search.py "机器学习基础" --max-results 15 --output ml_web.txt
# 获取最新新闻
python scripts/search.py "机器学习" --type news --time-range m --output ml_news.txt
# 查找教程视频
python scripts/search.py "机器学习教程" --type videos --max-results 10 --output ml_videos.txt跟踪特定主题的新闻动态:
python scripts/search.py "气候峰会" --type news --time-range d --format markdown --output daily_climate_news.md按特定条件搜索图片:
python scripts/search.py "数据可视化示例" --type images --image-type photo --image-size Large --max-results 25 --output viz_images.txt通过近期来源验证信息:
python scripts/search.py "待核实的具体说法" --time-range w --max-results 20查找学术相关主题的资料:
python scripts/search.py "量子纠缠研究" --time-range y --max-results 30 --output quantum_research.txt收集产品或公司相关信息:
python scripts/search.py "2025年电动汽车市场" --max-results 20 --format markdown --output ev_market.md
python scripts/search.py "电动汽车新闻" --type news --time-range m --output ev_news.txt当用户请求网络搜索时:
- 内容类型(网页、新闻、图片、视频)?
- 结果需要多新?
- 需要多少条结果?
- 是否有筛选要求?
- 选择合适的搜索类型(--type)
- 若时效性重要,设置时间范围(--time-range)
- 调整结果数量(--max-results)
- 应用过滤条件(图片尺寸、视频时长等)
- 文本格式适合快速阅读
- Markdown 格式适合文档编写
- JSON 格式便于后续处理
- 运行搜索命令
- 如需保存结果,指定文件路径
- 直接输出到标准输出供即时查看
- 如需读取已保存文件
- 提取 URL 或特定信息
- 合并多个搜索的结果
命令结构:
python scripts/search.py "<查询内容>" [选项]核心选项:
-t, --type - 搜索类型(web、news、images、videos)-n, --max-results - 最大结果数(默认值:10)--time-range - 时间筛选(d、w、m、y)-r, --region - 区域代码(如:us-en、uk-en)--safe-search - 安全搜索级别(on、moderate、off)-f, --format - 输出格式(text、markdown、json)-o, --output - 保存至文件图片专用选项:
--image-size - 尺寸筛选(Small、Medium、Large、Wallpaper)--image-color - 颜色筛选--image-type - 类型筛选(photo、clipart、gif、transparent、line)--image-layout - 布局筛选(Square、Tall、Wide)视频专用选项:
--video-duration - 时长筛选(short、medium、long)--video-resolution - 分辨率筛选(high、standard)获取完整帮助:
python scripts/search.py --help--time-range 获取最新信息--output 保留结果常见问题:
pip install duckduckgo-search局限性:
通过组合多种搜索类型获取全面信息:
# 网页概览
python scripts/search.py "主题" --max-results 15 --output topic_web.txt
# 最新新闻
python scripts/search.py "主题" --type news --time-range w --output topic_news.txt
# 图片资源
python scripts/search.py "主题" --type images --max-results 20 --output topic_images.txt使用 JSON 输出进行自动化处理:
python scripts/search.py "研究主题" --format json --output results.json
# 然后使用另一个脚本处理结果
python analyze_results.py results.json从网络搜索结果生成可检索的文档:
# 搜索多个相关主题
python scripts/search.py "主题1" --format markdown --output kb/主题1.md
python scripts/search.py "主题2" --format markdown --output kb/主题2.md
python scripts/search.py "主题3" --format markdown --output kb/主题3.md主搜索工具,实现 DuckDuckGo 搜索功能。主要特性:
该脚本可直接执行,并通过 --help 提供完整的命令行帮助。
已收录 1 个 Skill