Agent skill

Duckduckgo Search

by CraftOS-dev in CraftOS-dev/CraftBot

Performs web searches using DuckDuckGo to retrieve real-time information from the internet.

MITAuto-check passedProductivity & Automation

Install Duckduckgo Search

skills CLI
$ npx skills add CraftOS-dev/CraftBot --skill duckduckgo-search -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install CraftOS-dev/CraftBot duckduckgo-search --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/CraftOS-dev/CraftBot.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/duckduckgo-search .claude/skills/duckduckgo-search && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
duckduckgo-search
GitHub stars
392
Used in
1 other repo
Token cost
~2.3k tokens
SKILL.md length
132 words
Files
3
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

Performs web searches using DuckDuckGo to retrieve real-time information from the internet.

  • Works in 7 steps: 文本搜索 (Text Search) → 新闻搜索 (News Search) → 图片搜索 (Image Search) → …
  • The user needs to search for current events
  • SKILL.md covers 功能特性, 安装, 快速开始 and 搜索类型, plus 7 more sections
  • Calls python, pip and uv

What it does

Duckduckgo Search is an agent skill from CraftOS-dev/CraftBot. Performs web searches using DuckDuckGo to retrieve real-time information from the internet. Use when the user needs to search for current events, documentation, tutorials, or any information that requires web search capabilities.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files (for example `.clawhub/origin.json` and `_meta.json`).

It sits in Productivity & Automation, covering Web search. The repository describes itself as: One agent. Every kind of work. The licence is MIT.

When your agent uses it

  • The user needs to search for current events
  • Any information that requires web search capabilities

Example prompts

  • “Use the duckduckgo-search skill to perform web searches using DuckDuckGo to retrieve real-time information from the internet”
  • “/duckduckgo-search”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Bash(duckduckgo-search:*), Bash(python:*), Bash(pip:*), Bash(uv:*)

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. 文本搜索 (Text Search)
  2. 新闻搜索 (News Search)
  3. 图片搜索 (Image Search)
  4. 视频搜索 (Video Search)
  5. 即时回答 (Instant Answers)
  6. 建议搜索 (Suggestions)
  7. 地图搜索 (Maps Search)

What it can do on your machine

Read from SKILL.md and the folder at commit b50970c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(duckduckgo-search:*)
    • Bash(python:*)
    • Bash(pip:*)
    • Bash(uv:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python
    • pip
    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip and uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Duckduckgo Search loads about 2.3k tokens when it runs. Until then it costs about 62 tokens; SKILL.md has 132 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~62
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from CraftOS-dev/CraftBot at commit b50970c, republished under its MIT licence (© CraftOS-dev). 132 words, ~2,268 tokens.

Download SKILL.mdSave it as .claude/skills/duckduckgo-search/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
duckduckgo-search
description
Performs web searches using DuckDuckGo to retrieve real-time information from the internet. Use when the user needs to search for current events, documentation, tutorials, or any information that requires web search capabilities.
allowed-tools
Bash(duckduckgo-search:*), Bash(python:*), Bash(pip:*), Bash(uv:*)

DuckDuckGo Web Search Skill

这个技能通过 DuckDuckGo 搜索引擎实现网络搜索功能,帮助获取实时信息。

功能特性

  • 🔍 基于 DuckDuckGo 的隐私友好型搜索
  • 📰 支持新闻搜索
  • 🖼️ 支持图片搜索
  • 📹 支持视频搜索
  • 🌐 无需 API Key,免费使用
  • 🔒 保护隐私,不追踪用户

安装

bash
# 使用 uv 安装(推荐)
uv pip install duckduckgo-search

# 或使用 pip 安装
pip install duckduckgo-search

快速开始

命令行方式
bash
# 基础文本搜索
python -c "
from duckduckgo_search import DDGS

with DDGS() as ddgs:
    results = list(ddgs.text('Python tutorial', max_results=5))
    for r in results:
        print(f\"标题: {r['title']}\")
        print(f\"链接: {r['href']}\")
        print(f\"摘要: {r['body']}\")
        print('---')
"

搜索类型

最常用的搜索方式,返回网页结果:

bash
python -c "
from duckduckgo_search import DDGS

query = 'your search query'

with DDGS() as ddgs:
    results = list(ddgs.text(
        query,
        region='cn-zh',      # 地区设置:cn-zh(中国), us-en(美国), wt-wt(全球)
        safesearch='moderate', # 安全搜索:on, moderate, off
        timelimit='m',       # 时间范围:d(天), w(周), m(月), y(年), None(不限)
        max_results=10       # 最大结果数
    ))
    
    for i, r in enumerate(results, 1):
        print(f\"{i}. {r['title']}\")
        print(f\"   URL: {r['href']}\")
        print(f\"   摘要: {r['body'][:100]}...\")
        print()
"

搜索最新新闻:

bash
python -c "
from duckduckgo_search import DDGS

with DDGS() as ddgs:
    results = list(ddgs.news(
        'AI technology',
        region='wt-wt',
        safesearch='moderate',
        timelimit='d',       # d=过去24小时, w=过去一周, m=过去一月
        max_results=10
    ))
    
    for r in results:
        print(f\"📰 {r['title']}\")
        print(f\"   来源: {r['source']}\")
        print(f\"   时间: {r['date']}\")
        print(f\"   链接: {r['url']}\")
        print()
"

搜索图片资源:

bash
python -c "
from duckduckgo_search import DDGS

with DDGS() as ddgs:
    results = list(ddgs.images(
        'cute cats',
        region='wt-wt',
        safesearch='moderate',
        size='Medium',       # Small, Medium, Large, Wallpaper
        type_image='photo',  # photo, clipart, gif, transparent, line
        layout='Square',     # Square, Tall, Wide
        max_results=10
    ))
    
    for r in results:
        print(f\"🖼️ {r['title']}\")
        print(f\"   图片: {r['image']}\")
        print(f\"   缩略图: {r['thumbnail']}\")
        print(f\"   来源: {r['source']}\")
        print()
"

搜索视频内容:

bash
python -c "
from duckduckgo_search import DDGS

with DDGS() as ddgs:
    results = list(ddgs.videos(
        'Python programming',
        region='wt-wt',
        safesearch='moderate',
        timelimit='w',       # d, w, m
        resolution='high',   # high, standard
        duration='medium',   # short, medium, long
        max_results=10
    ))
    
    for r in results:
        print(f\"📹 {r['title']}\")
        print(f\"   时长: {r.get('duration', 'N/A')}\")
        print(f\"   来源: {r['publisher']}\")
        print(f\"   链接: {r['content']}\")
        print()
"
5. 即时回答 (Instant Answers)

获取 DuckDuckGo 的即时回答:

bash
python -c "
from duckduckgo_search import DDGS

with DDGS() as ddgs:
    results = ddgs.answers('what is python programming language')
    
    for r in results:
        print(f\"📚 {r['text']}\")
        print(f\"   来源: {r.get('url', 'DuckDuckGo')}\")
"
6. 建议搜索 (Suggestions)

获取搜索建议:

bash
python -c "
from duckduckgo_search import DDGS

with DDGS() as ddgs:
    suggestions = list(ddgs.suggestions('python'))
    
    print('🔍 搜索建议:')
    for s in suggestions:
        print(f\"   - {s['phrase']}\")
"

搜索地点信息:

bash
python -c "
from duckduckgo_search import DDGS

with DDGS() as ddgs:
    results = list(ddgs.maps(
        'coffee shop',
        place='Beijing, China',
        max_results=10
    ))
    
    for r in results:
        print(f\"📍 {r['title']}\")
        print(f\"   地址: {r['address']}\")
        print(f\"   电话: {r.get('phone', 'N/A')}\")
        print(f\"   坐标: {r['latitude']}, {r['longitude']}\")
        print()
"

实用脚本

通用搜索函数

创建一个可复用的搜索脚本:

bash
python -c "
from duckduckgo_search import DDGS
import json

def web_search(query, search_type='text', max_results=5, region='wt-wt', timelimit=None):
    '''
    执行 DuckDuckGo 搜索
    
    参数:
        query: 搜索关键词
        search_type: 搜索类型 (text, news, images, videos)
        max_results: 最大结果数
        region: 地区 (cn-zh, us-en, wt-wt)
        timelimit: 时间限制 (d, w, m, y)
    '''
    with DDGS() as ddgs:
        if search_type == 'text':
            results = list(ddgs.text(query, region=region, timelimit=timelimit, max_results=max_results))
        elif search_type == 'news':
            results = list(ddgs.news(query, region=region, timelimit=timelimit, max_results=max_results))
        elif search_type == 'images':
            results = list(ddgs.images(query, region=region, max_results=max_results))
        elif search_type == 'videos':
            results = list(ddgs.videos(query, region=region, timelimit=timelimit, max_results=max_results))
        else:
            results = []
    
    return results

# 使用示例
query = 'Python 3.12 new features'
results = web_search(query, search_type='text', max_results=5)

print(f'🔍 搜索: {query}')
print(f'📊 找到 {len(results)} 个结果')
print()

for i, r in enumerate(results, 1):
    print(f\"{i}. {r['title']}\")
    print(f\"   {r['href']}\")
    print(f\"   {r['body'][:150]}...\")
    print()
"
搜索并保存结果
bash
python -c "
from duckduckgo_search import DDGS
import json
from datetime import datetime

query = 'latest tech news'
output_file = f'search_results_{datetime.now().strftime(\"%Y%m%d_%H%M%S\")}.json'

with DDGS() as ddgs:
    results = list(ddgs.text(query, max_results=10))

# 保存到 JSON 文件
with open(output_file, 'w', encoding='utf-8') as f:
    json.dump({
        'query': query,
        'timestamp': datetime.now().isoformat(),
        'results': results
    }, f, ensure_ascii=False, indent=2)

print(f'✅ 搜索结果已保存到: {output_file}')
print(f'📊 共 {len(results)} 条结果')
"
多关键词批量搜索
bash
python -c "
from duckduckgo_search import DDGS
import time

queries = [
    'Python best practices 2024',
    'React vs Vue 2024',
    'AI development tools'
]

all_results = {}

with DDGS() as ddgs:
    for query in queries:
        print(f'🔍 搜索: {query}')
        results = list(ddgs.text(query, max_results=3))
        all_results[query] = results
        print(f'   找到 {len(results)} 个结果')
        time.sleep(1)  # 避免请求过快

print()
print('=' * 50)
print('📊 搜索汇总')
print('=' * 50)

for query, results in all_results.items():
    print(f'\n🔎 {query}:')
    for i, r in enumerate(results, 1):
        print(f\"   {i}. {r['title'][:60]}...\")
"

参数说明

地区代码 (region)
代码地区
cn-zh中国
us-en美国
uk-en英国
jp-jp日本
kr-kr韩国
wt-wt全球 (无地区限制)
时间限制 (timelimit)
值含义
d过去 24 小时
w过去一周
m过去一月
y过去一年
None不限制
安全搜索 (safesearch)
值含义
on严格过滤
moderate适度过滤 (默认)
off关闭过滤

错误处理

bash
python -c "
from duckduckgo_search import DDGS
from duckduckgo_search.exceptions import DuckDuckGoSearchException

try:
    with DDGS() as ddgs:
        results = list(ddgs.text('test query', max_results=5))
        print(f'✅ 搜索成功,找到 {len(results)} 个结果')
except DuckDuckGoSearchException as e:
    print(f'❌ 搜索出错: {e}')
except Exception as e:
    print(f'❌ 未知错误: {e}')
"

使用代理

如果需要使用代理:

bash
python -c "
from duckduckgo_search import DDGS

# 设置代理
proxy = 'http://127.0.0.1:7890'  # 替换为你的代理地址

with DDGS(proxy=proxy) as ddgs:
    results = list(ddgs.text('test query', max_results=5))
    print(f'通过代理搜索成功,找到 {len(results)} 个结果')
"

常见问题

安装失败?

bash
# 确保 pip 是最新版本
pip install --upgrade pip
pip install duckduckgo-search

# 或使用 uv
uv pip install duckduckgo-search

搜索无结果?

bash
# 检查网络连接
# 尝试使用代理
# 减少搜索关键词复杂度
# 检查地区设置是否正确

请求被限制?

bash
# 在多次搜索之间添加延迟
import time
time.sleep(1)  # 等待 1 秒

# 减少单次请求的结果数量
max_results=5  # 而不是 50

与其他工具集成

结合 browser-use 获取详细内容
bash
# 1. 先用 DuckDuckGo 搜索
python -c "
from duckduckgo_search import DDGS

with DDGS() as ddgs:
    results = list(ddgs.text('Python async tutorial', max_results=1))
    if results:
        url = results[0]['href']
        print(f'URL: {url}')
"

# 2. 用 browser-use 打开并获取详细内容
browser-use open <url_from_search>
browser-use state

注意事项

⚠️ 使用建议:

  1. 遵守使用频率限制:避免短时间内大量请求
  2. 合理设置结果数量:不要一次请求过多结果
  3. 添加适当延迟:批量搜索时在请求之间添加 time.sleep()
  4. 处理异常情况:始终添加错误处理代码
  5. 尊重版权:搜索结果仅供参考,注意内容版权

© CraftOS-dev, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files in skills/duckduckgo-search of CraftOS-dev/CraftBot.

  • SKILL.md
  • .clawhub/origin.json
  • _meta.json

Open the folder on GitHubat commit b50970c

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in CraftOS-dev/CraftBot, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Duckduckgo Search next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Duckduckgo Search compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Duckduckgo Search this skillCraftOS-dev/CraftBot3921 repos~2.3kAutomated safety check: PassMIT
Brave Searchbadlogic/pi-skills2.6k5 repos~592Automated safety check: PassMIT
Enterprise AI Scenario MapMetaInFLow/Enterprise-ai-scenario-map-skill632—~1.8kAutomated safety check: PassMIT
Web Searchjjyaoao/HelloAgents3.2k1 repos~5.6kAutomated safety check: PassMIT
Ddg SearchTheSyart/claude-agent-examples4051 repos~493Automated safety check: PassNone
Local Web SearchuluckyXH/OpenMOSS1.3k—~392Automated safety check: NotesMIT

Similar skills

  • Brave Search

    badlogic/pi-skills

    Web search and content extraction via Brave Search API. An agent skill from badlogic/pi-skills.

    2.6k GitHub starsUsed in 5 repos~592 tokens
    Productivity & AutomationAuto-check passed
  • Enterprise AI Scenario Map

    MetaInFLow/Enterprise-ai-scenario-map-skill

    企业AI场景地图生成报告工具。通过 web-search 深度调研企业信息,按照V2.1标准模板生成结构化AI应用场景地图报告,包含企业画像、业务诊断、行业实践、AI场景全量表、实施路径等完整内容。

    632 GitHub stars~1.8k tokensUpdated 6 mo ago
    Productivity & AutomationAuto-check passed
  • Web Search

    jjyaoao/HelloAgents

    Implement web search capabilities using the z-ai-web-dev-sdk.

    3.2k GitHub starsUsed in 1 repo~5.6k tokens
    Productivity & AutomationAuto-check passed
  • Ddg Search

    TheSyart/claude-agent-examples

    Web search without an API key using DuckDuckGo Lite via webfetch.

    405 GitHub starsUsed in 1 repo~493 tokens
    Productivity & AutomationAuto-check passed
  • Local Web Search

    uluckyXH/OpenMOSS

    A skill your agent uses when the user asks for web search that should run via the local-160 Responses API with websearch tool (base URL like https://proxy.example.com, model gpt-5.2-codex(xhigh)).

    1.3k GitHub stars~392 tokensUpdated 3 mo ago
    Productivity & AutomationAuto-check: notes
  • Ask Search

    ythx-101/ask-search

    Web search via self-hosted SearxNG. An agent skill from ythx-101/ask-search.

    537 GitHub stars~332 tokensUpdated 6 mo ago
    Productivity & AutomationAuto-check passed

More from CraftOS-dev/CraftBot

All 89 skills in this repo
  • Self Improvement

    CraftOS-dev/CraftBot

    Captures learnings, errors, and corrections to enable continuous improvement.

    392 GitHub starsUsed in 4 repos~4.9k tokens
    Auto-check passed
  • Outlook

    CraftOS-dev/CraftBot

    Read, search, and manage Outlook emails and calendar via Microsoft Graph API.

    392 GitHub starsUsed in 2 repos~1.8k tokens
    Auto-check passed
  • Nano Banana Pro

    CraftOS-dev/CraftBot

    Generate/edit images with Nano Banana Pro (Gemini 3 Pro Image).

    392 GitHub starsUsed in 5 repos~1.4k tokens
    Auto-check passed
  • Bbc News

    CraftOS-dev/CraftBot

    Fetch and display BBC News stories from various sections and regions via RSS feeds.

    392 GitHub starsUsed in 1 repo~555 tokens
    Auto-check passed
  • Airweave

    CraftOS-dev/CraftBot

    Context retrieval layer for AI agents across users' applications.

    392 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Telegram Bot Manager

    CraftOS-dev/CraftBot

    Manage and configure Telegram bots for OpenClaw. An agent skill from CraftOS-dev/CraftBot.

    392 GitHub stars~836 tokensUpdated today
    Auto-check passed

Questions about Duckduckgo Search

What does Duckduckgo Search do?

Performs web searches using DuckDuckGo to retrieve real-time information from the internet. Duckduckgo Search is an agent skill from CraftOS-dev/CraftBot. Performs web searches using DuckDuckGo to retrieve real-time information from the internet.

When should I use Duckduckgo Search?

Duckduckgo Search fits situations like: the user needs to search for current events; any information that requires web search capabilities.

How do I install Duckduckgo Search in Claude Code?

Run `npx skills add CraftOS-dev/CraftBot --skill duckduckgo-search -a claude-code`. Or copy the skill folder (skills/duckduckgo-search in CraftOS-dev/CraftBot) into .claude/skills/duckduckgo-search in your project. Claude Code loads it when a task matches its description.

How do I install Duckduckgo Search in Codex?

Run `npx skills add CraftOS-dev/CraftBot --skill duckduckgo-search -a codex`. Or copy the skill folder (skills/duckduckgo-search in CraftOS-dev/CraftBot) into .agents/skills/duckduckgo-search in your project. Codex loads it when a task matches its description.

Can I use Duckduckgo Search in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add CraftOS-dev/CraftBot --skill duckduckgo-search -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/duckduckgo-search, .gemini/skills/duckduckgo-search, .github/skills/duckduckgo-search and .opencode/skills/duckduckgo-search in your project.

What does Duckduckgo Search need to run?

Going by SKILL.md and its folder, Duckduckgo Search needs the command-line tools its instructions call (python, pip and uv). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Bash(duckduckgo-search:*), Bash(python:*), Bash(pip:*), Bash(uv:*).

Does Duckduckgo Search access the network?

SKILL.md contains no URLs. Its commands use pip and uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Duckduckgo Search safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Duckduckgo Search use?

Duckduckgo Search is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Duckduckgo Search use?

About 2.3k tokens (SKILL.md is roughly 9.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Duckduckgo Search?

Skills that share tags, products or a category with Duckduckgo Search: Brave Search (badlogic/pi-skills, 2.6k stars), Enterprise AI Scenario Map (MetaInFLow/Enterprise-ai-scenario-map-skill, 632 stars), Web Search (jjyaoao/HelloAgents, 3.2k stars) and Ddg Search (TheSyart/claude-agent-examples, 405 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Duckduckgo Search?

CraftOS-dev (a GitHub user) maintains it in CraftOS-dev/CraftBot, which has 392 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on October 9, 2026.

Source: CraftOS-dev/CraftBot on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.