An open API service indexing awesome lists of open source software.

https://github.com/francoischalifour/algolia-opensearch-suggestions

Service to convert Algolia Query Suggestions to OpenSearch Suggestions.
https://github.com/francoischalifour/algolia-opensearch-suggestions

algolia opensearch query suggestions

Last synced: 5 months ago
JSON representation

Service to convert Algolia Query Suggestions to OpenSearch Suggestions.

Awesome Lists containing this project

README

          

# algolia-opensearch-suggestions

Service to convert [Algolia Query Suggestions](https://www.algolia.com/doc/guides/getting-insights-and-analytics/leveraging-analytics-data/query-suggestions/) to [OpenSearch Suggestions](https://github.com/dewitt/opensearch/blob/c9ed38a524c53b61d582634b28e5e83af9f8f8ae/mediawiki/Specifications/OpenSearch/Extensions/Suggestions/1.1/Draft%201.wiki).

![Preview](.github/preview.png)

Picture of Firefox showing Algolia Query Suggestions from the URL bar with OpenSearch Suggestions.

## Usage

### Query parameters

- [`appId`](https://www.algolia.com/api-keys/)
- [`apiKey`](https://www.algolia.com/api-keys/)
- [`indexName`](https://www.algolia.com/explorer/)
- [`query`](https://www.algolia.com/doc/api-reference/api-parameters/query/)
- ...any [Algolia Search Parameters](https://www.algolia.com/doc/api-reference/search-api-parameters/)

###### Example

```
https://your-website.com/.netlify/functions/suggestions?query=iphone&appId=appId&apiKey=apiKey&indexName=indexName&hitsPerPage=3
```

### Returns

```json
["iphone",["iphone","iphone 6s","iphone gray"]]
```

### Add OpenSearch to your website

```xml



```

###### `opensearch.xml`

```html







```

###### `index.html`

## Resources

- [OpenSearch Description Format](https://developer.mozilla.org/en-US/docs/Web/OpenSearch)
- [OpenSearch Suggestions](https://developer.mozilla.org/en-US/docs/Archive/Add-ons/Supporting_search_suggestions_in_search_plugins)
- [OpenSearch Specs](https://github.com/dewitt/opensearch/blob/c9ed38a524c53b61d582634b28e5e83af9f8f8ae/opensearch-1-1-draft-6.md)

## License

[MIT](LICENSE)