Autocomplete
The Autocomplete endpoint allows you to guess a product a user is writing into an input field. It then may be displayed as a shopping list or search suggestion.
GET
https://api.whisk.com/autocomplete/v2/suggest
This endpoint allows you to get an autocomplete suggestion. It may be used only with User Token for we derive autocomplete language from the User Preferences
Query Parameters
limit
integer
The maximum number of results of each type in the response
q
string
User input string
product_type
string
Type of products in the results you are interested in
{
"response": [
{
"name": "Apple",
"product_id": "697cb490-e9bc-4133-a899-f39bae276a2e",
"product_type": "PRODUCT_TYPE_ONTOLOGY_PRODUCT",
"image": {
"url": "https://whisk-res.cloudinary.com/image/upload/v1550764658/graph/fooddb/41b6df25c3d98c7fe64c9bf713664008.jpg"
}
}
}
product_type
product_type
This parameter determines the type of products in the result. All types of items will be returned if omitted.
Supported product types
Type
Description
PRODUCT_TYPE_ONTOLOGY_PRODUCT
Usual food items
PRODUCT_TYPE_BASE_ITEM
Sample Request and Response
curl -X GET "https://api.whisk.com/autocomplete/v2/suggest?q=app&product_type=PRODUCT_TYPE_ONTOLOGY_PRODUCT&limit=10" \
-H "accept: application/json" \
-H "Authorization: Bearer TOKEN"
Last updated
Was this helpful?