Autocomplete

The Autocomplete endpoint provides a list of the most popular ingredients and products in several languages and can be used to add autocomplete functionality to your application.

get
Autocomplete

https://cdn.whisk.com/autocomplete/v1/{language-tag}/{file-type}.json
Request
Response
Request
Path Parameters
language-tag
required
string
Language
file-type
required
string
The amount of data you will be getting in the product list
Response
200: OK
{
"products": [
{
"name": "ANCHOVY",
"displayName": "Acciuga",
"imageUrl": "https://whisk-res.cloudinary.com/image/upload/v1550764890/graph/fooddb/cdd6c37ccd140664a46573d10e2fde25.jpg",
"metadata": {
"category": "MEATS AND SEAFOOD",
"storing": {
"pantry": {
"metric": "Years",
"min": 1,
"max": 1
},
"defaultLocation": "Pantry"
}
},
"nounForm": "singular"
}
]
}

Sample Request

curl "https://cdn.whisk.com/autocomplete/v1/it/all.json" \
-H "Accept-Encoding: deflate, gzip" \
-H "If-Modified-Since: Wed, 04 Mar 2020 10:30:58"

language-tag

The language and locale of the autocomplete list. E.g en-us.

LANGUAGE CODE

LOCALE CODE

DEFAULT LOCALE

en

gb, us

gb

es

es, mx

es

fr

fr

sv

se

de

de

zh

cn

ko

it

no

For English language tag could be:

  • en-us – US product names in English;

  • en-gb – GB product names in English;

  • en - same as en-gb.

file-type

This parameter allows you to control the amount of data you will be getting in the product list. Available options:

  • all – full data, all items with full content;

  • all-slim - all items are returned and the items do not include metadata information;

  • food - only food items, including metadata (check the response section for more information);

  • food-slim - only food items not including metadata.

Working with images

Our CDN provides utilities to manage image size and format. You can find more information in our: Image Load Optimization documentation.

Optimization

To reduce the amount of traffic for your application we recommend using these headers:

  1. Accept-Encoding: deflate, gzip - this will reduce the size of the response, consequently speeding up the request time.

  2. If-Modified-Since - this will download content only if it has been modified. More about it here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since.

Response

ATTRIBUTE

TYPE

DESCRIPTION

name

string

The canonical name of the product, identical for all languages

displayName

string

The name of the product in the selected language

imageUrl

string

The link to the product’s image

nounForm

string

Indicates if the product name is singular, plural or invariant

metadata

Metadata

Metadata

ATTRIBUTE

TYPE

DESCRIPTION

category

string

The product’s category

sorting

string

The product’s storing recommendation