https://github.com/victrme/search-suggestions
An API that parses search suggestions from a number of search providers (google, bing, duckduckgo...)
https://github.com/victrme/search-suggestions
api api-proxy edge-function netlify suggestions
Last synced: about 2 months ago
JSON representation
An API that parses search suggestions from a number of search providers (google, bing, duckduckgo...)
- Host: GitHub
- URL: https://github.com/victrme/search-suggestions
- Owner: victrme
- License: unlicense
- Created: 2023-06-12T11:40:20.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-28T08:58:29.000Z (8 months ago)
- Last Synced: 2025-03-23T19:11:46.180Z (2 months ago)
- Topics: api, api-proxy, edge-function, netlify, suggestions
- Language: TypeScript
- Homepage: https://suggestions.victr.me
- Size: 148 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Search Suggestions API
An API that parses search suggestions from a number of search providers. Might not live very long depending on the volatility of their APIs. Here's the list of available search providers:
- Google ( w/ presentations )
- Yahoo ( w/ presentations )
- Brave ( w/ presentations )
- Bing ( w/ presentations )
- Duckduckgo
- QwantTry it here: https://suggestions.victr.me/
## How to use
#### Endpoint
```HTTP
GET /
```| Parameter | Role | Requirement |
|-----------|-----------------|-------------|
| `q` | Search query | required |
| `l` | Localization | optional |
| `with` | Search provider | optional |#### Response
```ts
type Response = {
text: string
desc?: string // when presentation is available
image?: string // when presentation is available
}[]
```### Websockets
Using Clouflare workers, you can also get results using websockets.```js
const socket = new WebSocket('ws://localhost:8787')socket.onmessage = function (event: MessageEvent) {
console.log(JSON.parse(event.data))
}socket.send(JSON.stringify({ q, with, lang }))
```## Examples
```HTTP
GET /?q=can%20we%20go%20to
``````json
[
{ "text": "can we go to heaven with tattoos" },
{ "text": "can we go to mars" },
{ "text": "can we go to saturn" },
{ "text": "can we go to your room now" }
]
```
```HTTP
GET /?with=google&q=vercel&l=fr
``````json
[
{
"text": "vercel"
},
{
"text": "vercelli",
"desc": "Verceil — Ville en Italie",
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQID9TX_tSffwg1RLvecGtuPHMZWbbEOSx0d6_poXT6bqChYkEazWYz6G1ilQ&s=10"
},
{
"text": "vercel villedieu le camp",
"desc": "Commune en France",
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQGB1DiSdJxQgJfHphVKCfENgDCeGWobdbBpErowNFfDEExoFTuRmmPfEVJuQ&s=10"
},
{
"text": "vercel pricing"
},
{
"text": "vercel deploy"
}
]
```## Install
First clone this repository.
### Netlify
```bash
npm install netlify-cli -g# On port 8888
netlify dev
```### Cloudflare Workers
```bash
npm install wrangler -g# On port 8787
wrangler devwrangler deploy
```