Skip to content

Yet another node lib for requesting Duck Duck Go. This one has been written in typescript (2.x or above) and can be used by javascript (es2018 or above) software or by typescript software.

License

Notifications You must be signed in to change notification settings

franckLdx/node-duckduckgo

Repository files navigation

Yet another node lib for requesting Duck Duck Go.

This one has been written in typescript (2.x or above) and can be used by javascript (es2018 or above) software or by typescript software.

Examples

async function get() {
  try {
    const result = await duckIt('bart simpsons');
    console.log(result.data.AbstractText);
  } catch (err) {
    console.error('oups', err);
  }
}

API

  • duckIt uses axios and return an AxiosResponse:
const result = await duckIt('bart simpsons');
  • duckIt can be called with an options object, eahc item is optional:
    • appName: an application name, default node-duckduckgo
    • format: received format data, possible values: 'json' or 'xml', default 'json'
    • parentalFilter: parental filter activated or not, possible values 'Activated', 'Moderate' and 'Deactivated', default: 'Activated'
    • noRedirect: boolean, true to skip HTTP redirects
    • noHtml: boolean, true to remove HTML from text
    • skipDisambig: boolean, true to skip disambiguation (for information about this options see Duck Duck GO API documentation

example:

const result = await duckIt('bart simpsons', { noHtml: true, parentalFilter: 'Moderate' });

Usage

node-duckduckgo (this lib) is open sources (MIT license) but to use Duck Duck Go results you need to follow Duck Duck Go's Terms and Conditions. Please read this page before any usage.

2.x

This major release offers a completly different interface than 1.x. You may continue to use 1.X but as it won't evolve anymore, your advise to migrate to 2.X.

About

Yet another node lib for requesting Duck Duck Go. This one has been written in typescript (2.x or above) and can be used by javascript (es2018 or above) software or by typescript software.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published