← 返回 Skills 市场
249
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install duckduckgo-search-skills
功能描述
Search the web using DuckDuckGo. No API key required. Supports instant answers and HTML scraping modes. Privacy-focused search alternative.
使用说明 (SKILL.md)
DuckDuckGo Search Skill
使用 DuckDuckGo 进行隐私保护的网页搜索,无需 API Key。
特点
- ✅ 无需 API Key - 直接使用
- ✅ 隐私保护 - 不追踪用户
- ✅ 两种模式 - Instant API / HTML Scraping
- ✅ 免费无限制 - 无配额限制
使用方法
基本搜索
python3 scripts/duckduckgo_search.py "搜索关键词"
指定结果数量
python3 scripts/duckduckgo_search.py "Python 教程" -n 10
选择搜索模式
# Instant 模式(快速,适合事实性问题)
python3 scripts/duckduckgo_search.py "Python 是什么" --mode instant
# HTML 模式(完整搜索结果)
python3 scripts/duckduckgo_search.py "Python 教程" --mode html
带关键信息总结
python3 scripts/duckduckgo_search.py "伊朗局势" --summarize
JSON 输出
python3 scripts/duckduckgo_search.py "API" --json
参数说明
| 参数 | 说明 | 默认值 |
|---|---|---|
query |
搜索关键词(必需) | - |
-n, --top-k |
返回结果数量 | 5 |
--mode |
搜索模式:instant / html |
html |
--fetch-content |
抓取网页内容(仅 html) | false |
--summarize |
生成关键信息总结 | false |
--json |
输出原始 JSON | false |
搜索模式对比
| 模式 | 优点 | 缺点 | 适用场景 |
|---|---|---|---|
| Instant | 快速、稳定 | 结果有限 | 事实性问题、定义查询 |
| HTML | 完整搜索结果 | 可能被反爬 | 一般搜索、需要多个结果 |
Instant 模式示例
python3 scripts/duckduckgo_search.py "Python 编程语言"
输出:
🔍 DuckDuckGo 搜索结果 (3 条)
============================================================
1. Python (programming language) - Wikipedia
🔗 https://en.wikipedia.org/wiki/Python_(programming_language)
📝 Python is a high-level, general-purpose programming language...
📊 来源:instant
2. Python.org
🔗 https://www.python.org/
📝 The official home of the Python Programming Language...
📊 来源:instant
HTML 模式示例
python3 scripts/duckduckgo_search.py "Python 入门教程" --mode html -n 10
输出格式
标准输出(默认)
🔍 DuckDuckGo 搜索结果 (5 条)
============================================================
1. 标题
🔗 https://example.com
📝 内容摘要...
📊 来源:instant/html
JSON 输出
[
{
"title": "标题",
"url": "https://example.com",
"snippet": "摘要",
"source": "instant",
"type": "abstract"
}
]
在 OpenClaw 中使用
自动搜索(根据 SOUL.md)
搜一下 Python 教程
手动调用
exec("python3 skills/duckduckgo-search/scripts/duckduckgo_search.py '关键词' -n 5")
限制与注意事项
⚠️ 速率限制
- DuckDuckGo 没有官方 API,使用 HTML 端点可能被限制
- 建议请求间隔 2-5 秒
- 大量请求可能触发 403 错误
⚠️ 结果质量
- Instant 模式:只返回"即时答案"和相关主题,不是完整搜索
- HTML 模式:返回完整结果,但解析可能不稳定
⚠️ 反爬虫
- DuckDuckGo 可能检测并阻止自动化请求
- 如遇 403 错误,稍后重试
- 生产环境建议使用官方 API(如 Tavily、Brave)
与 Tavily 搜索对比
| 特性 | DuckDuckGo | Tavily |
|---|---|---|
| API Key | 不需要 | 需要 |
| 成本 | 免费 | 免费额度 + 付费 |
| 结果质量 | 一般 | 优秀(AI 总结) |
| 稳定性 | 一般 | 高 |
| 适用场景 | 轻量搜索 | 生产环境 |
建议:
- 日常轻量搜索 → DuckDuckGo
- 生产环境/高质量需求 → Tavily
故障排除
问题 1:无搜索结果
原因:Instant API 没有相关答案
解决:切换到 HTML 模式
python3 scripts/duckduckgo_search.py "关键词" --mode html
问题 2:403 Forbidden
原因:被 DuckDuckGo 限制
解决:
- 等待几分钟后重试
- 降低请求频率
- 使用代理 IP
问题 3:URL 无法访问
原因:DuckDuckGo 重定向链接未正确解析
解决:检查 extract_real_url() 函数
示例查询
# 事实性问题(Instant 模式)
python3 scripts/duckduckgo_search.py "Python 是谁创造的"
# 教程搜索(HTML 模式)
python3 scripts/duckduckgo_search.py "Python 入门教程" --mode html -n 10
# 技术文档
python3 scripts/duckduckgo_search.py "Python requests 库用法" --mode html
# 获取 JSON 用于程序处理
python3 scripts/duckduckgo_search.py "API" --json
相关技能
- tavily-search - AI 增强搜索(推荐用于生产)
- web_search - OpenClaw 内置搜索(需 Brave API)
- web_fetch - 网页内容提取
基于 DuckDuckGo 公开端点,仅供学习使用。生产环境建议使用官方 API。
安全使用建议
This skill appears to be what it claims: a Python-based DuckDuckGo search helper that can use the instant JSON API or scrape HTML. Before installing, consider: (1) If you enable --fetch-content, the script will make outbound HTTP requests to pages in search results — in sensitive environments that could reach internal endpoints (SSRF-like concern). (2) The script recommends scraping (HTML mode); heavy or automated scraping may trigger rate limits or legal/ethical issues — follow rate-limiting guidance in SKILL.md. (3) For production-critical, high-volume use, prefer an official API (as the SKILL.md itself suggests). If you want extra assurance, review the remainder of the script (the truncated portion handles output and maybe content fetching) to confirm there are no unexpected external endpoints or hidden logging/transmission of results to third parties.
功能分析
Type: OpenClaw Skill
Name: duckduckgo-search-skills
Version: 1.0.0
The skill is a standard implementation of a DuckDuckGo search tool using Python's built-in `urllib` and `re` libraries. It provides functionality for both the official Instant Answer API and the HTML-based search results without requiring external dependencies or API keys. The code in `scripts/duckduckgo_search.py` is transparent, lacks any high-risk execution patterns (like `eval` or `subprocess`), and strictly adheres to the functionality described in `SKILL.md`.
能力评估
Purpose & Capability
Name/description (DuckDuckGo search, no API key) match the included code and SKILL.md. The skill only requires python3 and uses DuckDuckGo instant JSON API and the DuckDuckGo HTML endpoint as described; no unexpected services, binaries, or credentials are requested.
Instruction Scope
SKILL.md instructs the agent to call the provided Python script with flags for instant/html/search/result-count/summarize and shows example exec() commands. The instructions do not ask the agent to read local files, environment secrets, or unrelated system state. One noteworthy capability: the script supports fetching page content from search results (--fetch-content) and will make outbound HTTP requests to result URLs; this is coherent with the stated feature but increases network activity and could access internal URLs if the environment permits.
Install Mechanism
No install spec; this is an instruction-only skill with a single Python script. Nothing is downloaded or extracted during install. Requiring python3 is proportional and expected.
Credentials
The skill declares no required environment variables, credentials, or config paths and the code does not reference secrets or other env vars. The lack of requested credentials is appropriate for a scraper/instant-answer search tool.
Persistence & Privilege
always is false and the skill does not request permanent/global privileges or modify other skills. It can be invoked by the model (normal default) but has no elevated persistence requirements.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install duckduckgo-search-skills - 安装完成后,直接呼叫该 Skill 的名称或使用
/duckduckgo-search-skills触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of DuckDuckGo search skill with privacy-focused web search.
- Supports both Instant API and HTML scraping search modes.
- No API key required—completely free to use.
- Command-line interface for configurable search, result count, output format (plain or JSON), and summarization.
- Includes rate-limit and anti-crawling guidance for reliability.
- Suitable for quick, lightweight search tasks; compare with Tavily or Brave for production use.
元数据
常见问题
duckduckgo-search-skills 是什么?
Search the web using DuckDuckGo. No API key required. Supports instant answers and HTML scraping modes. Privacy-focused search alternative. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 249 次。
如何安装 duckduckgo-search-skills?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install duckduckgo-search-skills」即可一键安装,无需额外配置。
duckduckgo-search-skills 是免费的吗?
是的,duckduckgo-search-skills 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
duckduckgo-search-skills 支持哪些平台?
duckduckgo-search-skills 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 duckduckgo-search-skills?
由 cscsxx(@cscsxx606)开发并维护,当前版本 v1.0.0。
推荐 Skills