Repolode
deedy5

deedy5/ddgs

A Python metasearch library that queries multiple web search backends and returns unified text, image, video, news and book results.

Open-source alternative to:Google Custom Search API

Stars
3,024
Forks
287
Open issues
33
Last commit
2 months ago

What is it?

DDGS is a Python metasearch library that sends one query to several web search services and returns the results in a common format. Its text() method can use backends such as Bing, Brave, DuckDuckGo, Google, Mojeek, Startpage, Yandex, Yahoo and Wikipedia, with the default backend set to auto.

Beyond web text, the library offers images(), videos(), news() and books() methods, plus extract(), which fetches a URL and converts the page to Markdown, plain text, rich text, raw HTML or raw bytes. Results come back as lists of dictionaries, and the same functions are available through a command-line interface.

For integration, DDGS includes a FastAPI-based API server with endpoints for each search type and for extraction, and an MCP server over stdio that exposes these operations as tools to clients such as Cursor or Claude Desktop. Requests can be routed through an HTTP, HTTPS or SOCKS5 proxy.

Key features

  • 01Aggregates text search results from multiple backends such as Bing, Brave, Google and DuckDuckGo.
  • 02Provides image, video, news and book search methods with type-specific filters.
  • 03Extracts page content from a URL as Markdown, plain text, rich text, HTML or raw bytes.
  • 04Includes a CLI, a FastAPI API server and an MCP server for tool-based clients.
  • 05Supports HTTP, HTTPS and SOCKS5 proxies and configurable timeouts.

Use cases

  • Adding web search to a Python application or LLM agent without a paid search API.
  • Exposing search and page extraction as tools for MCP-compatible AI assistants.
  • Running a self-hosted search endpoint for internal services via the Docker-ready API server.
  • Collecting search results or page text from the command line for scripts.

Quick start

  1. 1

    Install the base package with pip

    pip install -U ddgs
  2. 2

    Run a text search from Python

    python3 -c "from ddgs import DDGS; print(DDGS().text('python programming', max_results=5))"

Things to know

  • Results come from third-party search backends, so availability and result quality depend on those services.

Topics

FAQ

What is ddgs?
A Python metasearch library that queries multiple web search backends and returns unified text, image, video, news and book results. DDGS is a Python metasearch library that sends one query to several web search services and returns the results in a common format. Its text() method can use backends such as Bing, Brave, DuckDuckGo, Google, Mojeek, Startpage, Yandex, Yahoo and Wikipedia, with the default backend set to auto.
Is ddgs free to use? What license does it have?
ddgs is open source under the MIT license. Check the license terms before using it in commercial products.
Is ddgs still maintained?
Updated within 6 months. The last commit to ddgs was on Aug 26, 2026.
What can I use ddgs for?
Adding web search to a Python application or LLM agent without a paid search API. Exposing search and page extraction as tools for MCP-compatible AI assistants. Running a self-hosted search endpoint for internal services via the Docker-ready API server. Collecting search results or page text from the command line for scripts.
How do I install ddgs?
Install the base package with pip: pip install -U ddgs Run a text search from Python: python3 -c "from ddgs import DDGS; print(DDGS().text('python programming', max_results=5))"
Where can I get ddgs?
The source code and installation instructions are on GitHub: https://github.com/deedy5/ddgs

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects