sugiero / Exports
Get search suggestions from a partial search term.
Using npm:
npm i sugiero
Using yarn:
yarn add sugiero
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
- Qwant
- Startpage
- Swisscows
- Yahoo
- YouTube
- random (chooses a random provider between those available)
See DOCS