npm install duck-duck-scrape
- yarn add duck-duck-scrape
Search from DuckDuckGo and utilize its spice APIs for things such as stocks, weather, currency conversion and more!
- Search
- Regular search
- Image search
- Video search
- News search
- Stocks (via Xignite)
- Time for Location API (via timeanddate.com)
- Currency Conversion (via XE)
- Forecast (via Dark Sky)
- Dictionary
- Definition
- Audio
- Pronunciation
- Hyphenation
const DDG = require('duck-duck-scrape');
const searchResults = await DDG.search('node.js', {
safeSearch: DDG.SafeSearchType.STRICT
});
// DDG.stocks('aapl')
// DDG.currency('usd', 'eur', 1)
// DDG.dictionaryDefinition('happy')
console.log(searchResults);
/**
{
noResults: false,
vqd: '3-314...',
results: [
{
title: 'Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript...',
...
url: 'https://nodejs.org/',
bang: {
prefix: 'node',
title: 'node.js docs',
domain: 'nodejs.org'
}
},
...
]
}
*/
import { search, SafeSearchType } from 'duck-duck-scrape';
// import * as DDG from 'duck-duck-scrape';
const searchResults = await search('node.js', {
safeSearch: SafeSearchType.STRICT
});