Skip to content

Get search suggestions based on a partial search term

License

Notifications You must be signed in to change notification settings

alrico88/sugiero

Repository files navigation

sugiero

Get search suggestions from a partial search term.

Installation

Using npm:

npm i sugiero

Using yarn:

yarn add sugiero

Usage

Using CommonJS

const { getSuggestions } = require('sugiero');

Using imports

import { getSuggestions } from 'sugiero';

Then

const suggestions = await getSuggestions('hotels');

// suggestions will be an array of {term, type} objects

You can choose between multiple providers by passing their name as second argument. If none is provided, Google will be used.

const suggestions = await getSuggestions('hotels', 'Yahoo');

Available search providers are:

  • Brave
  • DuckDuckGo
  • Google
  • Qwant
  • Startpage
  • Swisscows
  • Yahoo
  • YouTube
  • random (chooses a random provider between those available)

Documentation

See DOCS