duckduckgo_search 0.1.4 copy "duckduckgo_search: ^0.1.4" to clipboard
duckduckgo_search: ^0.1.4 copied to clipboard

DuckDuckGo Search API for Dart

duckduckgo_search #

Search using the DuckDuckGo api

Features #

  • searching for text.
  • search suggestions.
  • quick answers

Installation #

Add the following dependency to your pubspec.yaml file:

dependencies:
  duckduckgo_search: ^0.1.1
copied to clipboard

Then, run flutter pub get or dart pub get to install the package.

Usage #

Import the package in your Dart file:

import 'package:duckduckgo_search /duckduckgo_search.dart';
copied to clipboard

Perform a search:


void main() async {
  final results = await DuckDuckGoSearch.text('dartlang');
  for (var result in results) {
    print(result.title);
    print(result.url);
    print(result.body);
    print('---');
  }
}
copied to clipboard

Request search suggestions:

void main() async {
  final results = await DuckDuckGoSearch.suggestions('dartlang');
  for (var suggestion in results) {
   print(suggestion);
  }
}
copied to clipboard

quick answer:

void main() async {
  final answer = await DuckDuckGoSearch.answer('who is miles davis');
   print(answer.answerAbstract);
}
copied to clipboard

Contributing #

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License #

This project is licensed under the MIT License. See the LICENSE file for details.

Changelog See the CHANGELOG file for version history.

Acknowledgements #

This library is a Dart port of the Python duckduckgo_search library.

6
likes
130
points
66
downloads

Publisher

verified publisherglenfordwilliams.com

Weekly Downloads

2024.09.22 - 2025.04.06

DuckDuckGo Search API for Dart

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

dio, html, html_unescape, http, json_annotation, xpath_selector, xpath_selector_html_parser

More

Packages that depend on duckduckgo_search