Autocomplete
Autocomplete allows users to offer completions as the user types into a search box in realtime.
caution
This endpoint is very sensible to network latency. If your application isn't able to display autocompletions within ca. 200 milliseconds, users might be annoyed and it might be better to not serve autocompletions at all.
Endpoint
GET /api/v1/search HTTP/1.1
Accept: application/json
Searches in the content database.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| q | query | string | true | Query string |
| take | query | integer(int32) | false | Items to return at max |
| skip | query | integer(int32) | false | Items to skip in results |
Response
Overview
| Status | Meaning | Description |
|---|---|---|
| 200 | OK | A list of search results |
| 500 | Internal Server Error | An unexpected error on the server side |
Response schema
Status Code 200
| Name | Type | Required | Description |
|---|---|---|---|
| total | integer(int32) | true | Total number of found hits |
| data | object | false | Individual hits of the search result |
Examples
200 response
{
"total": 13,
"data": [
{
"id": "..."
},
...
]
}
Code examples
- Shell
- Go
- Node
- C#
- Java
- Python
- Ruby
curl -X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
'/api/v1/search?q=apple'
package main
const fetch = require('node-fetch');
namespace MyApp
package main
import requests
require 'rest-client'
require 'json'