{"id":2015,"library":"ddgs","title":"DDGS (formerly duckduckgo-search)","description":"DDGS is a Python metasearch library that aggregates results from various web search services, including DuckDuckGo, Bing, and Google, without requiring an API key. It provides programmatic access to different search types such as text, images, videos, news, and books. The library is actively maintained, with frequent releases; the current version is 9.13.0.","status":"active","version":"9.13.0","language":"en","source_language":"en","source_url":"https://github.com/deedy5/ddgs","tags":["search","web scraping","metasearch","duckduckgo","api-free"],"install":[{"cmd":"pip install ddgs","lang":"bash","label":"Latest stable version"}],"dependencies":[{"reason":"HTML parsing","package":"lxml","optional":false},{"reason":"Dependency management","package":"primp","optional":false},{"reason":"Command-line interface (CLI)","package":"click","optional":false}],"imports":[{"note":"The package was renamed from 'duckduckgo_search' to 'ddgs'.","wrong":"from duckduckgo_search import DDGS","symbol":"DDGS","correct":"from ddgs import DDGS"}],"quickstart":{"code":"from ddgs import DDGS\n\n# Initialize DDGS with optional proxy or timeout\nddgs_client = DDGS(timeout=20)\n\n# Perform a text search\nresults = ddgs_client.text(\n    \"python programming tutorials\",\n    region=\"wt-wt\", # worldwide\n    safesearch=\"moderate\",\n    timelimit=\"y\", # past year\n    max_results=5\n)\n\nfor r in results:\n    print(f\"Title: {r.get('title')}\\nURL: {r.get('href')}\\n\")\n\n# Example of an image search\nimage_results = ddgs_client.images(\n    \"cute puppies\",\n    region=\"us-en\",\n    safesearch=\"off\",\n    max_results=3\n)\n\nif image_results:\n    print(f\"First image URL: {image_results[0].get('image')}\")","lang":"python","description":"This example demonstrates how to initialize the DDGS client and perform a basic text search. It also includes an example of an image search, showcasing common parameters like region, safesearch, timelimit, and max_results. Results are returned as a list of dictionaries."},"warnings":[{"fix":"Uninstall `duckduckgo-search` and install `ddgs` via `pip install --upgrade ddgs`. Update all imports from `from duckduckgo_search import DDGS` to `from ddgs import DDGS`.","message":"The package name has been officially changed from `duckduckgo-search` to `ddgs`. Continuing to use the old package name will lead to `RuntimeWarning` and may prevent access to newer features and bug fixes.","severity":"breaking","affected_versions":"All versions 9.0.0 and above"},{"fix":"Ensure your project's Python environment is 3.10 or higher. Upgrade Python if necessary.","message":"Python 3.9 support was dropped in version 9.9.0. Projects using `ddgs` (version 9.9.0+) must use Python 3.10 or newer.","severity":"breaking","affected_versions":"9.9.0 and above"},{"fix":"Keep the `ddgs` library updated to the latest version. The developers frequently release fixes for backend changes. Monitor GitHub releases for relevant updates.","message":"The library acts as a metasearch tool, using various backends (DuckDuckGo, Bing, Google, etc.). Specific backends can be unstable or have their scraping methods change, leading to temporary issues or irrelevant results. This often necessitates updating the library.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Utilize rotating proxies or services like Tor (by setting `proxy=\"tb\"` for Tor Browser's SOCKS5 proxy) to distribute requests. Avoid making too many requests in a short period without a delay.","message":"Frequent or high-volume requests without proper proxy management can lead to rate limiting or IP bans from search engines.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always access results by indexing the list (e.g., `results[0]`) after checking if the list is not empty.","message":"The search methods (e.g., `text()`, `images()`) always return a list of dictionaries, even when `max_results=1`. Users might incorrectly assume a single dictionary is returned.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}