Skip to main content
search runs a real DuckDuckGo query and raises when the backend fails, so missing dependencies and rate limits are visible instead of silent.
search needs the ddgs package at runtime. Install it with pip install ddgs.

Quick Start

1

Search from an Agent

Give an agent the web search tool for research tasks.
2

Direct capability call

Call search directly when you just need raw results.
If ddgs is missing or the provider rate-limits, search raises RuntimeError instead of returning an empty result. Earlier releases silently returned total=0 — that behaviour is gone.

How It Works

search calls internet_search under the hood. Each result is a dict with title, url, and snippet keys.

Configuration Options

SearchResult fields: results (list of dicts), query, total, metadata.

Capabilities SDK Reference

Auto-generated reference for the capabilities module

Common Patterns

Handle a missing dependency gracefully:
Async search delegates to the sync path:

Best Practices

Run pip install ddgs. Without it, search raises RuntimeError.
Rate limits and missing dependencies surface as RuntimeError. Wrap calls so your app degrades gracefully instead of crashing.
Lower max_results for faster, cheaper queries; raise it when you need broader coverage.

Web Search Tools

Search tools for agents

Capabilities Overview

All LiteLLM parity capabilities