ddgs
0.3.3, released 7 days ago by kamranx.dev
Aggregates web search results from multiple search engines including DuckDuckGo, Google, and Bing.
WASM-ready
What it does
A professional metasearch library that queries multiple search engines and provides text, image, video, and news search capabilities. It supports result caching, rate limiting, proxy configuration, and includes a command-line interface.
AI-written summary of version 0.3.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to fetch search results programmatically from engines like DuckDuckGo, Google, or Bing
- You require features like result caching, rate limiting, and proxy support for search queries
Skip it when
- You are looking for an official API client for a single search engine's paid web-search developer service
- You need high-volume automated scraping where search engines might apply strict anti-bot measures
Strengths
- Supports multiple search engines and specialized search types (text, images, videos, news)
- Includes built-in result caching, rate limiting, and proxy support
- Provides both a Dart library API and a command-line interface
Weaknesses
- Search engines may implement anti-scraping measures causing potential flakiness
- Relying on web scraping can break if search engine HTML structures change
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 4
not documented
import 'package:ddgs/ddgs.dart';
void main() async {
final ddgs = DDGS();
try {
final results = await ddgs.text(
'Dart programming',
maxResults: 5,
backend: 'duckduckgo',
);
for (final result in results) {
print('${result['title']}: ${result['href']}');
}
} finally {
ddgs.close();
}
}Alternatives
Packages that do the same job and could replace ddgs.
Works with
Packages commonly used together with ddgs: ones it builds on, ones built on it, and its own family.
- xmlddgs depends on itFull-featured XML and XPath library for DOM parsing, SAX streaming, and fluent building.
- htmlddgs depends on itA Dart implementation of an HTML5 parser for strings and bytes.
- argsddgs depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.