← 返回
开发者工具 中文

ddg-search

DuckDuckGo HTML search scraper CLI with JSON, CSV, OpenSearch, markdown, and compact outputs.
DuckDuckGo HTML搜索抓CLI,支持JSON、CSV、OpenSearch、Markdown及紧凑输出。
camohiddendj
开发者工具 clawhub v2026.2.15 1 版本 100000 Key: 无需
★ 2
Stars
📥 2,199
下载
💾 38
安装
1
版本
#latest

概述

ddg-search

Search DuckDuckGo from the command line. Results go to stdout; progress goes to stderr.

Quick reference

ddg-search "query"                          # default: JSON, 5 pages
ddg-search -f compact "query"               # minimal-token output (best for LLM context)
ddg-search -f jsonl "query"                 # one JSON object per line
ddg-search -n 10 "query"                    # stop after 10 results
ddg-search -p 2 -f json "query"             # 2 pages, JSON
ddg-search -r us-en -t w "recent topic"     # US-English, past week
ddg-search -p 0 "query"                     # unlimited pages (scrape all)

Options

FlagLongDescriptionDefault
----------------------------------
-f--formatOutput format: json, jsonl, csv, opensearch, markdown, compactjson
-p--pagesMax pages to scrape (0 = unlimited)5
-n--max-resultsStop after this many resultsall
-r--regionRegion code (e.g. us-en, uk-en)all regions
-t--timeTime filter: d (day), w (week), m (month), y (year)none

Choosing a format

  • compact: Use for feeding results into an LLM. Minimal tokens, no JSON overhead.
  • jsonl: Use when piping to line-oriented tools or streaming processors.
  • json: Use when you need structured data with OpenSearch metadata, zero-click answers, and spelling corrections. Pipe through jq for field extraction (e.g. | jq '.items[].link').
  • csv: Use for spreadsheets or tabular analysis.
  • markdown: Use for human-readable output or embedding in documents.
  • opensearch: Use when producing Atom XML feeds.

Extracting URLs from JSON output

ddg-search "query" | jq -r '.items[].link'

Notes

  • DuckDuckGo may trigger bot detection. The tool stops early and returns whatever results were collected.
  • Random delays (800–2900 ms) are inserted between page fetches automatically.
  • Progress messages appear on stderr, so redirecting stdout captures only results.

版本历史

共 1 个版本

  • v2026.2.15 当前
    2026-03-28 22:37 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,777
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 324,044
developer-tools

Agent Browser

matrixy
专为AI智能体优化的无头浏览器自动化CLI,支持无障碍树快照和基于引用的元素选择。
★ 427 📥 118,146