Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/franckldx/node-duckduckgo
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.
https://github.com/franckldx/node-duckduckgo
duckduckgo javascript typescript
Last synced: 3 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/franckldx/node-duckduckgo
- Owner: franckLdx
- License: other
- Created: 2016-11-24T20:21:45.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-04-10T06:17:32.000Z (almost 3 years ago)
- Last Synced: 2024-10-07T15:15:40.706Z (4 months ago)
- Topics: duckduckgo, javascript, typescript
- Language: TypeScript
- Homepage:
- Size: 507 KB
- Stars: 13
- Watchers: 2
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
Yet another node lib for requesting [Duck Duck Go](https://duckduckgo.com/).
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
```javascript
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](https://github.com/axios/axios) and return an AxiosResponse:
```javascript
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](https://api.duckduckgo.com/api)example:
```javascript
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](https://api.duckduckgo.com/api) 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.