Chuyển đến nội dung
Skillpedia
Thu thập dữ liệu web260k · #552

duckduckgo-search

Skill này làm gì

Skill này cho phép AI của bạn chạy tìm kiếm web miễn phí trên DuckDuckGo. Phù hợp với người muốn kết quả tìm kiếm mà không phải thiết lập khóa tìm kiếm trả phí.

Khi nào nên dùng

  • ✓Khi bạn muốn AI tìm kiếm web và cụ thể cần kết quả từ DuckDuckGo.
  • ✓Khi công cụ tìm kiếm web chính không khả dụng, ví dụ vì chưa thiết lập khóa tìm kiếm.
  • ✓Khi bạn muốn tìm kiếm tin tức hoặc hình ảnh cùng với trang web.

Liên kết skill

https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/research/duckduckgo-search/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/research/duckduckgo-search/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tìm trên DuckDuckGo tin tức mới nhất về giá tấm pin mặt trời và liệt kê năm kết quả hàng đầu.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill kiểm tra xem công cụ dòng lệnh ddgs đã được cài chưa. Nếu có, AI chạy tìm kiếm qua nó. Nếu không, AI cài ddgs hoặc dùng các công cụ web có sẵn.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

DuckDuckGo Search

Free web search using DuckDuckGo. No API key required.

Preferred when web_search is unavailable or unsuitable (for example when FIRECRAWL_API_KEY is not set). Can also be used as a standalone search path when DuckDuckGo results are specifically desired.

Detection Flow

Check what is actually available before choosing an approach:

# Check CLI availability
command -v ddgs >/dev/null && echo "DDGS_CLI=installed" || echo "DDGS_CLI=missing"

Decision tree:

  1. If ddgs CLI is installed, prefer terminal + ddgs
  2. If ddgs CLI is missing, do not assume execute_code can import ddgs
  3. If the user wants DuckDuckGo specifically, install ddgs first in the relevant environment
  4. Otherwise fall back to built-in web/browser tools

Important runtime note:

  • Terminal and execute_code are separate runtimes
  • A successful shell install does not guarantee execute_code can import ddgs
  • Never assume third-party Python packages are preinstalled inside execute_code

Installation

Install ddgs only when DuckDuckGo search is specifically needed and the runtime does not already provide it.

# Python package + CLI entrypoint
pip install ddgs

# Verify CLI
ddgs --help

If a workflow depends on Python imports, verify that same runtime can import ddgs before using from ddgs import DDGS.

Method 1: CLI Search (Preferred)

Use the ddgs command via terminal when it exists. This is the preferred path because it avoids assuming the execute_code sandbox has the ddgs Python package installed.

# Text search
ddgs text -q "python async programming" -m 5

# News search
ddgs news -q "artificial intelligence" -m 5

# Image search
ddgs images -q "landscape photography" -m 10

# Video search
ddgs videos -q "python tutorial" -m 5

# With region filter
ddgs text -q "best restaurants" -m 5 -r us-en

# Recent results only (d=day, w=week, m=month, y=year)
ddgs text -q "latest AI news" -m 5 -t w

# JSON output for parsing
ddgs text -q "fastapi tutorial" -m 5 -o json

CLI Flags

Flag Description Example
-q Query — required -q "search terms"
-m Max results -m 5
-r Region -r us-en
-t Time limit -t w (week)
-s Safe search -s off
-o Output format -o json

Method 2: Python API (Only After Verification)

Use the DDGS class in execute_code or another Python runtime only after verifying that ddgs is installed there. Do not assume execute_code includes third-party packages by default.

Safe wording:

  • "Use execute_code with ddgs after installing or verifying the package if needed"

Avoid saying:

  • "execute_code includes ddgs"
  • "DuckDuckGo search works by default in execute_code"

Important: max_results must always be passed as a keyword argument — positional usage raises an error on all methods.

Text Search

Best for: general research, companies, documentation.

from ddgs import DDGS

with DDGS() as ddgs:
    for r in ddgs.text("python async programming", max_results=5):
        print(r["title"])
        print(r["href"])
        print(r.get("body", "")[:200])
        print()

Returns: title, href, body

News Search

Best for: current events, breaking news, latest updates.

from ddgs import DDGS

with DDGS() as ddgs:
    for r in ddgs.news("AI regulation 2026", max_results=5):
        print(r["date"], "-", r["title"])
        print(r.get("source", ""), "|", r["url"])
        print(r.get("body", "")[:200])
        print()

Returns: date, title, body, url, image, source

Image Search

Best for: visual references, product images, diagrams.

from ddgs import DDGS

with DDGS() as ddgs:
    for r in ddgs.images("semiconductor chip", max_results=5):
        print(r["title"])
        print(r["image"])
        print(r.get("thumbnail", ""))
        print(r.get("source", ""))
        print()

Returns: title, image, thumbnail, url, height, width, source

Video Search

Best for: tutorials, demos, explainers.

from ddgs import DDGS

with DDGS() as ddgs:
    for r in ddgs.videos("FastAPI tutorial", max_results=5):
        print(r["title"])
        print(r.get("content", ""))
        print(r.get("duration", ""))
        print(r.get("provider", ""))
        print(r.get("published", ""))
        print()

Returns: title, content

Câu hỏi thường gặp

Nó có cần khóa API không?

Không. Skill nói tìm kiếm DuckDuckGo miễn phí và không cần khóa.

Vì sao import Python có thể thất bại?

Skill lưu ý rằng terminal và trình chạy code là hai nơi riêng biệt, nên một gói cài ở nơi này có thể không dùng được ở nơi kia.

Nó có tìm hình ảnh không?

Có. Skill có nhắc đến tìm kiếm hình ảnh cùng với tìm kiếm web và tin tức.

Chi tiết

Mô tả gốc của tác giả

Free keyless web, news, and image search via ddgs.

repo: NousResearch/hermes-agent

Độ phổ biến

Sao GitHub
260k
Vị trí xếp hạng
#552
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự