JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 26902
  • Score
    100M100P100Q167635F
  • License MIT

Search from DuckDuckGo and use it's spice APIs.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (duck-duck-scrape) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    NPM version NPM downloads ESLint status DeepScan grade

    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!

    Available Features

    • 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

    Quickstart

    JavaScript

    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'
          }
        },
        ...
      ]
    }
    
    */

    TypeScript

    import { search, SafeSearchType } from 'duck-duck-scrape';
    // import * as DDG from 'duck-duck-scrape';
    
    const searchResults = await search('node.js', {
      safeSearch: SafeSearchType.STRICT
    });