The DDGS class provides methods to perform various types of web searches. All search methods return a list[dict[str, Any]] containing results.
Common search methods include:
text(query, ...): General web text search.images(query, ...): Image search.news(query, ...): News search.videos(query, ...): Video search.books(query, ...): Book search.
Each method supports parameters like max_results, region, safesearch, and backend.
from ddgs import DDGS
# Text search
results = DDGS().text("python async", max_results=5)
# Images, news, videos, books
images = DDGS().images("butterfly", max_results=5)
news = DDGS().news("ai regulation", timelimit="w")
videos = DDGS().videos("rust programming")
books = DDGS().books("machine learning")