ddgs
AGENTS.md3k starsChanged 17 months agoMITView on GitHub
ddgs (Dux Distributed Global Search) is a Python metasearch library that aggregates results from diverse web search services. It provides a DDGS class with methods like text(), images(), news(), videos(), books(), and extract(). Important: Tests make real HTTP requests and include a 2-second pause between tests (autouse fixture). Tests are slow by nature. Each search engine is a subclass of BaseSearchEngine[T] in ddgs/engines/. Key concepts: Pre-commit is managed via prek (not pre-commit). Install with prek install. Hooks run on commit:
- Installs packages
Trending
More talk lately.about the whole repository
Who's talking about deedy5/ddgs
- open-webui/open-webui“issue: unable to run openwebui 0.8.10 via UVX, DDGS v9.11.2 does not exist anymore.”GitHub · Mar 11, 2026 · 2 reactions
- NixOS/nixpkgs“ python3Packages.ddgs: 9.10.0 -> 9.11.4; primp: re-init at 1.1.3”GitHub · Mar 5, 2026 · 1 reactions
- open-webui/open-webui“duckduckgo web_search gives: KeyError('lite') - backend is not exist or disabled.”GitHub · Jan 2, 2026 · 1 reactions
- NixOS/nixpkgs“python3Packages.ddgs: 9.5.2 -> 9.5.4”GitHub · Aug 29, 2025 · 1 reactions
- NixOS/nixpkgs“python3Packages.ddgs: 9.5.1 -> 9.5.2”GitHub · Aug 11, 2025 · 1 reactions
The biggest 5 of 46 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 46
Talked about on GitHub (46 times).
On GitHub · 46
- Mar 11, 2026issue: unable to run openwebui 0.8.10 via UVX, DDGS v9.11.2 does not exist anymore. — open-webui/open-webui2 reactions · 16 comments
- Mar 5, 2026 python3Packages.ddgs: 9.10.0 -> 9.11.4; primp: re-init at 1.1.3 — NixOS/nixpkgs1 reaction · 4 comments
- Jan 2, 2026duckduckgo web_search gives: KeyError('lite') - backend is not exist or disabled. — open-webui/open-webui1 reaction · 10 comments
- Aug 29, 2025python3Packages.ddgs: 9.5.2 -> 9.5.4 — NixOS/nixpkgs1 reaction
- Aug 11, 2025python3Packages.ddgs: 9.5.1 -> 9.5.2 — NixOS/nixpkgs1 reaction
41 more on GitHub
- Oct 4, 2026build(deps): bump ddgs from 9.12.1 to 9.16.0 — SaiedZ/PenTron0 reactions
- Oct 2, 2026Update ddgs requirement from >=9.0.0 to >=9.16.0 — h4m1dr/gpt-researcher-muq9owh10 reactions
- Oct 1, 2026chore(deps): update ddgs requirement from >=9.0.0 to >=9.16.0 — huxleylee329-dancer/wenxianzongshu_research0 reactions
- Sep 28, 2026Update ddgs requirement from >=9.0.0 to >=9.16.0 — aurora806/gpt-researcher-maas0 reactions
- Sep 26, 2026Update ddgs requirement from >=9.0.0 to >=9.16.0 — Dies-Das-Ananas-Dresden/gpt-researcher-muifkmpw0 reactions
- Sep 26, 2026Update ddgs requirement from <10,>=9 to >=9.16.0,<10 — jonas050210/Mark-LIV-fixed0 reactions
- Sep 24, 2026Update ddgs requirement from >=9.0.0 to >=9.16.0 — julielee-dev/gpt-researcher-muftjp2z0 reactions
- Sep 22, 2026chore(deps): update ddgs requirement from >=9.0.0 to >=9.16.0 — ZimaAI/pharma-scope0 reactions
- Sep 21, 2026build(deps): update ddgs requirement from >=9.0.0 to >=9.16.0 in /backend — Thanu09-t/multiligual-voice-agent0 reactions
- Sep 21, 2026Update ddgs requirement from >=9.0.0 to >=9.16.0 — infinix736black-debug/gpt-researcher-muawpzo10 reactions
- Sep 18, 2026Update ddgs requirement from >=9.0.0 to >=9.16.0 — Harryautogpt/gpt-researcher-mu7evfuf0 reactions
- Sep 14, 2026chore(deps)(deps): update ddgs requirement from >=9.0.0 to >=9.16.0 — itsPremkumar/hermes-agi-asi-harness0 reactions · 1 comment
- Sep 12, 2026Update ddgs requirement from >=9.0.0 to >=9.16.0 — KarimAbdelkader-code/gpt-researcher0 reactions
- Sep 12, 2026chore(deps): update ddgs requirement from >=9.0.0 to >=9.16.0 — Fateorcloud/DeepResearch-KB0 reactions
- Sep 8, 2026Update ddgs requirement from >=9.0.0 to >=9.16.0 — thehonesttorus/gpt-researcher-mtsxn9ls0 reactions
- Sep 8, 2026chore(deps): update duckduckgo-search requirement from >=4.1.1 to >=8.1.1 — Vishaldubey2210/NewsTrace0 reactions
- Sep 7, 2026Update ddgs requirement from >=9.0.0 to >=9.16.0 — davidich117/gpt-researcher-mtqqf34s0 reactions
- Sep 5, 2026deps: bump ddgs from 9.14.4 to 9.16.0 — vigie-civique/moteur0 reactions
- Sep 4, 2026chore(deps): update ddgs requirement from >=9.14.4 to >=9.16.0 — maxisoft-vibe/concept-cards0 reactions
- Sep 4, 2026Bump ddgs from 9.14.4 to 9.16.0 — cocc-y/-0 reactions · 1 comment
- Sep 3, 2026Update ddgs requirement from >=9.0.0 to >=9.16.0 in /tools — tdwhere123/Write-Right0 reactions
- Sep 1, 2026chore(deps): bump ddgs from 9.15.0 to 9.16.0 — DhruvGarg111/py-goog-cli0 reactions
- Aug 31, 2026chore(deps): bump ddgs from 9.15.0 to 9.16.0 — jonathan308/omlx-fusion0 reactions
- Aug 31, 2026chore(deps): bump ddgs from 9.14.4 to 9.16.0 — nkapila6/mcp-local-rag0 reactions
- Aug 30, 2026chore(deps): update ddgs requirement from >=9.8.0 to >=9.16.0 — 2026st/FEbot0 reactions
- Aug 29, 2026Update ddgs requirement from >=9.0.0 to >=9.15.0 — Deepu1007/gpt-researcher0 reactions
- Aug 26, 2026chore(deps): update duckduckgo-search requirement from >=7.0.0 to >=8.1.1 — ajinb/agent-adam0 reactions
- Aug 25, 2026Bump ddgs from 9.14.4 to 9.15.0 in the python-dependencies group — MalcolmGomes/cosmic-vibe0 reactions
- Aug 24, 2026deps: bump ddgs from 9.14.2 to 9.15.0 — tridpt/TinNhanhAI0 reactions
- Aug 23, 2026deps: update duckduckgo-search requirement from >=6.0.0 to >=8.1.1 — Nurburgring-Zhang/moa-gateway-pro0 reactions
- Aug 20, 2026chore(deps): update ddgs requirement from >=9.0.0 to >=9.15.0 — Sahotin/PaperPilot-AI0 reactions
- Aug 20, 2026chore(deps): bump ddgs from 9.14.4 to 9.15.0 — HiTechLabTN/omlx0 reactions
- Aug 17, 2026Update ddgs requirement from >=9.0.0 to >=9.14.4 — khanaligarian1234-debug/gpt-researcher0 reactions
- Aug 15, 2026Update ddgs requirement from >=9.0.0 to >=9.14.4 — astudilloyepez851-tech/gpt-researcher-mstwql980 reactions
- Aug 13, 2026Update ddgs requirement from >=9.0.0 to >=9.14.4 — roselynn123/multi-agent-medical-research0 reactions
- Aug 7, 2026Update ddgs requirement from >=9.0.0 to >=9.14.4 — satendravron/gpt-reseacher0 reactions
- Aug 4, 2026Update duckduckgo-search requirement from >=6.0.0 to >=6.4.2 — shawnslat/SEER0 reactions
- Aug 3, 2026Update ddgs requirement from >=9.10.0 to >=9.14.4 — zzw4257/free-to-do-app0 reactions
- Aug 1, 2026Bump ddgs from 9.0.0 to 9.14.4 in /apps/python/search — mr-aryan-rana/outreach0 reactions
- Jul 30, 2026chore(deps): update ddgs requirement from >=9.0.0 to >=9.14.4 — LZJJJ-DOT/greenspec0 reactions
- Jul 22, 2026build(deps): update ddgs requirement from >=9.0.0 to >=9.14.4 — W-junk/GPT_researcher_inChina0 reactions
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- ddgsSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
25 rules. About 0 are common, 1 is distinctive, and 24 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
24
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 61
Run all hooks manually: prek
- Very specific: line 68
Use relative imports within the ddgs package (e.g., from .base import BaseSearchEngine).
- Very specific: line 69
Do not use from __future__ import annotations.
- Very specific: line 75
Use ClassVar for class-level attributes on classes.
- Very specific: line 76
Use Any sparingly; prefer concrete types.
- Very specific: line 77
Use generics (Generic[T]) for result-type polymorphism (see BaseSearchEngine[T]).
- Very specific: line 79
Use Literal for constrained string values (e.g., Literal["text", "images"]).
- Very specific: line 101
Use raise ... from ex when re-raising to preserve exception chains.
- Very specific: line 102
Use logger.info() / logger.warning() for non-fatal errors (not print().
- Very specific: line 108
Use @classmethod and @staticmethod where appropriate.
- Very specific: line 109
Use @dataclass for result data structures (see TextResult, ImagesResult, etc.).
- Very specific: line 110
Use __slots__ for lightweight wrapper classes (see Response).
- Very specific: line 111
Use cached_property for expensive lazy computations.
- Very specific: line 121
Add integration tests in tests/.
- Very specific: line 142
Test files live in tests/ and are named *_test.py.
- Very specific: line 143
Use pytest fixtures. The pause_between_tests autouse fixture adds a 2s delay between tests.
- Very specific: line 145
Use CliRunner from Click for CLI tests.
- Very specific: line 149
Do not use print() — use logging instead (ruff T20 bans print).
- Very specific: line 150
Do not use Optional[T] — use T | None.
- Very specific: line 151
Do not import TYPE_CHECKING-guarded modules at runtime.
- Very specific: line 152
Do not add .gitignore-listed or generated files (.mypy_cache/, build/, *.egg-info/).
- Very specific: line 153
Do not commit without running make lint and make test first.
- Distinctive: line 154
Do not skip the 2s test pause — it prevents rate-limiting from engines.
- Very specific: line 155
Do not create test_* files — use *_test.py naming convention.
- Very specific: line 159
If you need to search the web, extract URLs, or find images/news/videos/books, see skills/ddgs/SKILL.md for Python API, CLI, and MCP …
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md — Guide for Coding Agents
Project Overview
ddgs (Dux Distributed Global Search) is a Python metasearch library that aggregates results from diverse web search services. It provides a DDGS class with methods like text(), images(), news(), videos(), books(), and extract().
- Python: >=3.10 (tested up to 3.14)
- Dependencies:
click,primp,lxml - Package layout:
ddgs/(source),tests/(tests), optional extras:api(FastAPI),mcp(stdio)
Build / Lint / Test Commands
# Setup (creates .venv, installs dev deps)
python3 -m venv .venv
.venv/bin/pip install -e .[dev]
# Lint (ruff check + mypy type-check)
.venv/bin/ruff check --fix
.venv/bin/mypy --install-types --non-interactive .
# Format
.venv/bin/ruff format
# Run all tests
.venv/bin/pytest
# Run a single test file
.venv/bin/pytest tests/ddgs_test.py
# Run a single test function
.venv/bin/pytest tests/ddgs_test.py::test_text_search
# Make targets (use .venv/bin/python internally)
make lint
make format
make testImportant: Tests make real HTTP requests and include a 2-second pause between tests (autouse fixture). Tests are slow by nature.
Engine Architecture
Each search engine is a subclass of BaseSearchEngine[T] in ddgs/engines/. Key concepts:
ENGINESdict inddgs/engines/__init__.pymaps category → {name → engine class}.DDGS._search()spawns threads viaThreadPoolExecutor, callingengine.search()in parallel.- Results are deduplicated and ranked by
ResultsAggregatorandSimpleFilterRanker. BaseSearchEnginehandles HTTP requests, HTML parsing (lxml), and XPath-based result extraction.- Engine instances are cached per
DDGSinstance in_engines_cache.
Pre-commit Hooks
Pre-commit is managed via prek (not pre-commit). Install with prek install. Hooks run on commit:
- Standard checks (large files, AST, trailing whitespace, etc.)
ruff check --fixruff formatmypy --install-types --non-interactive .
Run all hooks manually: prek
Code Style Guidelines
Imports
- Standard library first, then third-party, then local (enforced by ruff
Irules / isort). - Use relative imports within the
ddgspackage (e.g.,from .base import BaseSearchEngine). - Do not use
from __future__ import annotations; use Python 3.10+ union syntax directly:str | None. - Guard type-only imports with
if TYPE_CHECKING:to avoid runtime imports.
Typing
- mypy strict mode is enabled. All functions must have full type annotations (parameters and return types).
- Use
ClassVarfor class-level attributes on classes. - Use
Anysparingly; prefer concrete types. Use# noqa: ANN401whenAnyis intentional. - Use generics (
Generic[T]) for result-type polymorphism (seeBaseSearchEngine[T]). - Union types:
str | None(notOptional[str]),bool | str(notUnion[bool, str]). - Use
Literalfor constrained string values (e.g.,Literal["text", "images"]).
Naming
- Classes: PascalCase (e.g.,
BaseSearchEngine,HttpClient,Duckduckgo). - Functions/methods: snake_case (e.g.,
build_payload,extract_results). - Constants: UPPER_SNAKE_CASE (e.g.,
ENGINES). - Private: prefix with
_(e.g.,_search,_get_engines,_normalize_url). - Test files:
*_test.py(nottest_*.py). - Test functions:
test_*(e.g.,test_text_search).
Formatting
- Line length: 120 characters max (
ruffsetting). - Quotes: double quotes preferred (ruff formatter default).
- Trailing commas: handled by formatter.
- Docstrings: Google style, required on all public classes/methods (
pydocstyle Drules enabled). Exception:D107(missing__init__docstring) is ignored.
Error Handling
- Raise custom exceptions from
ddgs/exceptions.py:DDGSException(base),RatelimitException,TimeoutException. - Pattern: define a local
msgvariable, thenraise SomeException(msg). - Use
raise ... from exwhen re-raising to preserve exception chains. - Use
logger.info()/logger.warning()for non-fatal errors (notprint(); ruffT20bans print). - Bare
exceptis forbidden; useexcept Exception as ex:with# noqa: BLE001if catching all.
General Patterns
- Keyword-only args after
*(e.g.,*, verify: bool | str = True). - Use
@classmethodand@staticmethodwhere appropriate. - Use
@dataclassfor result data structures (seeTextResult,ImagesResult, etc.). - Use
__slots__for lightweight wrapper classes (seeResponse). - Use
cached_propertyfor expensive lazy computations. - Suppress ruff rules inline with
# noqa: RULEwhen justified (document why implicitly by context).
Adding a New Search Engine
- Create
ddgs/engines/<engine_name>.py. - Subclass
BaseSearchEngine[<ResultType>]. - Set class variables:
name,category,provider,search_url,search_method,items_xpath,elements_xpath. - Implement
build_payload(). - Register in
ddgs/engines/__init__.pyunder the correct categoryENGINESdict. - Add integration tests in
tests/.
CLI
The CLI is built with Click (ddgs/cli.py). Entry point: ddgs command via ddgs.cli:safe_entry_point.
# Text search
.venv/bin/ddgs text -q "python" --max-results 5
# Images, news, videos, books
.venv/bin/ddgs images -q "cats"
.venv/bin/ddgs news -q "tech" --timelimit d
# Save results
.venv/bin/ddgs text -q "dogs" -o results.json --format json
.venv/bin/ddgs text -q "dogs" -o results.csv --format csvAdding Tests
- Test files live in
tests/and are named*_test.py. - Use
pytestfixtures. Thepause_between_testsautouse fixture adds a 2s delay between tests. - Tests are integration tests that make real network calls — do not mock HTTP.
- Use
CliRunnerfrom Click for CLI tests.
Things to Avoid
- Do not use
print()— uselogginginstead (ruffT20bans print). - Do not use
Optional[T]— useT | None. - Do not import
TYPE_CHECKING-guarded modules at runtime. - Do not add
.gitignore-listed or generated files (.mypy_cache/,build/,*.egg-info/). - Do not commit without running
make lintandmake testfirst. - Do not skip the 2s test pause — it prevents rate-limiting from engines.
- Do not create
test_*files — use*_test.pynaming convention.
Using ddgs as a Search Tool
If you need to search the web, extract URLs, or find images/news/videos/books,
see skills/ddgs/SKILL.md for Python API, CLI, and MCP integration guidance.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

