Skip to main content
DuckDuckGoTools is a convenience wrapper around WebSearchTools with the backend defaulting to DuckDuckGo. It enables an Agent to search the web for information using the DuckDuckGo search engine.
For more flexibility with multiple search backends (Google, Bing, Brave, Yandex, etc.), use WebSearchTools directly.

Prerequisites

The following example requires the ddgs library. To install DuckDuckGo, run the following command:
uv pip install -U ddgs

Example

from agno.agent import Agent
from agno.tools.duckduckgo import DuckDuckGoTools

agent = Agent(tools=[DuckDuckGoTools()])
agent.print_response("Whats happening in France?", markdown=True)

Toolkit Params

ParameterTypeDefaultDescription
enable_searchboolTrueEnable DuckDuckGo search function.
enable_newsboolTrueEnable DuckDuckGo news function.
modifierOptional[str]NoneA modifier to prepend to search queries.
fixed_max_resultsOptional[int]NoneA fixed number of maximum results.
proxyOptional[str]NoneProxy to use for requests.
timeoutOptional[int]10Maximum seconds to wait for a response.
verify_sslboolTrueWhether to verify SSL certificates.
timelimitOptional[str]NoneTime limit for results. "d" (day), "w" (week), "m" (month), "y" (year).
regionOptional[str]NoneRegion for results (e.g., "us-en", "uk-en", "ru-ru").
backendOptional[str]"duckduckgo"Backend identifier to use for searching. Currently this toolkit uses the duckduckgo backend.

Toolkit Functions

FunctionDescription
web_searchSearch DuckDuckGo for a query. Parameters include query (str) for the search query and max_results (int, default=5) for maximum results. Returns JSON formatted search results.
search_newsGet the latest news from DuckDuckGo. Parameters include query (str) for the search query and max_results (int, default=5) for maximum results. Returns JSON formatted news results.
For backward compatibility, the aliases duckduckgo_search and duckduckgo_news are also available.

Developer Resources